-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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] vcpkg_configure_make: Support macOS cross-compile #15659
Conversation
cc @Neumann-A for review this PR. |
we are running meson in |
An what happens if you add the settings to the compiler flags in the toolchain? Does CMake deduplicate the flags? |
@Neumann-A:
Testing So I've moved this compiler flags logic to EDIT: Note: There still seem to be additional issues preventing meson builds from properly building for the target arch, but I may not have time to dig into that for a while (and may be best left to a subsequent PR). As-is, this PR should now fix many ports that use |
I don't believe the single CI failure is related to this PR?
|
@NancyLi1013 @JackBoosY The |
gettext does have regression on master, but the reason is different from this:
|
The real error is:
|
@Neumann-A @JackBoosY I can reproduce this same exact error with a fresh checkout of latest A git bisect reveals that: Created a new Issue: #15737 |
Waiting for #15740. |
@JackBoosY Anything else needed to get this merged? It's now working well on CI (and in my tests). (I have some follow-up PRs that depend on this one to fix specific ports.) |
Should be good to me. |
@dan-shaw: Please let me know if you have any questions that I can answer before this can be merged. (With the recent conversion of the |
Co-authored-by: Billy O'Neal <[email protected]>
LGTM, ready to merge once CI is passing |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Regression will be fixed in #15933. |
Describe the pull request
Support macOS cross-compile in
vcpkg_configure_make
(ex. building anarm64-osx
triplet on an x86_64 Mac).Previously, ports like
gettext
that usevcpkg_configure_make
were building successfully, but for the native architecture regardless of the osx triplet used.So, for example, trying to build
gettext:arm64-osx
on a 64-bit Intel Mac would actually build anx86_64
architecture library.This sets the proper flags to ensure the libraries are built for the desired target architecture.
(i.e. Building
gettext:arm64-osx
on a 64-bit Intel Mac yields anarm64
architecture library.)This should impact cross-compiling osx triplet scenarios.
@Neumann-A:
I added all of this logic in
vcpkg_configure_make
because there are other consumers ofvcpkg_internal_get_cmake_vars
(likevcpkg_configure_meson
) that I haven't had time to look into yet.Theoretically,
-arch ${TARGET_ARCH} -isysroot ${VCPKG_DETECTED_CMAKE_OSX_SYSROOT}
could be added to CFLAGS / CXXFLAGS inget_cmake_vars
, but, for example, meson appears to use some sort of "cross file" that specifies architectures, so I'm unsure whether it should get this addition to CFLAGS / CXXFLAGS?