From 0dec7ca4d5d3f4032c358a39d2efb2519fc32056 Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Thu, 28 Mar 2024 12:01:33 +0100 Subject: [PATCH 1/2] Bump to the latest vcpkg --- .github/workflows/build.yml | 2 +- docs/examples/vcpkg.md | 2 +- tests/vcpkg/cmake.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9bb8e2d..72c7a54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2022, macos-11, ubuntu-20.04] + os: [windows-2022, macos-latest, ubuntu-20.04] env: BUILD_TYPE: 'Release' CMAKE_GENERATOR: 'Ninja' diff --git a/docs/examples/vcpkg.md b/docs/examples/vcpkg.md index a76aa26..838d66d 100644 --- a/docs/examples/vcpkg.md +++ b/docs/examples/vcpkg.md @@ -19,7 +19,7 @@ description = "Dependencies from vcpkg" # See https://github.com/microsoft/vcpkg/releases for vcpkg versions # See https://vcpkg.io/en/packages.html for available packages [vcpkg] -version = "2022.11.14" +version = "2024.03.25" packages = ["fmt"] [find-package] diff --git a/tests/vcpkg/cmake.toml b/tests/vcpkg/cmake.toml index 44a29ae..3e573d6 100644 --- a/tests/vcpkg/cmake.toml +++ b/tests/vcpkg/cmake.toml @@ -7,7 +7,7 @@ description = "Dependencies from vcpkg" # See https://github.com/microsoft/vcpkg/releases for vcpkg versions # See https://vcpkg.io/en/packages.html for available packages [vcpkg] -version = "2022.11.14" +version = "2024.03.25" packages = ["fmt"] [find-package] From e2c929adb0fbd041dd2098ebbea89fb39cd61ada Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Sat, 13 Apr 2024 23:50:50 +0200 Subject: [PATCH 2/2] Fix out-of-the-box vcpkg experience on macos --- src/cmake_generator.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/cmake_generator.cpp b/src/cmake_generator.cpp index 314afb5..ae81f9c 100644 --- a/src/cmake_generator.cpp +++ b/src/cmake_generator.cpp @@ -814,19 +814,20 @@ void generate_cmake(const char *path, const parser::Project *parent_project) { cmd("if")("CMKR_ROOT_PROJECT", "AND", "NOT", "CMKR_DISABLE_VCPKG"); cmd("include")("FetchContent"); comment("Fix warnings about DOWNLOAD_EXTRACT_TIMESTAMP"); - // clang-format off cmd("if")("POLICY", "CMP0135"); cmd("cmake_policy")("SET", "CMP0135", "NEW"); cmd("endif")(); - // clang-format on - cmd("message")("STATUS", "Fetching vcpkg (" + version_name + ")..."); - cmd("FetchContent_Declare")("vcpkg", "URL", url); - // Not using FetchContent_MakeAvailable here in case vcpkg adds CMakeLists.txt - cmd("FetchContent_GetProperties")("vcpkg"); - cmd("if")("NOT", "vcpkg_POPULATED"); - cmd("FetchContent_Populate")("vcpkg"); - cmd("include")("${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake"); - cmd("endif")(); + cmd("message")("STATUS", "Fetching vcpkg (" + version_name + ")..."); + cmd("FetchContent_Declare")("vcpkg", "URL", url); + // Not using FetchContent_MakeAvailable here in case vcpkg adds CMakeLists.txt + cmd("FetchContent_GetProperties")("vcpkg"); + cmd("if")("NOT", "vcpkg_POPULATED"); + cmd("FetchContent_Populate")("vcpkg"); + cmd("if")("CMAKE_HOST_SYSTEM_NAME", "STREQUAL", "Darwin", "AND", "CMAKE_OSX_ARCHITECTURES", "STREQUAL", RawArg("\"\"")); + cmd("set")("CMAKE_OSX_ARCHITECTURES", "${CMAKE_HOST_SYSTEM_PROCESSOR}", "CACHE", "STRING", RawArg("\"\""), "FORCE"); + cmd("endif")(); + cmd("include")("${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake"); + cmd("endif")(); cmd("endif")(); endl(); // clang-format on