aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJesse Towner <jwtowner@users.noreply.github.com>2021-02-20 21:29:35 -0800
committerGitHub <noreply@github.com>2021-02-20 21:29:35 -0800
commita037d826492039db9d58af47a1e1248037d15f40 (patch)
treece9c93590792548a2c306ddf60eea06b166bf5a1 /scripts
parent77c6c342230b682dac2395fe2a67278f19801fd2 (diff)
downloadvcpkg-a037d826492039db9d58af47a1e1248037d15f40.tar.gz
vcpkg-a037d826492039db9d58af47a1e1248037d15f40.zip
[vcpkg] vcpkg_configure_meson: cross-compile fixes for Android (#16260)
* [vcpkg] vcpkg_configure_meson: cross-compile fixes This change includes two fixes to the meson cross-compile config. The first change fixes the regex used to partition linker flag options so that it supports double-hyphen prefixes. The second change ensures that the cross file is always generated when the target platform is either Android or iOS, even if the host and target CPU architectures are the same. * Use helper function instead of regex replace Use vcpkg_internal_meson_convert_compiler_flags_to_list to partition compiler flags into a list, instead of string(REGEX REPLACE ...).
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cmake/vcpkg_configure_meson.cmake8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/cmake/vcpkg_configure_meson.cmake b/scripts/cmake/vcpkg_configure_meson.cmake
index 194c0709d..0616d68ac 100644
--- a/scripts/cmake/vcpkg_configure_meson.cmake
+++ b/scripts/cmake/vcpkg_configure_meson.cmake
@@ -128,7 +128,7 @@ function(vcpkg_internal_meson_generate_native_file_config _config) #https://meso
else()
set(LINKER_FLAGS_${_config} "${VCPKG_DETECTED_CMAKE_STATIC_LINKER_FLAGS_${_config}}")
endif()
- string(REGEX REPLACE "( |^)(-|/)" ";\\2" LINKER_FLAGS_${_config} "${LINKER_FLAGS_${_config}}")
+ vcpkg_internal_meson_convert_compiler_flags_to_list(LINKER_FLAGS_${_config} "${LINKER_FLAGS_${_config}}")
list(TRANSFORM LINKER_FLAGS_${_config} APPEND "'")
list(TRANSFORM LINKER_FLAGS_${_config} PREPEND "'")
list(APPEND LINKER_FLAGS_${_config} "${LIBPATH_${_config}}")
@@ -277,8 +277,8 @@ function(vcpkg_internal_meson_generate_cross_file _additional_binaries) #https:/
endif()
string(APPEND CROSS "cpu_family = '${BUILD_CPU_FAM}'\n")
string(APPEND CROSS "cpu = '${BUILD_CPU}'\n")
-
- if(NOT BUILD_CPU_FAM STREQUAL HOST_CPU_FAM)
+
+ if(NOT BUILD_CPU_FAM STREQUAL HOST_CPU_FAM OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_IOS)
set(_file "${CURRENT_BUILDTREES_DIR}/meson-cross-${TARGET_TRIPLET}.log")
set(VCPKG_MESON_CROSS_FILE "${_file}" PARENT_SCOPE)
file(WRITE "${_file}" "${CROSS}")
@@ -316,7 +316,7 @@ function(vcpkg_internal_meson_generate_cross_file_config _config) #https://meson
else()
set(LINKER_FLAGS_${_config} "${VCPKG_DETECTED_CMAKE_STATIC_LINKER_FLAGS_${_config}}")
endif()
- string(REGEX REPLACE "( |^)(-|/)" ";\\2" LINKER_FLAGS_${_config} "${LINKER_FLAGS_${_config}}")
+ vcpkg_internal_meson_convert_compiler_flags_to_list(LINKER_FLAGS_${_config} "${LINKER_FLAGS_${_config}}")
list(TRANSFORM LINKER_FLAGS_${_config} APPEND "'")
list(TRANSFORM LINKER_FLAGS_${_config} PREPEND "'")
list(APPEND LINKER_FLAGS_${_config} "${LIBPATH_${_config}}")