Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmake-user] Don't use internal toolchains #27782

Merged
merged 3 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions scripts/test_ports/cmake-user/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ if("cmake-3-7" IN_LIST FEATURES)
message(FATAL_ERROR "Unable to test feature 'cmake-3-7' for '${HOST_TRIPLET}' host.")
endif()

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH legacy_cmake
vcpkg_extract_source_archive(legacy_cmake
ARCHIVE "${legacy_cmake_archive}"
REF "${cmake_version}"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${name}"
SOURCE_BASE "${cmake_version}"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/cmake"
)
list(APPEND cmake_commands "${legacy_cmake}${cmake_bin_dir}/cmake")
endif()
Expand All @@ -53,10 +52,6 @@ else()
vcpkg_find_acquire_program(NINJA)
endif()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is microsoft/vcpkg-tool#350

if(NOT DEFINED VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
z_vcpkg_select_default_vcpkg_chainload_toolchain()
endif()

function(get_packages out_packages cmake_version)
set(packages "")
if("find-package" IN_LIST FEATURES)
Expand Down Expand Up @@ -112,29 +107,27 @@ function(test_cmake_project)

set(build_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${cmake_version}-${arg_NAME}")
set(base_options
# Interface: CMake
-G "Ninja"
"-DCMAKE_MAKE_PROGRAM=${NINJA}"
"-DCMAKE_VERBOSE_MAKEFILE=ON"
"-DCMAKE_INSTALL_PREFIX=${build_dir}/install"
"-DCMAKE_TOOLCHAIN_FILE=${SCRIPTS}/buildsystems/vcpkg.cmake"
"-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}"
"-DVCPKG_TARGET_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE}"
# Interface: vcpkg.cmake
"-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}"
"-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}"
"-DVCPKG_HOST_TRIPLET=${HOST_TRIPLET}"
"-DVCPKG_INSTALLED_DIR=${_VCPKG_INSTALLED_DIR}"
"-DCMAKE_INSTALL_PREFIX=${build_dir}/install"
"-DVCPKG_MANIFEST_MODE=OFF"
# Interface: project/CMakeLists.txt
"-DCHECK_CMAKE_VERSION=${cmake_version}"
)

if(DEFINED VCPKG_CMAKE_SYSTEM_NAME AND VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
# Interface: CMake
list(APPEND base_options "-DCMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}")
if(DEFINED VCPKG_CMAKE_SYSTEM_VERSION)
list(APPEND base_options "-DCMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}")
endif()
if(DEFINED VCPKG_PLATFORM_TOOLSET)
list(APPEND base_options "-DVCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}")
endif()
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
Expand Down
8 changes: 7 additions & 1 deletion scripts/test_ports/cmake-user/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cmake-user",
"version-date": "2022-07-02",
"version-date": "2022-11-12",
"description": "Test port to verify the vcpkg toolchain in cmake user projects",
"license": "MIT",
"default-features": [
Expand Down Expand Up @@ -113,6 +113,12 @@
"default-features": false,
"platform": "!uwp & !mingw"
},
{
"$package": "SQLite3",
"name": "sqlite3",
"$since": "3.14",
"default-features": false
},
{
"$package": "TIFF",
"name": "tiff",
Expand Down