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/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 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]