diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1aeed2db..4ab27c0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,7 +195,7 @@ jobs: ccache: true cppcheck: true - - name: Install ${{ matrix.compiler }} through brew + - name: Install llvm through brew if: contains(matrix.compiler, 'llvm') run: | brew install ${{ matrix.compiler }} diff --git a/.vscode/settings.json b/.vscode/settings.json index f9992d65..ff5bfc43 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "cmake.useCMakePresets": "always", - "cmake.options.statusBarVisibility": "icon", + "cmake.options.statusBarVisibility": "compact", "files.exclude": { "**/.clangd/**": true }, diff --git a/CMakePresets.json b/CMakePresets.json index 09c90044..19edd879 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -10,11 +10,7 @@ "cmake/presets/x64-linux-llvm.json", "cmake/presets/x64-linux-gcc.json", "cmake/presets/x64-mingw-dynamic-windows-mingw.json", - "cmake/presets/x64-mingw-dynamic-darwin-mingw.json", - "cmake/presets/x64-mingw-dynamic-linux-mingw.json", "cmake/presets/x64-mingw-static-windows-mingw.json", - "cmake/presets/x64-mingw-static-darwin-mingw.json", - "cmake/presets/x64-mingw-static-linux-mingw.json", "cmake/presets/x64-osx-gcc.json", "cmake/presets/x64-osx-llvm.json", "cmake/presets/x64-windows-llvm.json", diff --git a/cmake/presets/default.json b/cmake/presets/default.json index 5a2421b0..0fe171aa 100644 --- a/cmake/presets/default.json +++ b/cmake/presets/default.json @@ -2,7 +2,6 @@ "version": 6, "include": [ "base.json", - "arch/x64.json", "generators/ninja.json" ], "configurePresets": [ @@ -10,7 +9,6 @@ "name": "default", "inherits": [ "base", - "x64", "ninja" ] } diff --git a/cmake/presets/triplets/x64-linux.json b/cmake/presets/triplets/x64-linux.json index 00a3e242..dcbccbd8 100644 --- a/cmake/presets/triplets/x64-linux.json +++ b/cmake/presets/triplets/x64-linux.json @@ -11,8 +11,7 @@ "x64" ], "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-linux", - "VCPKG_HOST_TRIPLET": "x64-linux" + "VCPKG_TARGET_TRIPLET": "x64-linux" } } ] diff --git a/cmake/presets/triplets/x64-mingw-dynamic.json b/cmake/presets/triplets/x64-mingw-dynamic.json index e11e299f..b4c2938e 100644 --- a/cmake/presets/triplets/x64-mingw-dynamic.json +++ b/cmake/presets/triplets/x64-mingw-dynamic.json @@ -12,7 +12,6 @@ ], "cacheVariables": { "VCPKG_TARGET_TRIPLET": "x64-mingw-dynamic", - "VCPKG_HOST_TRIPLET": "x64-mingw-dynamic", "USE_SANITIZER": "OFF" } } diff --git a/cmake/presets/triplets/x64-mingw-static.json b/cmake/presets/triplets/x64-mingw-static.json index 5ac580f7..3eaf2865 100644 --- a/cmake/presets/triplets/x64-mingw-static.json +++ b/cmake/presets/triplets/x64-mingw-static.json @@ -12,7 +12,6 @@ ], "cacheVariables": { "VCPKG_TARGET_TRIPLET": "x64-mingw-static", - "VCPKG_HOST_TRIPLET": "x64-mingw-static", "USE_SANITIZER": "OFF" } } diff --git a/cmake/presets/triplets/x64-osx.json b/cmake/presets/triplets/x64-osx.json index 636f85f7..bc0c0d32 100644 --- a/cmake/presets/triplets/x64-osx.json +++ b/cmake/presets/triplets/x64-osx.json @@ -11,8 +11,7 @@ "x64" ], "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-osx", - "VCPKG_HOST_TRIPLET": "x64-osx" + "VCPKG_TARGET_TRIPLET": "x64-osx" } } ] diff --git a/cmake/presets/triplets/x64-windows.json b/cmake/presets/triplets/x64-windows.json index afe4ef00..929700c0 100644 --- a/cmake/presets/triplets/x64-windows.json +++ b/cmake/presets/triplets/x64-windows.json @@ -11,8 +11,7 @@ "x64" ], "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows", - "VCPKG_HOST_TRIPLET": "x64-windows" + "VCPKG_TARGET_TRIPLET": "x64-windows" } } ] diff --git a/cmake/presets/x64-mingw-dynamic-darwin-mingw.json b/cmake/presets/x64-mingw-dynamic-darwin-mingw.json deleted file mode 100644 index 7d87f43c..00000000 --- a/cmake/presets/x64-mingw-dynamic-darwin-mingw.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "version": 6, - "include": [ - "base.json", - "os/darwin.json", - "compilers/mingw.json", - "triplets/x64-mingw-dynamic.json" - ], - "configurePresets": [ - { - "name": "x64-mingw-dynamic-darwin-mingw", - "inherits": [ - "base", - "darwin", - "mingw", - "x64-mingw-dynamic" - ] - } - ], - "buildPresets": [ - { - "name": "x64-mingw-dynamic-darwin-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-dynamic-darwin-mingw" - } - ], - "testPresets": [ - { - "name": "x64-mingw-dynamic-darwin-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-dynamic-darwin-mingw" - } - ], - "workflowPresets": [ - { - "name": "x64-mingw-dynamic-darwin-mingw", - "steps": [ - { - "type": "configure", - "name": "x64-mingw-dynamic-darwin-mingw" - }, - { - "type": "build", - "name": "x64-mingw-dynamic-darwin-mingw" - }, - { - "type": "test", - "name": "x64-mingw-dynamic-darwin-mingw" - } - ] - } - ] -} diff --git a/cmake/presets/x64-mingw-dynamic-linux-mingw.json b/cmake/presets/x64-mingw-dynamic-linux-mingw.json deleted file mode 100644 index 0c919569..00000000 --- a/cmake/presets/x64-mingw-dynamic-linux-mingw.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "version": 6, - "include": [ - "base.json", - "os/linux.json", - "compilers/mingw.json", - "triplets/x64-mingw-dynamic.json" - ], - "configurePresets": [ - { - "name": "x64-mingw-dynamic-linux-mingw", - "inherits": [ - "base", - "linux", - "mingw", - "x64-mingw-dynamic" - ] - } - ], - "buildPresets": [ - { - "name": "x64-mingw-dynamic-linux-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-dynamic-linux-mingw" - } - ], - "testPresets": [ - { - "name": "x64-mingw-dynamic-linux-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-dynamic-linux-mingw" - } - ], - "workflowPresets": [ - { - "name": "x64-mingw-dynamic-linux-mingw", - "steps": [ - { - "type": "configure", - "name": "x64-mingw-dynamic-linux-mingw" - }, - { - "type": "build", - "name": "x64-mingw-dynamic-linux-mingw" - }, - { - "type": "test", - "name": "x64-mingw-dynamic-linux-mingw" - } - ] - } - ] -} diff --git a/cmake/presets/x64-mingw-static-darwin-mingw.json b/cmake/presets/x64-mingw-static-darwin-mingw.json deleted file mode 100644 index c40a5be2..00000000 --- a/cmake/presets/x64-mingw-static-darwin-mingw.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "version": 6, - "include": [ - "base.json", - "os/darwin.json", - "compilers/mingw.json", - "triplets/x64-mingw-static.json" - ], - "configurePresets": [ - { - "name": "x64-mingw-static-darwin-mingw", - "inherits": [ - "base", - "darwin", - "mingw", - "x64-mingw-static" - ] - } - ], - "buildPresets": [ - { - "name": "x64-mingw-static-darwin-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-static-darwin-mingw" - } - ], - "testPresets": [ - { - "name": "x64-mingw-static-darwin-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-static-darwin-mingw" - } - ], - "workflowPresets": [ - { - "name": "x64-mingw-static-darwin-mingw", - "steps": [ - { - "type": "configure", - "name": "x64-mingw-static-darwin-mingw" - }, - { - "type": "build", - "name": "x64-mingw-static-darwin-mingw" - }, - { - "type": "test", - "name": "x64-mingw-static-darwin-mingw" - } - ] - } - ] -} diff --git a/cmake/presets/x64-mingw-static-linux-mingw.json b/cmake/presets/x64-mingw-static-linux-mingw.json deleted file mode 100644 index 6297c9da..00000000 --- a/cmake/presets/x64-mingw-static-linux-mingw.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "version": 6, - "include": [ - "base.json", - "os/linux.json", - "compilers/mingw.json", - "triplets/x64-mingw-static.json" - ], - "configurePresets": [ - { - "name": "x64-mingw-static-linux-mingw", - "inherits": [ - "base", - "linux", - "mingw", - "x64-mingw-static" - ] - } - ], - "buildPresets": [ - { - "name": "x64-mingw-static-linux-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-static-linux-mingw" - } - ], - "testPresets": [ - { - "name": "x64-mingw-static-linux-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-static-linux-mingw" - } - ], - "workflowPresets": [ - { - "name": "x64-mingw-static-linux-mingw", - "steps": [ - { - "type": "configure", - "name": "x64-mingw-static-linux-mingw" - }, - { - "type": "build", - "name": "x64-mingw-static-linux-mingw" - }, - { - "type": "test", - "name": "x64-mingw-static-linux-mingw" - } - ] - } - ] -} diff --git a/cmake/vcpkg/bootstrap/vcpkg_chainload_toolchain.cmake b/cmake/vcpkg/bootstrap/vcpkg_chainload_toolchain.cmake index 0a38f875..0117e9d2 100644 --- a/cmake/vcpkg/bootstrap/vcpkg_chainload_toolchain.cmake +++ b/cmake/vcpkg/bootstrap/vcpkg_chainload_toolchain.cmake @@ -17,6 +17,8 @@ function(_vcpkg_chainload_toolchain) ) endif() + # Load toolchain variables from triplet and architecture + string(LENGTH "${VCPKG_TARGET_ARCHITECTURE}-" _prefix_len) string(SUBSTRING ${VCPKG_TARGET_TRIPLET} ${_prefix_len} -1 _stripped_string) string(REPLACE "-" ";" _triplet_parts "${_stripped_string}") diff --git a/cmake/vcpkg/bootstrap/vcpkg_load_triplet.cmake b/cmake/vcpkg/bootstrap/vcpkg_load_triplet.cmake index 89f62e74..d379e465 100644 --- a/cmake/vcpkg/bootstrap/vcpkg_load_triplet.cmake +++ b/cmake/vcpkg/bootstrap/vcpkg_load_triplet.cmake @@ -82,15 +82,14 @@ function(_vcpkg_detect_host_triplet) return() endif() else() - find_program(Z_VCPKG_CL cl) - if(Z_VCPKG_CL MATCHES "amd64/cl.exe$" OR Z_VCPKG_CL MATCHES "x64/cl.exe$") + find_program(_vcpkg_cl cl) + if(_vcpkg_cl MATCHES "amd64/cl.exe$" OR _vcpkg_cl MATCHES "x64/cl.exe$") set(_detect_target_triplet_arch x64) - elseif(Z_VCPKG_CL MATCHES "arm/cl.exe$") + elseif(_vcpkg_cl MATCHES "arm/cl.exe$") set(_detect_target_triplet_arch arm) - elseif(Z_VCPKG_CL MATCHES "arm64/cl.exe$") + elseif(_vcpkg_cl MATCHES "arm64/cl.exe$") set(_detect_target_triplet_arch arm64) - elseif(Z_VCPKG_CL MATCHES "bin/cl.exe$" OR Z_VCPKG_CL MATCHES - "x86/cl.exe$") + elseif(_vcpkg_cl MATCHES "bin/cl.exe$" OR _vcpkg_cl MATCHES "x86/cl.exe$") set(_detect_target_triplet_arch x86) elseif( CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64" @@ -114,17 +113,10 @@ function(_vcpkg_detect_host_triplet) elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "loongarch64") set(_detect_target_triplet_arch loongarch64) else() - if(Z_VCPKG_CMAKE_IN_TRY_COMPILE) - message( - STATUS - "Unable to determine target architecture, continuing without vcpkg." - ) - else() - message( - WARNING - "Unable to determine target architecture, continuing without vcpkg." - ) - endif() + message( + WARNING + "Unable to determine target architecture, continuing without vcpkg." + ) set(VCPKG_TOOLCHAIN ON) cmake_policy(POP) return() @@ -200,6 +192,8 @@ macro(_vcpkg_load_triplet) endif() endif() + # Load triplet variables from VCPKG_TARGET_TRIPLET triplet file + set(_triplet "triplets/${VCPKG_TARGET_TRIPLET}.cmake") set(_community_triplet "triplets/community/${VCPKG_TARGET_TRIPLET}.cmake") diff --git a/template/.vscode/settings.json b/template/.vscode/settings.json index f9992d65..ff5bfc43 100644 --- a/template/.vscode/settings.json +++ b/template/.vscode/settings.json @@ -1,6 +1,6 @@ { "cmake.useCMakePresets": "always", - "cmake.options.statusBarVisibility": "icon", + "cmake.options.statusBarVisibility": "compact", "files.exclude": { "**/.clangd/**": true }, diff --git a/template/CMakePresets.json b/template/CMakePresets.json index 09c90044..19edd879 100644 --- a/template/CMakePresets.json +++ b/template/CMakePresets.json @@ -10,11 +10,7 @@ "cmake/presets/x64-linux-llvm.json", "cmake/presets/x64-linux-gcc.json", "cmake/presets/x64-mingw-dynamic-windows-mingw.json", - "cmake/presets/x64-mingw-dynamic-darwin-mingw.json", - "cmake/presets/x64-mingw-dynamic-linux-mingw.json", "cmake/presets/x64-mingw-static-windows-mingw.json", - "cmake/presets/x64-mingw-static-darwin-mingw.json", - "cmake/presets/x64-mingw-static-linux-mingw.json", "cmake/presets/x64-osx-gcc.json", "cmake/presets/x64-osx-llvm.json", "cmake/presets/x64-windows-llvm.json", diff --git a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja index c6f36fe1..72c9f6ec 100644 --- a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja +++ b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja @@ -203,7 +203,7 @@ jobs: ccache: true cppcheck: true - - name: Install {{ '${{ matrix.compiler }}' }} through brew + - name: Install llvm through brew if: contains(matrix.compiler, 'llvm') run: | brew install {{ '${{ matrix.compiler }}' }} diff --git a/template/cmake/presets/default.json b/template/cmake/presets/default.json index 5a2421b0..0fe171aa 100644 --- a/template/cmake/presets/default.json +++ b/template/cmake/presets/default.json @@ -2,7 +2,6 @@ "version": 6, "include": [ "base.json", - "arch/x64.json", "generators/ninja.json" ], "configurePresets": [ @@ -10,7 +9,6 @@ "name": "default", "inherits": [ "base", - "x64", "ninja" ] } diff --git a/template/cmake/presets/triplets/x64-linux.json b/template/cmake/presets/triplets/x64-linux.json index 00a3e242..dcbccbd8 100644 --- a/template/cmake/presets/triplets/x64-linux.json +++ b/template/cmake/presets/triplets/x64-linux.json @@ -11,8 +11,7 @@ "x64" ], "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-linux", - "VCPKG_HOST_TRIPLET": "x64-linux" + "VCPKG_TARGET_TRIPLET": "x64-linux" } } ] diff --git a/template/cmake/presets/triplets/x64-mingw-dynamic.json b/template/cmake/presets/triplets/x64-mingw-dynamic.json index e11e299f..b4c2938e 100644 --- a/template/cmake/presets/triplets/x64-mingw-dynamic.json +++ b/template/cmake/presets/triplets/x64-mingw-dynamic.json @@ -12,7 +12,6 @@ ], "cacheVariables": { "VCPKG_TARGET_TRIPLET": "x64-mingw-dynamic", - "VCPKG_HOST_TRIPLET": "x64-mingw-dynamic", "USE_SANITIZER": "OFF" } } diff --git a/template/cmake/presets/triplets/x64-mingw-static.json b/template/cmake/presets/triplets/x64-mingw-static.json index 5ac580f7..3eaf2865 100644 --- a/template/cmake/presets/triplets/x64-mingw-static.json +++ b/template/cmake/presets/triplets/x64-mingw-static.json @@ -12,7 +12,6 @@ ], "cacheVariables": { "VCPKG_TARGET_TRIPLET": "x64-mingw-static", - "VCPKG_HOST_TRIPLET": "x64-mingw-static", "USE_SANITIZER": "OFF" } } diff --git a/template/cmake/presets/triplets/x64-osx.json b/template/cmake/presets/triplets/x64-osx.json index 636f85f7..bc0c0d32 100644 --- a/template/cmake/presets/triplets/x64-osx.json +++ b/template/cmake/presets/triplets/x64-osx.json @@ -11,8 +11,7 @@ "x64" ], "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-osx", - "VCPKG_HOST_TRIPLET": "x64-osx" + "VCPKG_TARGET_TRIPLET": "x64-osx" } } ] diff --git a/template/cmake/presets/triplets/x64-windows.json b/template/cmake/presets/triplets/x64-windows.json index afe4ef00..929700c0 100644 --- a/template/cmake/presets/triplets/x64-windows.json +++ b/template/cmake/presets/triplets/x64-windows.json @@ -11,8 +11,7 @@ "x64" ], "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows", - "VCPKG_HOST_TRIPLET": "x64-windows" + "VCPKG_TARGET_TRIPLET": "x64-windows" } } ] diff --git a/template/cmake/presets/x64-mingw-dynamic-darwin-mingw.json b/template/cmake/presets/x64-mingw-dynamic-darwin-mingw.json deleted file mode 100644 index 7d87f43c..00000000 --- a/template/cmake/presets/x64-mingw-dynamic-darwin-mingw.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "version": 6, - "include": [ - "base.json", - "os/darwin.json", - "compilers/mingw.json", - "triplets/x64-mingw-dynamic.json" - ], - "configurePresets": [ - { - "name": "x64-mingw-dynamic-darwin-mingw", - "inherits": [ - "base", - "darwin", - "mingw", - "x64-mingw-dynamic" - ] - } - ], - "buildPresets": [ - { - "name": "x64-mingw-dynamic-darwin-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-dynamic-darwin-mingw" - } - ], - "testPresets": [ - { - "name": "x64-mingw-dynamic-darwin-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-dynamic-darwin-mingw" - } - ], - "workflowPresets": [ - { - "name": "x64-mingw-dynamic-darwin-mingw", - "steps": [ - { - "type": "configure", - "name": "x64-mingw-dynamic-darwin-mingw" - }, - { - "type": "build", - "name": "x64-mingw-dynamic-darwin-mingw" - }, - { - "type": "test", - "name": "x64-mingw-dynamic-darwin-mingw" - } - ] - } - ] -} diff --git a/template/cmake/presets/x64-mingw-dynamic-linux-mingw.json b/template/cmake/presets/x64-mingw-dynamic-linux-mingw.json deleted file mode 100644 index 0c919569..00000000 --- a/template/cmake/presets/x64-mingw-dynamic-linux-mingw.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "version": 6, - "include": [ - "base.json", - "os/linux.json", - "compilers/mingw.json", - "triplets/x64-mingw-dynamic.json" - ], - "configurePresets": [ - { - "name": "x64-mingw-dynamic-linux-mingw", - "inherits": [ - "base", - "linux", - "mingw", - "x64-mingw-dynamic" - ] - } - ], - "buildPresets": [ - { - "name": "x64-mingw-dynamic-linux-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-dynamic-linux-mingw" - } - ], - "testPresets": [ - { - "name": "x64-mingw-dynamic-linux-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-dynamic-linux-mingw" - } - ], - "workflowPresets": [ - { - "name": "x64-mingw-dynamic-linux-mingw", - "steps": [ - { - "type": "configure", - "name": "x64-mingw-dynamic-linux-mingw" - }, - { - "type": "build", - "name": "x64-mingw-dynamic-linux-mingw" - }, - { - "type": "test", - "name": "x64-mingw-dynamic-linux-mingw" - } - ] - } - ] -} diff --git a/template/cmake/presets/x64-mingw-static-darwin-mingw.json b/template/cmake/presets/x64-mingw-static-darwin-mingw.json deleted file mode 100644 index c40a5be2..00000000 --- a/template/cmake/presets/x64-mingw-static-darwin-mingw.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "version": 6, - "include": [ - "base.json", - "os/darwin.json", - "compilers/mingw.json", - "triplets/x64-mingw-static.json" - ], - "configurePresets": [ - { - "name": "x64-mingw-static-darwin-mingw", - "inherits": [ - "base", - "darwin", - "mingw", - "x64-mingw-static" - ] - } - ], - "buildPresets": [ - { - "name": "x64-mingw-static-darwin-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-static-darwin-mingw" - } - ], - "testPresets": [ - { - "name": "x64-mingw-static-darwin-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-static-darwin-mingw" - } - ], - "workflowPresets": [ - { - "name": "x64-mingw-static-darwin-mingw", - "steps": [ - { - "type": "configure", - "name": "x64-mingw-static-darwin-mingw" - }, - { - "type": "build", - "name": "x64-mingw-static-darwin-mingw" - }, - { - "type": "test", - "name": "x64-mingw-static-darwin-mingw" - } - ] - } - ] -} diff --git a/template/cmake/presets/x64-mingw-static-linux-mingw.json b/template/cmake/presets/x64-mingw-static-linux-mingw.json deleted file mode 100644 index 6297c9da..00000000 --- a/template/cmake/presets/x64-mingw-static-linux-mingw.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "version": 6, - "include": [ - "base.json", - "os/linux.json", - "compilers/mingw.json", - "triplets/x64-mingw-static.json" - ], - "configurePresets": [ - { - "name": "x64-mingw-static-linux-mingw", - "inherits": [ - "base", - "linux", - "mingw", - "x64-mingw-static" - ] - } - ], - "buildPresets": [ - { - "name": "x64-mingw-static-linux-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-static-linux-mingw" - } - ], - "testPresets": [ - { - "name": "x64-mingw-static-linux-mingw", - "inherits": "base", - "configurePreset": "x64-mingw-static-linux-mingw" - } - ], - "workflowPresets": [ - { - "name": "x64-mingw-static-linux-mingw", - "steps": [ - { - "type": "configure", - "name": "x64-mingw-static-linux-mingw" - }, - { - "type": "build", - "name": "x64-mingw-static-linux-mingw" - }, - { - "type": "test", - "name": "x64-mingw-static-linux-mingw" - } - ] - } - ] -} diff --git a/template/cmake/vcpkg/bootstrap/vcpkg_chainload_toolchain.cmake b/template/cmake/vcpkg/bootstrap/vcpkg_chainload_toolchain.cmake index 0a38f875..0117e9d2 100644 --- a/template/cmake/vcpkg/bootstrap/vcpkg_chainload_toolchain.cmake +++ b/template/cmake/vcpkg/bootstrap/vcpkg_chainload_toolchain.cmake @@ -17,6 +17,8 @@ function(_vcpkg_chainload_toolchain) ) endif() + # Load toolchain variables from triplet and architecture + string(LENGTH "${VCPKG_TARGET_ARCHITECTURE}-" _prefix_len) string(SUBSTRING ${VCPKG_TARGET_TRIPLET} ${_prefix_len} -1 _stripped_string) string(REPLACE "-" ";" _triplet_parts "${_stripped_string}") diff --git a/template/cmake/vcpkg/bootstrap/vcpkg_load_triplet.cmake b/template/cmake/vcpkg/bootstrap/vcpkg_load_triplet.cmake index 89f62e74..d379e465 100644 --- a/template/cmake/vcpkg/bootstrap/vcpkg_load_triplet.cmake +++ b/template/cmake/vcpkg/bootstrap/vcpkg_load_triplet.cmake @@ -82,15 +82,14 @@ function(_vcpkg_detect_host_triplet) return() endif() else() - find_program(Z_VCPKG_CL cl) - if(Z_VCPKG_CL MATCHES "amd64/cl.exe$" OR Z_VCPKG_CL MATCHES "x64/cl.exe$") + find_program(_vcpkg_cl cl) + if(_vcpkg_cl MATCHES "amd64/cl.exe$" OR _vcpkg_cl MATCHES "x64/cl.exe$") set(_detect_target_triplet_arch x64) - elseif(Z_VCPKG_CL MATCHES "arm/cl.exe$") + elseif(_vcpkg_cl MATCHES "arm/cl.exe$") set(_detect_target_triplet_arch arm) - elseif(Z_VCPKG_CL MATCHES "arm64/cl.exe$") + elseif(_vcpkg_cl MATCHES "arm64/cl.exe$") set(_detect_target_triplet_arch arm64) - elseif(Z_VCPKG_CL MATCHES "bin/cl.exe$" OR Z_VCPKG_CL MATCHES - "x86/cl.exe$") + elseif(_vcpkg_cl MATCHES "bin/cl.exe$" OR _vcpkg_cl MATCHES "x86/cl.exe$") set(_detect_target_triplet_arch x86) elseif( CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64" @@ -114,17 +113,10 @@ function(_vcpkg_detect_host_triplet) elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "loongarch64") set(_detect_target_triplet_arch loongarch64) else() - if(Z_VCPKG_CMAKE_IN_TRY_COMPILE) - message( - STATUS - "Unable to determine target architecture, continuing without vcpkg." - ) - else() - message( - WARNING - "Unable to determine target architecture, continuing without vcpkg." - ) - endif() + message( + WARNING + "Unable to determine target architecture, continuing without vcpkg." + ) set(VCPKG_TOOLCHAIN ON) cmake_policy(POP) return() @@ -200,6 +192,8 @@ macro(_vcpkg_load_triplet) endif() endif() + # Load triplet variables from VCPKG_TARGET_TRIPLET triplet file + set(_triplet "triplets/${VCPKG_TARGET_TRIPLET}.cmake") set(_community_triplet "triplets/community/${VCPKG_TARGET_TRIPLET}.cmake")