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

[vcpkg-cmake|cmake buildsystem] synchronize and sanitize scripts. #23259

Merged
merged 50 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
637a636
synchronize cmake build scripts.
Feb 24, 2022
b067063
version stuff
Feb 24, 2022
88f1d66
fix REMOVE_ITEM and add license
Feb 24, 2022
c1f00f7
format manifest
Feb 24, 2022
f7763b7
update version
Feb 24, 2022
b58fd2d
use LOGFILE_BASE
Feb 24, 2022
df6f8f5
version update
Feb 24, 2022
307de83
readd PREFER_NINJA and print a warning that it is deprecated for vcpk…
Neumann-A Feb 24, 2022
e148b26
version stuff
Neumann-A Feb 24, 2022
06f8885
sync build_cmake
Feb 25, 2022
71a4bdb
only turn off ninja on windows
Feb 25, 2022
4d916c4
add Z_VCPKG_CHAINLOAD_TOOLCHAIN_FILE
Feb 25, 2022
cbe05a5
use z_vcpkg_select_default_vcpkg_chainload_toolchain in meson
Feb 25, 2022
36bb47e
Merge remote-tracking branch 'upstream/master' into fix_generator_sel…
Neumann-A Feb 26, 2022
d707742
Merge remote-tracking branch 'upstream/master' into fix_generator_sel…
Neumann-A Mar 3, 2022
04d1466
Merge remote-tracking branch 'upstream/master' into fix_generator_sel…
Neumann-A Mar 14, 2022
494aea4
Merge remote-tracking branch 'upstream/master' into fix_generator_sel…
Neumann-A Mar 17, 2022
07995f7
Merge remote-tracking branch 'upstream/master' into fix_generator_sel…
Mar 29, 2022
dee7ac2
remove VCPKG_CMAKE_GENERATOR
Mar 29, 2022
be1fcf9
version stuff
Mar 29, 2022
2c654df
reduce error to warning
Mar 29, 2022
aee9eff
remove VCPKG_CMAKE_GENERATOR form configure_cmake
Mar 29, 2022
8377445
version stuff
Mar 29, 2022
f93092b
Merge remote-tracking branch 'upstream/master' into fix_generator_sel…
Apr 12, 2022
4cd417c
version stuff
Apr 12, 2022
215df39
use build_dir_<config>
Apr 12, 2022
2384c49
version stuff
Apr 12, 2022
239c84c
Merge remote-tracking branch 'upstream/master' into fix_generator_sel…
Neumann-A Apr 12, 2022
f7e9f67
Merge branch 'fix_generator_selection' of https://github.com/Neumann-…
Apr 14, 2022
e0df821
Merge remote-tracking branch 'upstream/master' into fix_generator_sel…
Apr 14, 2022
5980611
use ninja variable insead of pure ninja cmd
Apr 14, 2022
8972bcb
version bump
Apr 14, 2022
f131fb5
use ninja variable instead of calling ninja directly
Neumann-A Apr 14, 2022
fecb9ac
Merge branch 'fix_generator_selection' of https://github.com/Neumann-…
Neumann-A Apr 14, 2022
797f5f1
acquire ninja
Neumann-A Apr 14, 2022
f9b1fa6
move the acquire.
Neumann-A Apr 14, 2022
7e2665c
Merge remote-tracking branch 'upstream/master' into fix_generator_sel…
Neumann-A Apr 17, 2022
28e579d
Merge remote-tracking branch 'upstream/master' into fix_generator_sel…
Neumann-A Apr 18, 2022
415b044
Merge remote-tracking branch 'upstream/master' into fix_generator_sel…
Neumann-A Apr 19, 2022
46b2ba9
remove setting of cmake_prefix_path
Neumann-A Apr 19, 2022
3cc70e7
version stuff
Neumann-A Apr 19, 2022
457728b
Merge remote-tracking branch 'upstream/master' into fix_generator_sel…
Neumann-A Apr 21, 2022
959a683
Merge remote-tracking branch 'upstream/master' into fix_generator_sel…
May 5, 2022
bd379e3
bump version date
May 5, 2022
5a5f9e4
version stuff
May 5, 2022
c046fe0
bump ashes baseline
May 5, 2022
4ab3366
remove VCPKG_CMAKE_GENERATOR reference
May 5, 2022
b6d03b8
fix wrong variable reference due to refactor
May 5, 2022
796a141
version stuff
May 5, 2022
ba78c84
Merge remote-tracking branch 'origin/master' into HEAD
BillyONeal May 6, 2022
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
3 changes: 2 additions & 1 deletion ports/vcpkg-cmake/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "vcpkg-cmake",
"version-date": "2022-01-19"
"version-date": "2022-02-24",
"license": "MIT"
}
89 changes: 48 additions & 41 deletions ports/vcpkg-cmake/vcpkg_cmake_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Neumann-A marked this conversation as resolved.
Show resolved Hide resolved

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()
Expand Down
Loading