-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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/scripts] Add a way to get cmake compiler settings/flags #12936
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMake does not set these flags. I just took them from a default UWP VS project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
@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