From 637a6369ce13bb638706ea66007e680105824dcd Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 24 Feb 2022 11:38:25 +0100 Subject: [PATCH 01/34] synchronize cmake build scripts. --- ports/vcpkg-cmake/vcpkg.json | 2 +- ports/vcpkg-cmake/vcpkg_cmake_build.cmake | 89 ++++--- ports/vcpkg-cmake/vcpkg_cmake_configure.cmake | 244 ++++++------------ scripts/cmake/vcpkg_build_cmake.cmake | 8 +- scripts/cmake/vcpkg_configure_cmake.cmake | 173 +++++++++---- 5 files changed, 249 insertions(+), 267 deletions(-) diff --git a/ports/vcpkg-cmake/vcpkg.json b/ports/vcpkg-cmake/vcpkg.json index 0061a046eab5c0..896fd6380f8d2c 100644 --- a/ports/vcpkg-cmake/vcpkg.json +++ b/ports/vcpkg-cmake/vcpkg.json @@ -1,4 +1,4 @@ { "name": "vcpkg-cmake", - "version-date": "2022-01-19" + "version-date": "2022-02-24" } diff --git a/ports/vcpkg-cmake/vcpkg_cmake_build.cmake b/ports/vcpkg-cmake/vcpkg_cmake_build.cmake index 5520f0de318e3c..20798c09c6a261 100644 --- a/ports/vcpkg-cmake/vcpkg_cmake_build.cmake +++ b/ports/vcpkg-cmake/vcpkg_cmake_build.cmake @@ -47,77 +47,84 @@ function(vcpkg_cmake_build) if(NOT DEFINED arg_LOGFILE_BASE) set(arg_LOGFILE_BASE "build") endif() - - set(build_args "") - set(target_args "") - set(parallel_args "") - set(no_parallel_args "") - - if(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Ninja") - set(build_args "-v") # verbose output - set(parallel_args "-j${VCPKG_CONCURRENCY}") - set(no_parallel_args "-j1") - elseif(Z_VCPKG_CMAKE_GENERATOR MATCHES "^Visual Studio") - set(build_args + vcpkg_list(SET build_param) + vcpkg_list(SET parallel_param) + vcpkg_list(SET no_parallel_param) + + if("${Z_VCPKG_CMAKE_GENERATOR}" STREQUAL "Ninja") + vcpkg_list(SET build_param "-v") # verbose output + vcpkg_list(SET parallel_param "-j${VCPKG_CONCURRENCY}") + vcpkg_list(SET no_parallel_param "-j1") + elseif("${Z_VCPKG_CMAKE_GENERATOR}" MATCHES "^Visual Studio") + vcpkg_list(SET build_param "/p:VCPkgLocalAppDataDisabled=true" "/p:UseIntelMKL=No" ) - set(parallel_args "/m") - elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "NMake Makefiles") + vcpkg_list(SET parallel_param "/m") + elseif("${Z_VCPKG_CMAKE_GENERATOR}" STREQUAL "NMake Makefiles") # No options are currently added for nmake builds elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Unix Makefiles") - set(build_args "VERBOSE=1") - set(parallel_args "-j${VCPKG_CONCURRENCY}") - set(no_parallel_args "") + vcpkg_list(SET build_args "VERBOSE=1") + vcpkg_list(SET parallel_args "-j${VCPKG_CONCURRENCY}") + vcpkg_list(SET no_parallel_args "") elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Xcode") - list(APPEND parallel_args -jobs "${VCPKG_CONCURRENCY}") - list(APPEND no_parallel_args -jobs 1) + vcpkg_list(SET parallel_args -jobs "${VCPKG_CONCURRENCY}") + vcpkg_list(SET no_parallel_args -jobs 1) else() - message(WARNING "Unrecognized GENERATOR setting from vcpkg_cmake_configure().") + if(NOT DEFINED VCPKG_CMAKE_GENERATOR) + message(FATAL_ERROR "Unrecognized GENERATOR setting from vcpkg_configure_cmake(). Valid generators are: Ninja, Visual Studio, and NMake Makefiles") + endif() endif() - if(DEFINED arg_TARGET) - set(target_args "--target" "${arg_TARGET}") + vcpkg_list(SET target_param) + if(arg_TARGET) + vcpkg_list(SET target_param "--target" "${arg_TARGET}") endif() - foreach(buildtype IN ITEMS debug release) - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL buildtype) - if(buildtype STREQUAL "debug") - set(short_buildtype "dbg") - set(cmake_config "Debug") + foreach(build_type IN ITEMS debug release) + if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "${build_type}") + if("${build_type}" STREQUAL "debug") + set(short_build_type "dbg") + set(config "Debug") else() - set(short_buildtype "rel") - set(cmake_config "Release") + set(short_build_type "rel") + set(config "Release") endif() - message(STATUS "Building ${TARGET_TRIPLET}-${short_buildtype}") + message(STATUS "Building ${TARGET_TRIPLET}-${short_build_type}") if(arg_ADD_BIN_TO_PATH) - set(env_path_backup "$ENV{PATH}") - if(buildtype STREQUAL "debug") + vcpkg_backup_env_variables(VARS PATH) + if("${build_type}" STREQUAL "debug") vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/debug/bin") else() vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/bin") endif() endif() - if (arg_DISABLE_PARALLEL) + if(arg_DISABLE_PARALLEL) vcpkg_execute_build_process( - COMMAND "${CMAKE_COMMAND}" --build . --config "${cmake_config}" ${target_args} -- ${build_args} ${no_parallel_args} - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${short_buildtype}" - LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}-${short_buildtype}" + COMMAND + "${CMAKE_COMMAND}" --build . --config "${config}" ${target_param} + -- ${build_param} ${no_parallel_param} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${short_build_type}" + LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}-${short_build_type}" ) else() vcpkg_execute_build_process( - COMMAND "${CMAKE_COMMAND}" --build . --config "${cmake_config}" ${target_args} -- ${build_args} ${parallel_args} - NO_PARALLEL_COMMAND "${CMAKE_COMMAND}" --build . --config "${cmake_config}" ${target_args} -- ${build_args} ${no_parallel_args} - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${short_buildtype}" - LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}-${short_buildtype}" + COMMAND + "${CMAKE_COMMAND}" --build . --config "${config}" ${target_param} + -- ${build_param} ${parallel_param} + NO_PARALLEL_COMMAND + "${CMAKE_COMMAND}" --build . --config "${config}" ${target_param} + -- ${build_param} ${no_parallel_param} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${short_build_type}" + LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}-${short_build_type}" ) endif() if(arg_ADD_BIN_TO_PATH) - set(ENV{PATH} "${env_path_backup}") + vcpkg_restore_env_variables(VARS PATH) endif() endif() endforeach() diff --git a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake index 95ee7e23ea1d80..6e51cec9908ade 100644 --- a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake +++ b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake @@ -103,7 +103,7 @@ endmacro() function(vcpkg_cmake_configure) cmake_parse_arguments(PARSE_ARGV 0 "arg" - "PREFER_NINJA;DISABLE_PARALLEL_CONFIGURE;WINDOWS_USE_MSBUILD;NO_CHARSET_FLAG;Z_CMAKE_GET_VARS_USAGE" + "DISABLE_PARALLEL_CONFIGURE;WINDOWS_USE_MSBUILD;NO_CHARSET_FLAG;Z_CMAKE_GET_VARS_USAGE" "SOURCE_PATH;GENERATOR;LOGFILE_BASE" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;MAYBE_UNUSED_VARIABLES" ) @@ -113,7 +113,7 @@ function(vcpkg_cmake_configure) endif() if(DEFINED arg_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "vcpkg_cmake_buildsystem_build was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") + message(FATAL_ERROR "vcpkg_cmake_configure was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") endif() if(NOT DEFINED arg_SOURCE_PATH) message(FATAL_ERROR "SOURCE_PATH must be set") @@ -134,8 +134,8 @@ function(vcpkg_cmake_configure) list(APPEND manually_specified_variables "${CMAKE_MATCH_1}") endif() endforeach() - list(REMOVE_DUPLICATES manually_specified_variables) - list(REMOVE_ITEM manually_specified_variables ${arg_MAYBE_UNUSED_VARIABLES}) + vcpkg_list(REMOVE_DUPLICATES manually_specified_variables) + vcpkg_list(REMOVE_ITEM manually_specified_variables ${arg_MAYBE_UNUSED_VARIABLES}) debug_message("manually specified variables: ${manually_specified_variables}") endif() @@ -159,71 +159,20 @@ function(vcpkg_cmake_configure) set(ninja_can_be_used OFF) endif() - set(generator) - if(DEFINED arg_GENERATOR) + set(generator "Ninja") + if(DEFINED VCPKG_CMAKE_GENERATOR AND NOT VCPKG_CMAKE_GENERATOR STREQUAL "") + set(generator "${VCPKG_CMAKE_GENERATOR}") # Triplet override. + elseif(DEFINED arg_GENERATOR) set(generator "${arg_GENERATOR}") elseif(arg_WINDOWS_USE_MSBUILD OR NOT ninja_can_be_used) - if(VCPKG_PLATFORM_TOOLSET STREQUAL "v120") - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(generator "Visual Studio 12 2013") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(generator "Visual Studio 12 2013 Win64") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - set(generator "Visual Studio 12 2013 ARM") - endif() - elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v140") - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(generator "Visual Studio 14 2015") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(generator "Visual Studio 14 2015 Win64") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - set(generator "Visual Studio 14 2015 ARM") - endif() - elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v141") - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(generator "Visual Studio 15 2017") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(generator "Visual Studio 15 2017 Win64") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - set(generator "Visual Studio 15 2017 ARM") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - set(generator "Visual Studio 15 2017") - set(arch "ARM64") - endif() - elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v142") - set(generator "Visual Studio 16 2019") - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(arch "Win32") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(arch "x64") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - set(arch "ARM") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - set(arch "ARM64") - else() - set(generator) - endif() - elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v143") - set(generator "Visual Studio 17 2022") - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(arch "Win32") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(arch "x64") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - set(arch "ARM") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - set(arch "ARM64") - else() - set(generator) - endif() - endif() - else() - set(generator "Ninja") + set(generator "") + set(arch "") + z_vcpkg_get_visual_studio_generator(generator arch) endif() - if(NOT DEFINED generator) + if(NOT DEFINED generator OR generator STREQUAL "") if(NOT VCPKG_CMAKE_SYSTEM_NAME) - set(VCPKG_CMAKE_SYSTEM_NAME Windows) + set(VCPKG_CMAKE_SYSTEM_NAME "Windows") endif() message(FATAL_ERROR "Unable to determine appropriate generator for: " "${VCPKG_CMAKE_SYSTEM_NAME}-${VCPKG_TARGET_ARCHITECTURE}-${VCPKG_PLATFORM_TOOLSET}") @@ -234,7 +183,7 @@ function(vcpkg_cmake_configure) vcpkg_find_acquire_program(NINJA) get_filename_component(ninja_path "${NINJA}" DIRECTORY) vcpkg_add_to_path("${ninja_path}") - list(APPEND arg_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}") + vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}") endif() set(build_dir_release "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") @@ -248,7 +197,7 @@ function(vcpkg_cmake_configure) endif() if(DEFINED VCPKG_CMAKE_SYSTEM_NAME) - list(APPEND arg_OPTIONS "-DCMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}") + vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}") if(VCPKG_TARGET_IS_UWP AND NOT DEFINED VCPKG_CMAKE_SYSTEM_VERSION) set(VCPKG_CMAKE_SYSTEM_VERSION 10.0) elseif(VCPKG_TARGET_IS_ANDROID AND NOT DEFINED VCPKG_CMAKE_SYSTEM_VERSION) @@ -257,13 +206,13 @@ function(vcpkg_cmake_configure) endif() if(DEFINED VCPKG_CMAKE_SYSTEM_VERSION) - list(APPEND arg_OPTIONS "-DCMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}") + vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}") endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - list(APPEND arg_OPTIONS "-DBUILD_SHARED_LIBS=ON") + vcpkg_list(APPEND arg_OPTIONS "-DBUILD_SHARED_LIBS=ON") elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - list(APPEND arg_OPTIONS "-DBUILD_SHARED_LIBS=OFF") + vcpkg_list(APPEND arg_OPTIONS "-DBUILD_SHARED_LIBS=OFF") else() message(FATAL_ERROR "Invalid setting for VCPKG_LIBRARY_LINKAGE: \"${VCPKG_LIBRARY_LINKAGE}\". " @@ -280,28 +229,11 @@ function(vcpkg_cmake_configure) endif() if(NOT DEFINED VCPKG_CHAINLOAD_TOOLCHAIN_FILE) - if(VCPKG_TARGET_IS_MINGW) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake") - elseif(VCPKG_TARGET_IS_WINDOWS) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake") - elseif(VCPKG_TARGET_IS_LINUX) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/linux.cmake") - elseif(VCPKG_TARGET_IS_ANDROID) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/android.cmake") - elseif(VCPKG_TARGET_IS_OSX) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/osx.cmake") - elseif(VCPKG_TARGET_IS_IOS) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/ios.cmake") - elseif(VCPKG_TARGET_IS_FREEBSD) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/freebsd.cmake") - elseif(VCPKG_TARGET_IS_OPENBSD) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/openbsd.cmake") - endif() + z_vcpkg_select_default_vcpkg_chainload_toolchain() endif() - list(JOIN VCPKG_TARGET_ARCHITECTURE "\;" target_architecture_string) - list(APPEND arg_OPTIONS + vcpkg_list(APPEND arg_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" "-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}" "-DVCPKG_SET_CHARSET_FLAG=${VCPKG_SET_CHARSET_FLAG}" @@ -332,34 +264,45 @@ function(vcpkg_cmake_configure) "-DVCPKG_MANIFEST_INSTALL=OFF" ) - if(DEFINED arch) - list(APPEND arg_OPTIONS "-A${arch}") + if(DEFINED arch AND NOT arch STREQUAL "") + vcpkg_list(APPEND arg_OPTIONS "-A${arch}") endif() # Sets configuration variables for macOS builds foreach(config_var IN ITEMS INSTALL_NAME_DIR OSX_DEPLOYMENT_TARGET OSX_SYSROOT OSX_ARCHITECTURES) if(DEFINED VCPKG_${config_var}) - list(JOIN VCPKG_${config_var} "\;" config_var_value) - list(APPEND arg_OPTIONS "-DCMAKE_${config_var}=${config_var_value}") + vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_${config_var}=${config_var_value}") endif() endforeach() # Allow overrides / additional configuration variables from triplets if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS) - list(APPEND arg_OPTIONS "${VCPKG_CMAKE_CONFIGURE_OPTIONS}") + vcpkg_list(APPEND arg_OPTIONS "${VCPKG_CMAKE_CONFIGURE_OPTIONS}") endif() if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE) - list(APPEND arg_OPTIONS_RELEASE "${VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE}") + vcpkg_list(APPEND arg_OPTIONS_RELEASE "${VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE}") endif() if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG) - list(APPEND arg_OPTIONS_DEBUG "${VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG}") + vcpkg_list(APPEND arg_OPTIONS_DEBUG "${VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG}") endif() + vcpkg_list(SET rel_command + "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" + -G "${generator}" + "-DCMAKE_BUILD_TYPE=Release" + ${arg_OPTIONS} ${arg_OPTIONS_RELEASE} + "-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}") + vcpkg_list(SET dbg_command + "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" + -G "${generator}" + "-DCMAKE_BUILD_TYPE=Debug" + ${arg_OPTIONS} ${arg_OPTIONS_DEBUG} + "-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug") + if(ninja_host AND CMAKE_HOST_WIN32 AND NOT arg_DISABLE_PARALLEL_CONFIGURE) - list(APPEND arg_OPTIONS "-DCMAKE_DISABLE_SOURCE_CHANGES=ON") + vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_DISABLE_SOURCE_CHANGES=ON") vcpkg_find_acquire_program(NINJA) - if(NOT DEFINED ninja_path) # if ninja_path was defined above, we've already done this get_filename_component(ninja_path "${NINJA}" DIRECTORY) @@ -367,94 +310,57 @@ function(vcpkg_cmake_configure) endif() #parallelize the configure step - set(parallel_configure_contents - "rule CreateProcess\n command = $process\n\n" + set(ninja_configure_contents + "rule CreateProcess\n command = \$process\n\n" ) - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - set(line "build ../CMakeCache.txt: CreateProcess\n ") - string(APPEND line "process = \"${CMAKE_COMMAND}\" -E chdir \"${build_dir_release}\" ") - string(APPEND line "\"${CMAKE_COMMAND}\" -S \"${arg_SOURCE_PATH}\" ") - - if(DEFINED arg_OPTIONS AND NOT arg_OPTIONS STREQUAL "") - list(JOIN arg_OPTIONS "\" \"" options) - string(APPEND line "\"${options}\" ") - endif() - if(DEFINED arg_OPTIONS_RELEASE AND NOT arg_OPTIONS_RELEASE STREQUAL "") - list(JOIN arg_OPTIONS_RELEASE "\" \"" options_rel) - string(APPEND line "\"${options_rel}\" ") - endif() - string(APPEND line "-G \"${generator}\" ") - string(APPEND line "\"-DCMAKE_BUILD_TYPE=Release\" ") - string(APPEND line "\"-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}\"") - string(APPEND parallel_configure_contents "${line}\n\n") + if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "release") + z_vcpkg_configure_cmake_build_cmakecache(ninja_configure_contents ".." "rel") endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - set(line "build ../../${TARGET_TRIPLET}-dbg/CMakeCache.txt: CreateProcess\n ") - string(APPEND line "process = \"${CMAKE_COMMAND}\" -E chdir \"${build_dir_debug}\" ") - string(APPEND line "\"${CMAKE_COMMAND}\" -S \"${arg_SOURCE_PATH}\" ") - - if(DEFINED arg_OPTIONS AND NOT arg_OPTIONS STREQUAL "") - list(JOIN arg_OPTIONS "\" \"" options) - string(APPEND line "\"${options}\" ") - endif() - if(DEFINED arg_OPTIONS_DEBUG AND NOT arg_OPTIONS_DEBUG STREQUAL "") - list(JOIN arg_OPTIONS_DEBUG "\" \"" options_dbg) - string(APPEND line "\"${options_dbg}\" ") - endif() - string(APPEND line "-G \"${generator}\" ") - string(APPEND line "\"-DCMAKE_BUILD_TYPE=Debug\" ") - string(APPEND line "\"-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug\"") - string(APPEND parallel_configure_contents "${line}\n\n") + if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug") + z_vcpkg_configure_cmake_build_cmakecache(ninja_configure_contents "../../${TARGET_TRIPLET}-dbg" "dbg") endif() - file(MAKE_DIRECTORY "${build_dir_release}/vcpkg-parallel-configure") - file(WRITE "${build_dir_release}/vcpkg-parallel-configure/build.ninja" "${parallel_configure_contents}") + file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure") + file(WRITE + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure/build.ninja" + "${ninja_configure_contents}") message(STATUS "${configuring_message}") vcpkg_execute_required_process( COMMAND ninja -v - WORKING_DIRECTORY "${build_dir_release}/vcpkg-parallel-configure" - LOGNAME "${arg_LOGFILE_BASE}" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure" + LOGNAME "${arg_LOGNAME}" ) - list(APPEND config_logs - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-out.log" - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-err.log") + + vcpkg_list(APPEND config_logs + "${CURRENT_BUILDTREES_DIR}/${arg_LOGNAME}-out.log" + "${CURRENT_BUILDTREES_DIR}/${arg_LOGNAME}-err.log") else() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug") message(STATUS "${configuring_message}-dbg") + file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND - "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" - ${arg_OPTIONS} - ${arg_OPTIONS_DEBUG} - -G "${generator}" - "-DCMAKE_BUILD_TYPE=Debug" - "-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug" - WORKING_DIRECTORY "${build_dir_debug}" - LOGNAME "${arg_LOGFILE_BASE}-dbg" + COMMAND ${dbg_command} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" + LOGNAME "${arg_LOGNAME}-dbg" ) - list(APPEND config_logs - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-dbg-out.log" - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-dbg-err.log") + vcpkg_list(APPEND config_logs + "${CURRENT_BUILDTREES_DIR}/${arg_LOGNAME}-dbg-out.log" + "${CURRENT_BUILDTREES_DIR}/${arg_LOGNAME}-dbg-err.log") endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "release") message(STATUS "${configuring_message}-rel") + file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND - "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" - ${arg_OPTIONS} - ${arg_OPTIONS_RELEASE} - -G "${generator}" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}" - WORKING_DIRECTORY "${build_dir_release}" - LOGNAME "${arg_LOGFILE_BASE}-rel" + COMMAND ${rel_command} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" + LOGNAME "${arg_LOGNAME}-rel" ) - list(APPEND config_logs - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-rel-out.log" - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-rel-err.log") + vcpkg_list(APPEND config_logs + "${CURRENT_BUILDTREES_DIR}/${arg_LOGNAME}-rel-out.log" + "${CURRENT_BUILDTREES_DIR}/${arg_LOGNAME}-rel-err.log") endif() endif() @@ -474,7 +380,7 @@ function(vcpkg_cmake_configure) foreach(unused_variable IN LISTS unused_variables) if(unused_variable IN_LIST manually_specified_variables) debug_message("manually specified unused variable: ${unused_variable}") - list(APPEND all_unused_variables "${unused_variable}") + vcpkg_list(APPEND all_unused_variables "${unused_variable}") else() debug_message("unused variable (not manually specified): ${unused_variable}") endif() @@ -482,8 +388,8 @@ function(vcpkg_cmake_configure) endforeach() if(DEFINED all_unused_variables) - list(REMOVE_DUPLICATES all_unused_variables) - list(JOIN all_unused_variables "\n " all_unused_variables) + vcpkg_list(REMOVE_DUPLICATES all_unused_variables) + vcpkg_list(JOIN all_unused_variables "\n " all_unused_variables) message(WARNING "The following variables are not used in CMakeLists.txt: ${all_unused_variables} Please recheck them and remove the unnecessary options from the `vcpkg_cmake_configure` call. diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index b3015ae29e8865..84753067017dce 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -62,10 +62,16 @@ function(vcpkg_build_cmake) "/p:UseIntelMKL=No" ) vcpkg_list(SET parallel_param "/m") + elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Unix Makefiles") + vcpkg_list(SET build_args "VERBOSE=1") + vcpkg_list(SET parallel_args "-j${VCPKG_CONCURRENCY}") + vcpkg_list(SET no_parallel_args "") elseif("${Z_VCPKG_CMAKE_GENERATOR}" STREQUAL "NMake Makefiles") # No options are currently added for nmake builds else() - message(FATAL_ERROR "Unrecognized GENERATOR setting from vcpkg_configure_cmake(). Valid generators are: Ninja, Visual Studio, and NMake Makefiles") + if(NOT DEFINED VCPKG_CMAKE_GENERATOR) + message(FATAL_ERROR "Unrecognized GENERATOR setting from vcpkg_configure_cmake(). Valid generators are: Ninja, Visual Studio, and NMake Makefiles") + endif() endif() vcpkg_list(SET target_param) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 84a8d1e2786867..1cf96452ab561b 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -98,6 +98,88 @@ function(z_vcpkg_configure_cmake_build_cmakecache out_var whereat build_type) set("${out_var}" "${${out_var}}${line}\"\n\n" PARENT_SCOPE) endfunction() +function(z_vcpkg_get_visual_studio_generator generator_var arch_var) + set(arch "") + if(VCPKG_PLATFORM_TOOLSET STREQUAL "v120") + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(generator "Visual Studio 12 2013") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(generator "Visual Studio 12 2013 Win64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + set(generator "Visual Studio 12 2013 ARM") + endif() + elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v140") + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(generator "Visual Studio 14 2015") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(generator "Visual Studio 14 2015 Win64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + set(generator "Visual Studio 14 2015 ARM") + endif() + elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v141") + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(generator "Visual Studio 15 2017") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(generator "Visual Studio 15 2017 Win64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + set(generator "Visual Studio 15 2017 ARM") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + set(generator "Visual Studio 15 2017") + set(arch "ARM64") + endif() + elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v142") + set(generator "Visual Studio 16 2019") + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(arch "Win32") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(arch "x64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + set(arch "ARM") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + set(arch "ARM64") + else() + set(generator "") + endif() + elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v143") + set(generator "Visual Studio 17 2022") + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(arch "Win32") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(arch "x64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + set(arch "ARM") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + set(arch "ARM64") + else() + set(generator "") + endif() + endif() + set(${generator_var} "${generator}" PARENT_SCOPE) + set(${arch_var} "${arch}" PARENT_SCOPE) +endfunction() + +function(z_vcpkg_select_default_vcpkg_chainload_toolchain) + # Try avoiding adding more defaults here. + # Set VCPKG_CHAINLOAD_TOOLCHAIN_FILE explicitly in the triplet. + if(VCPKG_TARGET_IS_MINGW) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake") + elseif(VCPKG_TARGET_IS_WINDOWS) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake") + elseif(VCPKG_TARGET_IS_LINUX) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/linux.cmake") + elseif(VCPKG_TARGET_IS_ANDROID) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/android.cmake") + elseif(VCPKG_TARGET_IS_OSX) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/osx.cmake") + elseif(VCPKG_TARGET_IS_IOS) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/ios.cmake") + elseif(VCPKG_TARGET_IS_FREEBSD) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/freebsd.cmake") + elseif(VCPKG_TARGET_IS_OPENBSD) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/openbsd.cmake") + endif() + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${VCPKG_CHAINLOAD_TOOLCHAIN_FILE} PARENT_SCOPE) +endfunction() function(vcpkg_configure_cmake) cmake_parse_arguments(PARSE_ARGV 0 arg @@ -142,6 +224,10 @@ function(vcpkg_configure_cmake) set(ninja_can_be_used ON) # Ninja as generator set(ninja_host ON) # Ninja as parallel configurator + if(NOT arg_PREFER_NINJA) + set(ninja_can_be_used OFF) + endif() + if(VCPKG_HOST_IS_WINDOWS) if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) set(host_arch "$ENV{PROCESSOR_ARCHITEW6432}") @@ -159,38 +245,15 @@ function(vcpkg_configure_cmake) endif() endif() - set(generator "") + set(generator "Ninja") # the default generator is always ninja! set(generator_arch "") - if(DEFINED arg_GENERATOR) + if(DEFINED VCPKG_CMAKE_GENERATOR AND NOT VCPKG_CMAKE_GENERATOR STREQUAL "") + set(generator "${VCPKG_CMAKE_GENERATOR}") # Triplet override. + elseif(DEFINED arg_GENERATOR) set(generator "${arg_GENERATOR}") - elseif(arg_PREFER_NINJA AND ninja_can_be_used) - set(generator "Ninja") - elseif(VCPKG_CHAINLOAD_TOOLCHAIN_FILE OR NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_MINGW) - set(generator "Ninja") - - else() - if("${VCPKG_PLATFORM_TOOLSET}" STREQUAL "v120" AND NOT "${VCPKG_TARGET_ARCHITECTURE}" STREQUAL "arm64") - set(generator "Visual Studio 12 2013") - elseif("${VCPKG_PLATFORM_TOOLSET}" STREQUAL "v140" AND NOT "${VCPKG_TARGET_ARCHITECTURE}" STREQUAL "arm64") - set(generator "Visual Studio 14 2015") - elseif("${VCPKG_PLATFORM_TOOLSET}" STREQUAL "v141") - set(generator "Visual Studio 15 2017") - elseif("${VCPKG_PLATFORM_TOOLSET}" STREQUAL "v142") - set(generator "Visual Studio 16 2019") - elseif("${VCPKG_PLATFORM_TOOLSET}" STREQUAL "v143") - set(generator "Visual Studio 17 2022") - endif() - - if("${VCPKG_TARGET_ARCHITECTURE}" STREQUAL "x86") - set(generator_arch "Win32") - elseif("${VCPKG_TARGET_ARCHITECTURE}" STREQUAL "x64") - set(generator_arch "x64") - elseif("${VCPKG_TARGET_ARCHITECTURE}" STREQUAL "arm") - set(generator_arch "ARM") - elseif("${VCPKG_TARGET_ARCHITECTURE}" STREQUAL "arm64") - set(generator_arch "ARM64") - endif() - + elseif(NOT ninja_can_be_used) + set(generator "") + z_vcpkg_get_visual_studio_generator(generator generator_arch) if("${generator}" STREQUAL "" OR "${generator_arch}" STREQUAL "") message(FATAL_ERROR "Unable to determine appropriate generator for triplet ${TARGET_TRIPLET}: @@ -202,8 +265,8 @@ function(vcpkg_configure_cmake) # If we use Ninja, make sure it's on PATH if("${generator}" STREQUAL "Ninja" AND NOT DEFINED ENV{VCPKG_FORCE_SYSTEM_BINARIES}) vcpkg_find_acquire_program(NINJA) - get_filename_component(NINJA_PATH "${NINJA}" DIRECTORY) - vcpkg_add_to_path("${NINJA_PATH}") + get_filename_component(ninja_path "${NINJA}" DIRECTORY) + vcpkg_add_to_path("${ninja_path}") vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}") endif() @@ -244,23 +307,7 @@ function(vcpkg_configure_cmake) endif() if(NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE) - if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/linux.cmake") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android") - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/android.cmake") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/osx.cmake") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS") - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/ios.cmake") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/freebsd.cmake") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/openbsd.cmake") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake") - endif() + z_vcpkg_select_default_vcpkg_chainload_toolchain() endif() vcpkg_list(APPEND arg_OPTIONS @@ -306,23 +353,39 @@ function(vcpkg_configure_cmake) endif() endforeach() + # Allow overrides / additional configuration variables from triplets + if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS) + vcpkg_list(APPEND arg_OPTIONS "${VCPKG_CMAKE_CONFIGURE_OPTIONS}") + endif() + if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE) + vcpkg_list(APPEND arg_OPTIONS_RELEASE "${VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE}") + endif() + if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG) + vcpkg_list(APPEND arg_OPTIONS_DEBUG "${VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG}") + endif() + vcpkg_list(SET rel_command - "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" ${arg_OPTIONS} ${arg_OPTIONS_RELEASE} + "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" -G "${generator}" - -DCMAKE_BUILD_TYPE=Release + "-DCMAKE_BUILD_TYPE=Release" + ${arg_OPTIONS} ${arg_OPTIONS_RELEASE} "-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}") vcpkg_list(SET dbg_command - "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" ${arg_OPTIONS} ${arg_OPTIONS_DEBUG} + "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" -G "${generator}" - -DCMAKE_BUILD_TYPE=Debug + "-DCMAKE_BUILD_TYPE=Debug" + ${arg_OPTIONS} ${arg_OPTIONS_DEBUG} "-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug") if(ninja_host AND CMAKE_HOST_WIN32 AND NOT arg_DISABLE_PARALLEL_CONFIGURE) vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_DISABLE_SOURCE_CHANGES=ON") vcpkg_find_acquire_program(NINJA) - get_filename_component(NINJA_PATH "${NINJA}" DIRECTORY) - vcpkg_add_to_path("${NINJA_PATH}") + if(NOT DEFINED ninja_path) + # if ninja_path was defined above, we've already done this + get_filename_component(ninja_path "${NINJA}" DIRECTORY) + vcpkg_add_to_path("${ninja_path}") + endif() #parallelize the configure step set(ninja_configure_contents From b0670632d685cd698275d644c4734dad3e54307c Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 24 Feb 2022 11:38:55 +0100 Subject: [PATCH 02/34] version stuff --- versions/baseline.json | 2 +- versions/v-/vcpkg-cmake.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 5f7c521b145264..eedd7409894a97 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7205,7 +7205,7 @@ "port-version": 1 }, "vcpkg-cmake": { - "baseline": "2022-01-19", + "baseline": "2022-02-24", "port-version": 0 }, "vcpkg-cmake-config": { diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json index b61a6fe25f1beb..5b8dac7eb79b83 100644 --- a/versions/v-/vcpkg-cmake.json +++ b/versions/v-/vcpkg-cmake.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "91e0bb804f7e31301312dcc951689409cfe04b38", + "version-date": "2022-02-24", + "port-version": 0 + }, { "git-tree": "b7c050fe60f91dcedef6d87a3f87584151bf8aee", "version-date": "2022-01-19", From 88f1d66965e691bdcb0c0638248e3843cef4c18f Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 24 Feb 2022 13:13:07 +0100 Subject: [PATCH 03/34] fix REMOVE_ITEM and add license --- ports/vcpkg-cmake/vcpkg.json | 3 ++- ports/vcpkg-cmake/vcpkg_cmake_configure.cmake | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ports/vcpkg-cmake/vcpkg.json b/ports/vcpkg-cmake/vcpkg.json index 896fd6380f8d2c..d8ac260e7b2e2a 100644 --- a/ports/vcpkg-cmake/vcpkg.json +++ b/ports/vcpkg-cmake/vcpkg.json @@ -1,4 +1,5 @@ { "name": "vcpkg-cmake", - "version-date": "2022-02-24" + "version-date": "2022-02-24", + "license" : "MIT" } diff --git a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake index 6e51cec9908ade..05cf3aaeae11e4 100644 --- a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake +++ b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake @@ -130,12 +130,14 @@ function(vcpkg_cmake_configure) set(configuring_message "Configuring ${TARGET_TRIPLET}") foreach(option IN LISTS arg_OPTIONS arg_OPTIONS_RELEASE arg_OPTIONS_DEBUG) - if(option MATCHES "^-D([^:=]*)[:=]") - list(APPEND manually_specified_variables "${CMAKE_MATCH_1}") + if("${option}" MATCHES "^-D([^:=]*)[:=]") + vcpkg_list(APPEND manually_specified_variables "${CMAKE_MATCH_1}") endif() endforeach() vcpkg_list(REMOVE_DUPLICATES manually_specified_variables) - vcpkg_list(REMOVE_ITEM manually_specified_variables ${arg_MAYBE_UNUSED_VARIABLES}) + foreach(maybe_unused_var IN LISTS arg_MAYBE_UNUSED_VARIABLES) + vcpkg_list(REMOVE_ITEM manually_specified_variables "${maybe_unused_var}") + endforeach() debug_message("manually specified variables: ${manually_specified_variables}") endif() From c1f00f7dec2b86b5a99bb4a80ad124b3679590e1 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 24 Feb 2022 13:13:55 +0100 Subject: [PATCH 04/34] format manifest --- ports/vcpkg-cmake/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/vcpkg-cmake/vcpkg.json b/ports/vcpkg-cmake/vcpkg.json index d8ac260e7b2e2a..27bea72cbb9867 100644 --- a/ports/vcpkg-cmake/vcpkg.json +++ b/ports/vcpkg-cmake/vcpkg.json @@ -1,5 +1,5 @@ { "name": "vcpkg-cmake", "version-date": "2022-02-24", - "license" : "MIT" + "license": "MIT" } From f7763b744527612729b33dc52a0b78dc3612caea Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 24 Feb 2022 13:14:15 +0100 Subject: [PATCH 05/34] update version --- versions/v-/vcpkg-cmake.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json index 5b8dac7eb79b83..d90e44aeeb351c 100644 --- a/versions/v-/vcpkg-cmake.json +++ b/versions/v-/vcpkg-cmake.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "91e0bb804f7e31301312dcc951689409cfe04b38", + "git-tree": "d28c3d8be8cbcb1a026ded1a47fde080ea33b62d", "version-date": "2022-02-24", "port-version": 0 }, From b58fd2db82e993f039fb7591a7677107b51eaf24 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 24 Feb 2022 14:48:07 +0100 Subject: [PATCH 06/34] use LOGFILE_BASE --- ports/vcpkg-cmake/vcpkg_cmake_configure.cmake | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake index 05cf3aaeae11e4..89bab5416997f7 100644 --- a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake +++ b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake @@ -332,12 +332,12 @@ function(vcpkg_cmake_configure) vcpkg_execute_required_process( COMMAND ninja -v WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure" - LOGNAME "${arg_LOGNAME}" + LOGNAME "${arg_LOGFILE_BASE}" ) vcpkg_list(APPEND config_logs - "${CURRENT_BUILDTREES_DIR}/${arg_LOGNAME}-out.log" - "${CURRENT_BUILDTREES_DIR}/${arg_LOGNAME}-err.log") + "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-out.log" + "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-err.log") else() if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug") message(STATUS "${configuring_message}-dbg") @@ -345,11 +345,11 @@ function(vcpkg_cmake_configure) vcpkg_execute_required_process( COMMAND ${dbg_command} WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" - LOGNAME "${arg_LOGNAME}-dbg" + LOGNAME "${arg_LOGFILE_BASE}-dbg" ) vcpkg_list(APPEND config_logs - "${CURRENT_BUILDTREES_DIR}/${arg_LOGNAME}-dbg-out.log" - "${CURRENT_BUILDTREES_DIR}/${arg_LOGNAME}-dbg-err.log") + "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-dbg-out.log" + "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-dbg-err.log") endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "release") @@ -358,11 +358,11 @@ function(vcpkg_cmake_configure) vcpkg_execute_required_process( COMMAND ${rel_command} WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" - LOGNAME "${arg_LOGNAME}-rel" + LOGNAME "${arg_LOGFILE_BASE}-rel" ) vcpkg_list(APPEND config_logs - "${CURRENT_BUILDTREES_DIR}/${arg_LOGNAME}-rel-out.log" - "${CURRENT_BUILDTREES_DIR}/${arg_LOGNAME}-rel-err.log") + "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-rel-out.log" + "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-rel-err.log") endif() endif() From df6f8f540a699fc400edaea4db9ea0b0a63effe0 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 24 Feb 2022 14:48:57 +0100 Subject: [PATCH 07/34] version update --- versions/v-/vcpkg-cmake.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json index d90e44aeeb351c..b98029f852726c 100644 --- a/versions/v-/vcpkg-cmake.json +++ b/versions/v-/vcpkg-cmake.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "d28c3d8be8cbcb1a026ded1a47fde080ea33b62d", + "git-tree": "efafdea2c6e0974313899a959388b4a8fac30a21", "version-date": "2022-02-24", "port-version": 0 }, From 307de8330363da1af95aa8c8cd4e024463f51e39 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 24 Feb 2022 21:24:44 +0100 Subject: [PATCH 08/34] readd PREFER_NINJA and print a warning that it is deprecated for vcpkg_cmake_configure --- ports/vcpkg-cmake/vcpkg_cmake_configure.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake index 89bab5416997f7..9c895d1df2587e 100644 --- a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake +++ b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake @@ -103,18 +103,22 @@ endmacro() function(vcpkg_cmake_configure) cmake_parse_arguments(PARSE_ARGV 0 "arg" - "DISABLE_PARALLEL_CONFIGURE;WINDOWS_USE_MSBUILD;NO_CHARSET_FLAG;Z_CMAKE_GET_VARS_USAGE" + "PREFER_NINJA;DISABLE_PARALLEL_CONFIGURE;WINDOWS_USE_MSBUILD;NO_CHARSET_FLAG;Z_CMAKE_GET_VARS_USAGE" "SOURCE_PATH;GENERATOR;LOGFILE_BASE" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;MAYBE_UNUSED_VARIABLES" ) if(NOT arg_Z_CMAKE_GET_VARS_USAGE AND DEFINED CACHE{Z_VCPKG_CMAKE_GENERATOR}) - message(WARNING "vcpkg_cmake_configure already called; this function should only be called once.") + message(WARNING "${CMAKE_CURRENT_FUNCTION} already called; this function should only be called once.") + endif() + if(arg_PREFER_NINJA) + message(WARNING "PREFER_NINJA has been deprecated in ${CMAKE_CURRENT_FUNCTION}. Please remove it from the portfile!") endif() if(DEFINED arg_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "vcpkg_cmake_configure was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") + message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION} was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") endif() + if(NOT DEFINED arg_SOURCE_PATH) message(FATAL_ERROR "SOURCE_PATH must be set") endif() From e148b260c033328e9587fd83be0367db83253d5a Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 24 Feb 2022 21:25:27 +0100 Subject: [PATCH 09/34] version stuff --- versions/v-/vcpkg-cmake.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json index b98029f852726c..935a513e050410 100644 --- a/versions/v-/vcpkg-cmake.json +++ b/versions/v-/vcpkg-cmake.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "efafdea2c6e0974313899a959388b4a8fac30a21", + "git-tree": "4b890263edb98d64aebd815d2c9d09022b70dd1b", "version-date": "2022-02-24", "port-version": 0 }, From 06f88856969abb959965f2fcdc0fdb80aae9b03f Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 25 Feb 2022 09:05:00 +0100 Subject: [PATCH 10/34] sync build_cmake --- scripts/cmake/vcpkg_build_cmake.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 84753067017dce..29e620fa5fbb12 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -62,12 +62,15 @@ function(vcpkg_build_cmake) "/p:UseIntelMKL=No" ) vcpkg_list(SET parallel_param "/m") + elseif("${Z_VCPKG_CMAKE_GENERATOR}" STREQUAL "NMake Makefiles") + # No options are currently added for nmake builds elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Unix Makefiles") vcpkg_list(SET build_args "VERBOSE=1") vcpkg_list(SET parallel_args "-j${VCPKG_CONCURRENCY}") vcpkg_list(SET no_parallel_args "") - elseif("${Z_VCPKG_CMAKE_GENERATOR}" STREQUAL "NMake Makefiles") - # No options are currently added for nmake builds + elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Xcode") + vcpkg_list(SET parallel_args -jobs "${VCPKG_CONCURRENCY}") + vcpkg_list(SET no_parallel_args -jobs 1) else() if(NOT DEFINED VCPKG_CMAKE_GENERATOR) message(FATAL_ERROR "Unrecognized GENERATOR setting from vcpkg_configure_cmake(). Valid generators are: Ninja, Visual Studio, and NMake Makefiles") From 71a4bdb5d0e767f5e47ccc09647711a37149e10c Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 25 Feb 2022 09:05:49 +0100 Subject: [PATCH 11/34] only turn off ninja on windows --- scripts/cmake/vcpkg_configure_cmake.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 1cf96452ab561b..47f291e553c1c3 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -224,7 +224,7 @@ function(vcpkg_configure_cmake) set(ninja_can_be_used ON) # Ninja as generator set(ninja_host ON) # Ninja as parallel configurator - if(NOT arg_PREFER_NINJA) + if(NOT arg_PREFER_NINJA AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) set(ninja_can_be_used OFF) endif() From 4d916c42b6483cbcab015cba0a6c36573bcabb04 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 25 Feb 2022 09:08:03 +0100 Subject: [PATCH 12/34] add Z_VCPKG_CHAINLOAD_TOOLCHAIN_FILE --- scripts/cmake/vcpkg_configure_cmake.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 47f291e553c1c3..809fa025f0b17d 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -161,7 +161,9 @@ endfunction() function(z_vcpkg_select_default_vcpkg_chainload_toolchain) # Try avoiding adding more defaults here. # Set VCPKG_CHAINLOAD_TOOLCHAIN_FILE explicitly in the triplet. - if(VCPKG_TARGET_IS_MINGW) + if(DEFINED Z_VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${Z_VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") + elseif(VCPKG_TARGET_IS_MINGW) set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake") elseif(VCPKG_TARGET_IS_WINDOWS) set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake") From cbe05a56609daf07161a5a05c3fe97938201da77 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 25 Feb 2022 09:09:56 +0100 Subject: [PATCH 13/34] use z_vcpkg_select_default_vcpkg_chainload_toolchain in meson --- scripts/cmake/vcpkg_configure_meson.cmake | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/scripts/cmake/vcpkg_configure_meson.cmake b/scripts/cmake/vcpkg_configure_meson.cmake index 02e189b3140dad..eca27f789dbfb9 100644 --- a/scripts/cmake/vcpkg_configure_meson.cmake +++ b/scripts/cmake/vcpkg_configure_meson.cmake @@ -195,23 +195,7 @@ function(z_vcpkg_meson_generate_native_file_config config_type) #https://mesonbu string(APPEND native_file "[cmake]\n") if(NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE) - if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake") - elseif(VCPKG_TARGET_IS_LINUX) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/linux.cmake") - elseif(VCPKG_TARGET_IS_ANDROID) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/android.cmake") - elseif(VCPKG_TARGET_IS_OSX) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/osx.cmake") - elseif(VCPKG_TARGET_IS_IOS) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/ios.cmake") - elseif(VCPKG_TARGET_IS_FREEBSD) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/freebsd.cmake") - elseif(VCPKG_TARGET_IS_OPENBSD) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/openbsd.cmake") - elseif(VCPKG_TARGET_IS_MINGW) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake") - endif() + z_vcpkg_select_default_vcpkg_chainload_toolchain() endif() string(APPEND native_file "VCPKG_TARGET_TRIPLET = '${TARGET_TRIPLET}'\n") From dee7ac261db22ca64efe769c1b9bb149773bce9b Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 29 Mar 2022 12:45:27 +0200 Subject: [PATCH 14/34] remove VCPKG_CMAKE_GENERATOR --- ports/vcpkg-cmake/vcpkg_cmake_build.cmake | 4 +--- ports/vcpkg-cmake/vcpkg_cmake_configure.cmake | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ports/vcpkg-cmake/vcpkg_cmake_build.cmake b/ports/vcpkg-cmake/vcpkg_cmake_build.cmake index 20798c09c6a261..562f79de6e22e0 100644 --- a/ports/vcpkg-cmake/vcpkg_cmake_build.cmake +++ b/ports/vcpkg-cmake/vcpkg_cmake_build.cmake @@ -71,9 +71,7 @@ function(vcpkg_cmake_build) vcpkg_list(SET parallel_args -jobs "${VCPKG_CONCURRENCY}") vcpkg_list(SET no_parallel_args -jobs 1) else() - if(NOT DEFINED VCPKG_CMAKE_GENERATOR) - message(FATAL_ERROR "Unrecognized GENERATOR setting from vcpkg_configure_cmake(). Valid generators are: Ninja, Visual Studio, and NMake Makefiles") - endif() + message(FATAL_ERROR "Unrecognized GENERATOR setting from vcpkg_configure_cmake(). Valid generators are: Ninja, Visual Studio, and NMake Makefiles") endif() vcpkg_list(SET target_param) diff --git a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake index 9c895d1df2587e..87cc57961ee270 100644 --- a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake +++ b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake @@ -166,9 +166,7 @@ function(vcpkg_cmake_configure) endif() set(generator "Ninja") - if(DEFINED VCPKG_CMAKE_GENERATOR AND NOT VCPKG_CMAKE_GENERATOR STREQUAL "") - set(generator "${VCPKG_CMAKE_GENERATOR}") # Triplet override. - elseif(DEFINED arg_GENERATOR) + if(DEFINED arg_GENERATOR) set(generator "${arg_GENERATOR}") elseif(arg_WINDOWS_USE_MSBUILD OR NOT ninja_can_be_used) set(generator "") From be1fcf97135cf72beb20f10ca8a45b752cfaf057 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 29 Mar 2022 12:45:51 +0200 Subject: [PATCH 15/34] version stuff --- versions/v-/vcpkg-cmake.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json index 935a513e050410..e77c6e264e6c6f 100644 --- a/versions/v-/vcpkg-cmake.json +++ b/versions/v-/vcpkg-cmake.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "4b890263edb98d64aebd815d2c9d09022b70dd1b", + "git-tree": "96d8ac5b27ba60cfd90d17bc50ca88427d55a32e", "version-date": "2022-02-24", "port-version": 0 }, From 2c654df28792d35e9e41c8848a265be70b49b42f Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 29 Mar 2022 12:50:37 +0200 Subject: [PATCH 16/34] reduce error to warning --- ports/vcpkg-cmake/vcpkg_cmake_build.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/vcpkg-cmake/vcpkg_cmake_build.cmake b/ports/vcpkg-cmake/vcpkg_cmake_build.cmake index 562f79de6e22e0..bb66a7800c5b1a 100644 --- a/ports/vcpkg-cmake/vcpkg_cmake_build.cmake +++ b/ports/vcpkg-cmake/vcpkg_cmake_build.cmake @@ -71,7 +71,7 @@ function(vcpkg_cmake_build) vcpkg_list(SET parallel_args -jobs "${VCPKG_CONCURRENCY}") vcpkg_list(SET no_parallel_args -jobs 1) else() - message(FATAL_ERROR "Unrecognized GENERATOR setting from vcpkg_configure_cmake(). Valid generators are: Ninja, Visual Studio, and NMake Makefiles") + message(WARNING "Unrecognized GENERATOR setting from vcpkg_cmake_configure().") endif() vcpkg_list(SET target_param) From aee9effa1ef2b15348b40c7a35c69b5f2b73f1e4 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 29 Mar 2022 12:51:40 +0200 Subject: [PATCH 17/34] remove VCPKG_CMAKE_GENERATOR form configure_cmake --- scripts/cmake/vcpkg_configure_cmake.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 809fa025f0b17d..c2819dc64066a0 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -249,9 +249,7 @@ function(vcpkg_configure_cmake) set(generator "Ninja") # the default generator is always ninja! set(generator_arch "") - if(DEFINED VCPKG_CMAKE_GENERATOR AND NOT VCPKG_CMAKE_GENERATOR STREQUAL "") - set(generator "${VCPKG_CMAKE_GENERATOR}") # Triplet override. - elseif(DEFINED arg_GENERATOR) + if(DEFINED arg_GENERATOR) set(generator "${arg_GENERATOR}") elseif(NOT ninja_can_be_used) set(generator "") From 83774459fbf486c8be0c36d7c63d171f67fab2ae Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 29 Mar 2022 12:51:50 +0200 Subject: [PATCH 18/34] version stuff --- versions/v-/vcpkg-cmake.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json index e77c6e264e6c6f..6ae0e697a67bdc 100644 --- a/versions/v-/vcpkg-cmake.json +++ b/versions/v-/vcpkg-cmake.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "96d8ac5b27ba60cfd90d17bc50ca88427d55a32e", + "git-tree": "d0ada2e4ae40c8be48e52d9687ffe825a21cd358", "version-date": "2022-02-24", "port-version": 0 }, From 4cd417cb3b776d201e2b634bc382114a61c7fadf Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 12 Apr 2022 09:23:20 +0200 Subject: [PATCH 19/34] version stuff --- versions/baseline.json | 2 +- versions/v-/vcpkg-cmake.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index e76999ffe9b9c8..93019c1a9ee380 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7293,7 +7293,7 @@ "port-version": 1 }, "vcpkg-cmake": { - "baseline": "2022-04-07", + "baseline": "2022-04-12", "port-version": 0 }, "vcpkg-cmake-config": { diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json index fb83ccdf337642..21de768603ec1e 100644 --- a/versions/v-/vcpkg-cmake.json +++ b/versions/v-/vcpkg-cmake.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "2c2baa1d8b44608e754e08eccc8188047d6a6b47", + "version-date": "2022-04-12", + "port-version": 0 + }, { "git-tree": "3dcb01563c0de941013579456d19ce5b0bd08a6e", "version-date": "2022-04-07", From 215df39acfa48e2f5684290f78f3bb3d57ee2dfd Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 12 Apr 2022 10:47:21 +0200 Subject: [PATCH 20/34] use build_dir_ --- ports/vcpkg-cmake/vcpkg_cmake_configure.cmake | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake index af3bf8993f7665..a5663a2320a374 100644 --- a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake +++ b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake @@ -325,15 +325,15 @@ function(vcpkg_cmake_configure) z_vcpkg_configure_cmake_build_cmakecache(ninja_configure_contents "../../${TARGET_TRIPLET}-dbg" "dbg") endif() - file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure") + file(MAKE_DIRECTORY "${build_dir_release}/vcpkg-parallel-configure") file(WRITE - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure/build.ninja" + "${build_dir_release}/vcpkg-parallel-configure/build.ninja" "${ninja_configure_contents}") message(STATUS "${configuring_message}") vcpkg_execute_required_process( COMMAND ninja -v - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure" + WORKING_DIRECTORY "${build_dir_release}/vcpkg-parallel-configure" LOGNAME "${arg_LOGFILE_BASE}" ) @@ -343,10 +343,9 @@ function(vcpkg_cmake_configure) else() if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug") message(STATUS "${configuring_message}-dbg") - file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( COMMAND ${dbg_command} - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" + WORKING_DIRECTORY "${build_dir_debug}" LOGNAME "${arg_LOGFILE_BASE}-dbg" ) vcpkg_list(APPEND config_logs @@ -356,10 +355,9 @@ function(vcpkg_cmake_configure) if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "release") message(STATUS "${configuring_message}-rel") - file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( COMMAND ${rel_command} - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" + WORKING_DIRECTORY "${build_dir_release}" LOGNAME "${arg_LOGFILE_BASE}-rel" ) vcpkg_list(APPEND config_logs From 2384c49c653c343f44257088d52eb06eb2bc1317 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 12 Apr 2022 10:47:51 +0200 Subject: [PATCH 21/34] version stuff --- versions/v-/vcpkg-cmake.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json index 21de768603ec1e..3b4364931a31b1 100644 --- a/versions/v-/vcpkg-cmake.json +++ b/versions/v-/vcpkg-cmake.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "2c2baa1d8b44608e754e08eccc8188047d6a6b47", + "git-tree": "01c00055e037a29edcf50d52f18ba265d8e16d6a", "version-date": "2022-04-12", "port-version": 0 }, From 5980611b8e3d5bff32ddefbceb8c0f21bd55535d Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 14 Apr 2022 14:49:24 +0200 Subject: [PATCH 22/34] use ninja variable insead of pure ninja cmd --- ports/vcpkg-cmake/vcpkg_cmake_configure.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake index a5663a2320a374..f3bb78372d8337 100644 --- a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake +++ b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake @@ -332,7 +332,7 @@ function(vcpkg_cmake_configure) message(STATUS "${configuring_message}") vcpkg_execute_required_process( - COMMAND ninja -v + COMMAND "${NINJA}" -v WORKING_DIRECTORY "${build_dir_release}/vcpkg-parallel-configure" LOGNAME "${arg_LOGFILE_BASE}" ) From 8972bcb86b6629a4d58c3c7cbf6e54d4020f6583 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 14 Apr 2022 14:49:44 +0200 Subject: [PATCH 23/34] version bump --- versions/v-/vcpkg-cmake.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json index 3b4364931a31b1..ae43948eab3ab3 100644 --- a/versions/v-/vcpkg-cmake.json +++ b/versions/v-/vcpkg-cmake.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "01c00055e037a29edcf50d52f18ba265d8e16d6a", + "git-tree": "7d214fa570e0f5099116f6340fc2f3076005250f", "version-date": "2022-04-12", "port-version": 0 }, From f131fb5429ea31d1c5c9a37a46c392e1a5389ea2 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 14 Apr 2022 18:32:30 +0200 Subject: [PATCH 24/34] use ninja variable instead of calling ninja directly --- scripts/cmake/vcpkg_configure_cmake.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 4c458506f383fe..c7eb890de885fe 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -383,7 +383,7 @@ function(vcpkg_configure_cmake) message(STATUS "${configuring_message}") vcpkg_execute_required_process( - COMMAND ninja -v + COMMAND "${NINJA}" -v WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure" LOGNAME "${arg_LOGNAME}" ) From 797f5f1be1e8c5a3eee012a0fe063a959e390391 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 14 Apr 2022 20:52:50 +0200 Subject: [PATCH 25/34] acquire ninja --- scripts/cmake/vcpkg_configure_cmake.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index c7eb890de885fe..6047bb30144d7b 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -360,6 +360,7 @@ function(vcpkg_configure_cmake) if(NOT DEFINED ninja_path) # if ninja_path was defined above, we've already done this + vcpkg_find_acquire_program(NINJA) get_filename_component(ninja_path "${NINJA}" DIRECTORY) vcpkg_add_to_path("${ninja_path}") endif() From f9b1fa6430f04ba8471d25cd9060827b3ca89b00 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 14 Apr 2022 20:53:52 +0200 Subject: [PATCH 26/34] move the acquire. --- scripts/cmake/vcpkg_configure_cmake.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 6047bb30144d7b..5c0f48ee78561e 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -358,9 +358,9 @@ function(vcpkg_configure_cmake) if(ninja_host AND CMAKE_HOST_WIN32 AND NOT arg_DISABLE_PARALLEL_CONFIGURE) vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_DISABLE_SOURCE_CHANGES=ON") + vcpkg_find_acquire_program(NINJA) if(NOT DEFINED ninja_path) # if ninja_path was defined above, we've already done this - vcpkg_find_acquire_program(NINJA) get_filename_component(ninja_path "${NINJA}" DIRECTORY) vcpkg_add_to_path("${ninja_path}") endif() From 46b2ba9f016bec0796dfdd03428bd8402e609114 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 20 Apr 2022 00:17:08 +0200 Subject: [PATCH 27/34] remove setting of cmake_prefix_path --- ports/ashes/portfile.cmake | 1 - ports/ashes/vcpkg.json | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/ashes/portfile.cmake b/ports/ashes/portfile.cmake index 438c62bc916c7d..7e16bebac22b0e 100644 --- a/ports/ashes/portfile.cmake +++ b/ports/ashes/portfile.cmake @@ -22,7 +22,6 @@ file(COPY "${CMAKE_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/CMake") vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DCMAKE_INSTALL_PREFIX=${CURRENT_INSTALLED_DIR} -DVCPKG_PACKAGE_BUILD=ON -DASHES_BUILD_TEMPLATES=OFF -DASHES_BUILD_TESTS=OFF diff --git a/ports/ashes/vcpkg.json b/ports/ashes/vcpkg.json index 0cee851d91bf88..cb4e0f250a1c0b 100644 --- a/ports/ashes/vcpkg.json +++ b/ports/ashes/vcpkg.json @@ -1,6 +1,7 @@ { "name": "ashes", "version-date": "2022-04-03", + "port-version": 1, "description": "Drop-in replacement to Vulkan's shared library, allowing the use of OpenGL or Direct3D11 in addition to Vulkan.", "homepage": "https://github.com/DragonJoker/Ashes", "license": "MIT", From 3cc70e7d90fb57db1a7430f4f6558ecc562cea80 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 20 Apr 2022 00:17:52 +0200 Subject: [PATCH 28/34] version stuff --- versions/a-/ashes.json | 5 +++++ versions/baseline.json | 4 ++-- versions/v-/vcpkg-cmake.json | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/versions/a-/ashes.json b/versions/a-/ashes.json index 62c56ba6454729..2bc400a20e67a9 100644 --- a/versions/a-/ashes.json +++ b/versions/a-/ashes.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "96b165dc0ea6c62aeabea274f6833c55feaccdd1", + "version-date": "2022-04-03", + "port-version": 1 + }, { "git-tree": "365d042da082df035fb7dba0a53e1a4ac306f469", "version-date": "2022-04-03", diff --git a/versions/baseline.json b/versions/baseline.json index fc44c8d760aff6..54cceb9129215b 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -174,7 +174,7 @@ }, "ashes": { "baseline": "2022-04-03", - "port-version": 0 + "port-version": 1 }, "asio": { "baseline": "1.22.1", @@ -7297,7 +7297,7 @@ "port-version": 1 }, "vcpkg-cmake": { - "baseline": "2022-04-12", + "baseline": "2022-04-20", "port-version": 0 }, "vcpkg-cmake-config": { diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json index fd801a9bc4d763..f5864850939d12 100644 --- a/versions/v-/vcpkg-cmake.json +++ b/versions/v-/vcpkg-cmake.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "b9989a66566f57bc02da8a018e2e639e8729400f", + "version-date": "2022-04-20", + "port-version": 0 + }, { "git-tree": "ef4a9463f802c1cd6f8b31e560529aeaee0faff4", "version-date": "2022-04-12", From bd379e3f5e5cbaddc52e8b2a7d82ae33bc78627b Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 5 May 2022 09:51:33 +0200 Subject: [PATCH 29/34] bump version date --- ports/vcpkg-cmake/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/vcpkg-cmake/vcpkg.json b/ports/vcpkg-cmake/vcpkg.json index db0c74d719c46a..c888fc8729a5a6 100644 --- a/ports/vcpkg-cmake/vcpkg.json +++ b/ports/vcpkg-cmake/vcpkg.json @@ -1,5 +1,5 @@ { "name": "vcpkg-cmake", - "version-date": "2022-04-21", + "version-date": "2022-05-05", "license": "MIT" } From 5a5f9e48f33160b39b6eb858d0ae9b7b575ed3c2 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 5 May 2022 09:52:13 +0200 Subject: [PATCH 30/34] version stuff --- versions/baseline.json | 2 +- versions/v-/vcpkg-cmake.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 5b621212ce182d..f31c7a908f1f9d 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7313,7 +7313,7 @@ "port-version": 1 }, "vcpkg-cmake": { - "baseline": "2022-04-21", + "baseline": "2022-05-05", "port-version": 0 }, "vcpkg-cmake-config": { diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json index 6643af5d0fffd9..4602f78eb4580b 100644 --- a/versions/v-/vcpkg-cmake.json +++ b/versions/v-/vcpkg-cmake.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "4efa540605bb038a8dd6582f686572d6788c7aac", + "version-date": "2022-05-05", + "port-version": 0 + }, { "git-tree": "8273918a04a5822ad7cc21ea5249402f2e999a7a", "version-date": "2022-04-21", From c046fe0c6dbbb647a8e525057ddefec16281a96c Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 5 May 2022 09:56:57 +0200 Subject: [PATCH 31/34] bump ashes baseline --- versions/baseline.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index f31c7a908f1f9d..3f0c7d21ce3b44 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -174,7 +174,7 @@ }, "ashes": { "baseline": "2022-04-03", - "port-version": 0 + "port-version": 1 }, "asio": { "baseline": "1.22.1", From 4ab336648eea13b6b8fe59a9f38d26f4793dd330 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 5 May 2022 11:49:15 +0200 Subject: [PATCH 32/34] remove VCPKG_CMAKE_GENERATOR reference --- scripts/cmake/vcpkg_build_cmake.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 29e620fa5fbb12..cd8952f5df395e 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -72,9 +72,7 @@ function(vcpkg_build_cmake) vcpkg_list(SET parallel_args -jobs "${VCPKG_CONCURRENCY}") vcpkg_list(SET no_parallel_args -jobs 1) else() - if(NOT DEFINED VCPKG_CMAKE_GENERATOR) - message(FATAL_ERROR "Unrecognized GENERATOR setting from vcpkg_configure_cmake(). Valid generators are: Ninja, Visual Studio, and NMake Makefiles") - endif() + message(FATAL_ERROR "Unrecognized GENERATOR setting from vcpkg_configure_cmake(). Valid generators are: Ninja, Visual Studio, and NMake Makefiles") endif() vcpkg_list(SET target_param) From b6d03b8d0d32e094e00201abb8ba125447f2f494 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 5 May 2022 12:30:46 +0200 Subject: [PATCH 33/34] fix wrong variable reference due to refactor --- ports/vcpkg-cmake/vcpkg_cmake_configure.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake index 573694bf3dedf9..fcb6f6f15a5fc4 100644 --- a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake +++ b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake @@ -272,7 +272,7 @@ function(vcpkg_cmake_configure) # Sets configuration variables for macOS builds foreach(config_var IN ITEMS INSTALL_NAME_DIR OSX_DEPLOYMENT_TARGET OSX_SYSROOT OSX_ARCHITECTURES) if(DEFINED VCPKG_${config_var}) - vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_${config_var}=${config_var_value}") + vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_${config_var}=${VCPKG_${config_var}}") endif() endforeach() From 796a14161f6135817cd7aa8e0eaaea45b0b8fe8f Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 5 May 2022 12:31:12 +0200 Subject: [PATCH 34/34] version stuff --- versions/v-/vcpkg-cmake.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json index 4602f78eb4580b..bb8b094fabf7c5 100644 --- a/versions/v-/vcpkg-cmake.json +++ b/versions/v-/vcpkg-cmake.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "4efa540605bb038a8dd6582f686572d6788c7aac", + "git-tree": "ecfb2282f599a9c1f3a9ad98eac9d2b35690850f", "version-date": "2022-05-05", "port-version": 0 },