Skip to content

Conversation

@EduMenges
Copy link
Contributor

As stated on CMake's documentation:

This variable will be set to true by CMake if the CMAKE_SYSTEM_NAME variable has been set manually (i.e. in a toolchain file or as a cache entry from the cmake command line).

This is problematic when building on a mac for a mac because CMAKE_CROSSCOMPILING will be enabled, causing wonky behavior when building projects that relies on this variable, such as gRPC.

By firstly assigning the CMAKE_SYSTEM_NAME to a variable and checking it against CMAKE_HOST_SYSTEM_NAME, we prevent this behavior and CMAKE_CROSSCOMPILING will only be set when it is actually necessary.

@EduMenges
Copy link
Contributor Author

There is an issue I've noticed tho, when compiling for a different architecture. CMAKE_SYSTEM_NAME wouldn't get replaced when an x86_64 mac is trying to compile for an aarch64 mac, which wouldn't turn CMAKE_CROSSCOMPILING on (I think?).
I could add an extra check, but it seems more of a workaround than a definite solution.

@leetal
Copy link
Owner

leetal commented Jul 18, 2024

Please rebase your changes on the latest origin/master. I'd completely missed the deprecation of the macos-11 runner that many of the tests were relying on :/ Sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants