-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[vcpkg_configure_make] Standardize OPTIONS list item handling
#19540
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
Changes from all commits
3960df5
cacf21a
79fead3
9e4f9b0
0d15135
7af5509
b2af699
b51dd68
70f010c
2a8b1f6
0a70e36
64dc4f3
76debd1
b95ec66
78abe6e
f6f3915
743bef4
03e184d
ead1428
75f9783
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,18 @@ | ||
| { | ||
| "name": "libtasn1", | ||
| "version": "4.17.0", | ||
| "port-version": 1, | ||
| "port-version": 3, | ||
| "description": "A secure communications library implementing the SSL, TLS and DTLS protocols", | ||
| "homepage": "https://www.gnutls.org/", | ||
| "supports": "!uwp", | ||
| "dependencies": [ | ||
| { | ||
| "name": "getopt", | ||
| "platform": "windows" | ||
| "platform": "windows & !mingw" | ||
| }, | ||
| { | ||
| "name": "gettimeofday", | ||
| "platform": "windows" | ||
| "platform": "windows & !mingw" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -302,6 +302,7 @@ function(vcpkg_configure_make) | |
| set(_vcm_paths_with_spaces TRUE) | ||
| endif() | ||
|
|
||
| set(CONFIGURE_ENV "V=1") | ||
| # Pre-processing windows configure requirements | ||
| if (VCPKG_TARGET_IS_WINDOWS) | ||
| if(CMAKE_HOST_WIN32) | ||
|
|
@@ -351,7 +352,6 @@ function(vcpkg_configure_make) | |
| endif() | ||
| endmacro() | ||
|
|
||
| set(CONFIGURE_ENV "V=1") | ||
| # Remove full filepaths due to spaces and prepend filepaths to PATH (cross-compiling tools are unlikely on path by default) | ||
| set(progs VCPKG_DETECTED_CMAKE_C_COMPILER VCPKG_DETECTED_CMAKE_CXX_COMPILER VCPKG_DETECTED_CMAKE_AR | ||
| VCPKG_DETECTED_CMAKE_LINKER VCPKG_DETECTED_CMAKE_RANLIB VCPKG_DETECTED_CMAKE_OBJDUMP | ||
|
|
@@ -448,17 +448,16 @@ function(vcpkg_configure_make) | |
| endif() | ||
| endif() | ||
|
|
||
| # Some PATH handling for dealing with spaces....some tools will still fail with that! | ||
| # In particular, the libtool install command is unable to install correctly to paths with spaces. | ||
| # CURRENT_INSTALLED_DIR: Pristine native path (unprotected spaces, Windows drive letters) | ||
| # _VCPKG_INSTALLED: Native path with escaped space characters | ||
| # _VCPKG_PREFIX: Path with unprotected spaces, but drive letters transformed for mingw/msys | ||
| string(REPLACE " " "\\ " _VCPKG_INSTALLED "${CURRENT_INSTALLED_DIR}") | ||
| if(CMAKE_HOST_WIN32) | ||
| #Some PATH handling for dealing with spaces....some tools will still fail with that! | ||
| string(REPLACE " " "\\\ " _VCPKG_PREFIX ${CURRENT_INSTALLED_DIR}) | ||
| string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PREFIX "${_VCPKG_PREFIX}") | ||
| set(_VCPKG_INSTALLED ${CURRENT_INSTALLED_DIR}) | ||
| set(prefix_var "'\${prefix}'") # Windows needs extra quotes or else the variable gets expanded in the makefile! | ||
| string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PREFIX "${CURRENT_INSTALLED_DIR}") | ||
| else() | ||
| string(REPLACE " " "\ " _VCPKG_PREFIX ${CURRENT_INSTALLED_DIR}) | ||
| string(REPLACE " " "\ " _VCPKG_INSTALLED ${CURRENT_INSTALLED_DIR}) | ||
| set(EXTRA_QUOTES) | ||
| set(prefix_var "\${prefix}") | ||
| set(_VCPKG_PREFIX "${CURRENT_INSTALLED_DIR}") | ||
| endif() | ||
|
|
||
| # macOS - cross-compiling support | ||
|
|
@@ -484,25 +483,26 @@ function(vcpkg_configure_make) | |
| "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}") | ||
|
|
||
| # Set configure paths | ||
| set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}${EXTRA_QUOTES}") | ||
| set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}/debug${EXTRA_QUOTES}") | ||
| set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} "--prefix=${_VCPKG_PREFIX}") | ||
| set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} "--prefix=${_VCPKG_PREFIX}/debug") | ||
| if(NOT _csc_NO_ADDITIONAL_PATHS) | ||
| # ${prefix} has an extra backslash to prevent early expansion when calling `bash -c configure "..."`. | ||
| set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} | ||
| # Important: These should all be relative to prefix! | ||
| "--bindir=${prefix_var}/tools/${PORT}/bin" | ||
| "--sbindir=${prefix_var}/tools/${PORT}/sbin" | ||
| "--libdir=${prefix_var}/lib" # On some Linux distributions lib64 is the default | ||
| "--bindir=\\\${prefix}/tools/${PORT}/bin" | ||
| "--sbindir=\\\${prefix}/tools/${PORT}/sbin" | ||
| "--libdir=\\\${prefix}/lib" # On some Linux distributions lib64 is the default | ||
| #"--includedir='\${prefix}'/include" # already the default! | ||
| "--mandir=${prefix_var}/share/${PORT}" | ||
| "--docdir=${prefix_var}/share/${PORT}" | ||
| "--datarootdir=${prefix_var}/share/${PORT}") | ||
| "--mandir=\\\${prefix}/share/${PORT}" | ||
| "--docdir=\\\${prefix}/share/${PORT}" | ||
| "--datarootdir=\\\${prefix}/share/${PORT}") | ||
| set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} | ||
| # Important: These should all be relative to prefix! | ||
| "--bindir=${prefix_var}/../tools/${PORT}/debug/bin" | ||
| "--sbindir=${prefix_var}/../tools/${PORT}/debug/sbin" | ||
| "--libdir=${prefix_var}/lib" # On some Linux distributions lib64 is the default | ||
| "--includedir=${prefix_var}/../include" | ||
| "--datarootdir=${prefix_var}/share/${PORT}") | ||
| "--bindir=\\\${prefix}/../tools/${PORT}/debug/bin" | ||
| "--sbindir=\\\${prefix}/../tools/${PORT}/debug/sbin" | ||
| "--libdir=\\\${prefix}/lib" # On some Linux distributions lib64 is the default | ||
| "--includedir=\\\${prefix}/../include" | ||
| "--datarootdir=\\\${prefix}/share/${PORT}") | ||
| endif() | ||
| # Setup common options | ||
| if(NOT DISABLE_VERBOSE_FLAGS) | ||
|
|
@@ -534,18 +534,13 @@ function(vcpkg_configure_make) | |
| else() | ||
| find_program(base_cmd bash REQUIRED) | ||
| endif() | ||
| if(VCPKG_TARGET_IS_WINDOWS) | ||
| list(JOIN _csc_OPTIONS " " _csc_OPTIONS) | ||
| list(JOIN _csc_OPTIONS_RELEASE " " _csc_OPTIONS_RELEASE) | ||
| list(JOIN _csc_OPTIONS_DEBUG " " _csc_OPTIONS_DEBUG) | ||
| endif() | ||
|
|
||
| # Setup include environment (since these are buildtype independent restoring them is unnecessary) | ||
| macro(prepend_include_path var) | ||
| if("${${var}_BACKUP}" STREQUAL "") | ||
| set(ENV{${var}} "${_VCPKG_INSTALLED}/include") | ||
| set(ENV{${var}} "${CURRENT_INSTALLED_DIR}/include") | ||
| else() | ||
| set(ENV{${var}} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${${var}_BACKUP}") | ||
| set(ENV{${var}} "${CURRENT_INSTALLED_DIR}/include${VCPKG_HOST_PATH_SEPARATOR}${${var}_BACKUP}") | ||
| endif() | ||
| endmacro() | ||
| # Used by CL | ||
|
|
@@ -693,10 +688,10 @@ function(vcpkg_configure_make) | |
| endif() | ||
| else() | ||
| set(_link_dirs) | ||
| if(EXISTS "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib") | ||
| if(EXISTS "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib") | ||
| set(_link_dirs "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib") | ||
| endif() | ||
| if(EXISTS "{_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link") | ||
| if(EXISTS "{CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link") | ||
| set(_link_dirs "${_link_dirs} -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link") | ||
| endif() | ||
| string(STRIP "${_link_dirs}" _link_dirs) | ||
|
|
@@ -726,10 +721,10 @@ function(vcpkg_configure_make) | |
| endif() | ||
| else() | ||
| set(_link_dirs) | ||
| if(EXISTS "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib") | ||
| if(EXISTS "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib") | ||
| set(_link_dirs "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib") | ||
| endif() | ||
| if(EXISTS "{_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link") | ||
| if(EXISTS "{CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link") | ||
| set(_link_dirs "${_link_dirs} -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link") | ||
| endif() | ||
| string(STRIP "${_link_dirs}" _link_dirs) | ||
|
|
@@ -738,6 +733,15 @@ function(vcpkg_configure_make) | |
| unset(_VAR_SUFFIX) | ||
| endif() | ||
|
|
||
| foreach(var IN ITEMS _csc_OPTIONS _csc_OPTIONS_RELEASE _csc_OPTIONS_DEBUG) | ||
| vcpkg_list(SET tmp) | ||
| foreach(element IN LISTS "${var}") | ||
| string(REPLACE [["]] [[\"]] element "${element}") | ||
| vcpkg_list(APPEND tmp "\"${element}\"") | ||
| endforeach() | ||
| vcpkg_list(JOIN tmp " " "${var}") | ||
| endforeach() | ||
|
Comment on lines
+736
to
+743
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thoese codes are not used, can you please double confirm that?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is used. Verified by CI. Verified once more manually by instrumenting the code and building libtasn1. |
||
|
|
||
| foreach(_buildtype IN LISTS _buildtypes) | ||
| foreach(ENV_VAR ${_csc_CONFIG_DEPENDENT_ENVIRONMENT}) | ||
| if(DEFINED ENV{${ENV_VAR}}) | ||
|
|
@@ -788,27 +792,21 @@ function(vcpkg_configure_make) | |
| set(_lib_env_vars LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) | ||
| foreach(_lib_env_var IN LISTS _lib_env_vars) | ||
| set(_link_path) | ||
| if(EXISTS "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib") | ||
| set(_link_path "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib") | ||
| if(EXISTS "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_buildtype}}/lib") | ||
| set(_link_path "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_buildtype}}/lib") | ||
| endif() | ||
| if(EXISTS "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link") | ||
| if(EXISTS "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_buildtype}}/lib/manual-link") | ||
| if(_link_path) | ||
| set(_link_path "${_link_path}${VCPKG_HOST_PATH_SEPARATOR}") | ||
| endif() | ||
| set(_link_path "${_link_path}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link") | ||
| set(_link_path "${_link_path}${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_buildtype}}/lib/manual-link") | ||
| endif() | ||
| set(ENV{${_lib_env_var}} "${_link_path}${${_lib_env_var}_PATHLIKE_CONCAT}") | ||
| endforeach() | ||
| unset(_link_path) | ||
| unset(_lib_env_vars) | ||
|
|
||
| if(CMAKE_HOST_WIN32) | ||
| set(command "${base_cmd}" -c "${CONFIGURE_ENV} ./${RELATIVE_BUILD_PATH}/configure ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}") | ||
| elseif(VCPKG_TARGET_IS_WINDOWS) | ||
| set(command "${base_cmd}" -c "${CONFIGURE_ENV} $@" -- "./${RELATIVE_BUILD_PATH}/configure" ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}) | ||
| else() | ||
| set(command "${base_cmd}" "./${RELATIVE_BUILD_PATH}/configure" ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}) | ||
| endif() | ||
| set(command "${base_cmd}" -c "${CONFIGURE_ENV} ./${RELATIVE_BUILD_PATH}/configure ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}") | ||
|
|
||
| if(_csc_ADD_BIN_TO_PATH) | ||
| set(PATH_BACKUP $ENV{PATH}) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.