[vcpkg/scripts] Add a way to get cmake compiler settings/flags#12936
[vcpkg/scripts] Add a way to get cmake compiler settings/flags#12936strega-nil merged 46 commits intomicrosoft:masterfrom
Conversation
| set(ENV{_CL_} "$ENV{_CL_} /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB_ -FU\"${VCToolsInstallDir}/lib/x86/store/references/platform.winmd\"") | ||
| set(ENV{_LINK_} "$ENV{_LINK_} /MANIFEST /DYNAMICBASE WindowsApp.lib /WINMD:NO /APPCONTAINER") | ||
| endif() | ||
| if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) | ||
| set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:x64") | ||
| elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) | ||
| set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:x86") | ||
| elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm) | ||
| set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:ARM") | ||
| elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64) | ||
| set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:ARM64") | ||
| set(ENV{_LINK_} "$ENV{_LINK_} /MANIFEST /DYNAMICBASE /WINMD:NO /APPCONTAINER") |
There was a problem hiding this comment.
CMake does not set these flags. I just took them from a default UWP VS project.
strega-nil
left a comment
There was a problem hiding this comment.
Just some minor copy changes :)
|
|
… into add_get_cmake_vars
# Conflicts: # scripts/cmake/vcpkg_build_make.cmake # scripts/cmake/vcpkg_configure_make.cmake
Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
|
@ras0219: about spaces. I literally tried hours to make it work. Even if you get it to through configure for some ports it is very likely that other ports requiring an external tool/script is not handling spaces in paths correctly and the build fails (even using vcpkg/scripts/cmake/vcpkg_configure_make.cmake Lines 218 to 221 in 70f380e Furthermore there are currently not that many make based ports for windows so testing is a bit difficult due to a high probability that the port is also using Since the compiler flags will always be a plain string and no list in cmake it is not required to change the script for meson since the flags need to be rearranged into a python list anyway which could be done in |
… into add_get_cmake_vars
# Conflicts: # scripts/cmake/vcpkg_build_make.cmake # scripts/cmake/vcpkg_common_functions.cmake # scripts/cmake/vcpkg_configure_make.cmake
|
@ras0219 The problem is setting LDFLAGS. If the So how should I proceed with this PR? |
|
Done? |
|
@JackBoosY: Theoretically yes. There is nothing I can do to make spaces in paths work since after the last change configure is successful but the install step fails on paths with spaces. |
|
@strega-nil Ping for review this PR again and merge it. |
Testing the extraction of compiler settings from cmake