mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +08:00
[vcpkg-cmake|cmake buildsystem] synchronize and sanitize scripts. (#23259)
* synchronize cmake build scripts. * version stuff * fix REMOVE_ITEM and add license * format manifest * update version * use LOGFILE_BASE * version update * readd PREFER_NINJA and print a warning that it is deprecated for vcpkg_cmake_configure * version stuff * sync build_cmake * only turn off ninja on windows * add Z_VCPKG_CHAINLOAD_TOOLCHAIN_FILE * use z_vcpkg_select_default_vcpkg_chainload_toolchain in meson * remove VCPKG_CMAKE_GENERATOR * version stuff * reduce error to warning * remove VCPKG_CMAKE_GENERATOR form configure_cmake * version stuff * version stuff * use build_dir_<config> * version stuff * use ninja variable insead of pure ninja cmd * version bump * use ninja variable instead of calling ninja directly * acquire ninja * move the acquire. * remove setting of cmake_prefix_path * version stuff * bump version date * version stuff * bump ashes baseline * remove VCPKG_CMAKE_GENERATOR reference * fix wrong variable reference due to refactor * version stuff Co-authored-by: Alexander Neumann <you@example.com> Co-authored-by: Billy Robert O'Neal <bion@microsoft.com>
This commit is contained in:
parent
aec505b36b
commit
f7866c66d2
@ -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
|
||||
|
@ -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",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"version-date": "2022-04-21",
|
||||
"version-date": "2022-05-05",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
@ -47,77 +47,82 @@ function(vcpkg_cmake_build)
|
||||
if(NOT DEFINED arg_LOGFILE_BASE)
|
||||
set(arg_LOGFILE_BASE "build")
|
||||
endif()
|
||||
vcpkg_list(SET build_param)
|
||||
vcpkg_list(SET parallel_param)
|
||||
vcpkg_list(SET no_parallel_param)
|
||||
|
||||
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
|
||||
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().")
|
||||
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()
|
||||
|
@ -109,12 +109,16 @@ function(vcpkg_cmake_configure)
|
||||
)
|
||||
|
||||
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_buildsystem_build 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()
|
||||
@ -130,12 +134,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()
|
||||
list(REMOVE_DUPLICATES manually_specified_variables)
|
||||
list(REMOVE_ITEM manually_specified_variables ${arg_MAYBE_UNUSED_VARIABLES})
|
||||
vcpkg_list(REMOVE_DUPLICATES manually_specified_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()
|
||||
|
||||
@ -178,7 +184,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")
|
||||
@ -192,7 +198,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)
|
||||
@ -201,13 +207,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}\". "
|
||||
@ -227,9 +233,8 @@ function(vcpkg_cmake_configure)
|
||||
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}"
|
||||
@ -260,34 +265,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}=${VCPKG_${config_var}}")
|
||||
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"
|
||||
"-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}"
|
||||
${arg_OPTIONS} ${arg_OPTIONS_RELEASE})
|
||||
vcpkg_list(SET dbg_command
|
||||
"${CMAKE_COMMAND}" "${arg_SOURCE_PATH}"
|
||||
-G "${generator}"
|
||||
"-DCMAKE_BUILD_TYPE=Debug"
|
||||
"-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug"
|
||||
${arg_OPTIONS} ${arg_OPTIONS_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)
|
||||
@ -295,92 +311,53 @@ 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(WRITE
|
||||
"${build_dir_release}/vcpkg-parallel-configure/build.ninja"
|
||||
"${ninja_configure_contents}")
|
||||
|
||||
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}"
|
||||
)
|
||||
list(APPEND config_logs
|
||||
|
||||
vcpkg_list(APPEND config_logs
|
||||
"${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")
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug")
|
||||
message(STATUS "${configuring_message}-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"
|
||||
COMMAND ${dbg_command}
|
||||
WORKING_DIRECTORY "${build_dir_debug}"
|
||||
LOGNAME "${arg_LOGFILE_BASE}-dbg"
|
||||
)
|
||||
list(APPEND config_logs
|
||||
vcpkg_list(APPEND config_logs
|
||||
"${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")
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "release")
|
||||
message(STATUS "${configuring_message}-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}"
|
||||
COMMAND ${rel_command}
|
||||
WORKING_DIRECTORY "${build_dir_release}"
|
||||
LOGNAME "${arg_LOGFILE_BASE}-rel"
|
||||
)
|
||||
list(APPEND config_logs
|
||||
vcpkg_list(APPEND config_logs
|
||||
"${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-rel-out.log"
|
||||
"${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-rel-err.log")
|
||||
endif()
|
||||
@ -402,7 +379,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()
|
||||
@ -410,8 +387,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.
|
||||
|
@ -64,6 +64,13 @@ function(vcpkg_build_cmake)
|
||||
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 "Xcode")
|
||||
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")
|
||||
endif()
|
||||
|
@ -240,8 +240,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()
|
||||
|
||||
@ -328,23 +328,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_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}")
|
||||
"-DCMAKE_BUILD_TYPE=Release"
|
||||
"-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}"
|
||||
${arg_OPTIONS} ${arg_OPTIONS_RELEASE})
|
||||
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_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug")
|
||||
"-DCMAKE_BUILD_TYPE=Debug"
|
||||
"-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug"
|
||||
${arg_OPTIONS} ${arg_OPTIONS_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
|
||||
@ -365,7 +381,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}"
|
||||
)
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "96b165dc0ea6c62aeabea274f6833c55feaccdd1",
|
||||
"version-date": "2022-04-03",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "365d042da082df035fb7dba0a53e1a4ac306f469",
|
||||
"version-date": "2022-04-03",
|
||||
|
@ -174,7 +174,7 @@
|
||||
},
|
||||
"ashes": {
|
||||
"baseline": "2022-04-03",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"asio": {
|
||||
"baseline": "1.22.1",
|
||||
@ -7317,7 +7317,7 @@
|
||||
"port-version": 1
|
||||
},
|
||||
"vcpkg-cmake": {
|
||||
"baseline": "2022-04-21",
|
||||
"baseline": "2022-05-05",
|
||||
"port-version": 0
|
||||
},
|
||||
"vcpkg-cmake-config": {
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "ecfb2282f599a9c1f3a9ad98eac9d2b35690850f",
|
||||
"version-date": "2022-05-05",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "8273918a04a5822ad7cc21ea5249402f2e999a7a",
|
||||
"version-date": "2022-04-21",
|
||||
|
Loading…
x
Reference in New Issue
Block a user