Skip to content

Conversation

@novas0x2a
Copy link
Collaborator

cmake requires setting CMAKE_SYSTEM_NAME to detect a cross-compile of any form (including same-os but different-processor). This means that, if an OS is not listed under _TARGET_OS_PARAMS, cross-compilation can never work on that platform; it would have silently done a native compile.

This change makes it emit a warning in this case, and adds macos to the list so xcompiles work on macos.

cmake requires setting CMAKE_SYSTEM_NAME to detect a cross-compile of
any form (including same-os but different-processor). This means that,
if an OS is not listed under _TARGET_OS_PARAMS, cross-compilation can
never work on that platform; it would have silently done a native
compile.

This change makes it emit a warning in this case, and adds macos to the
list so xcompiles work on macos.
Comment on lines +135 to +136
# buildifier: disable=print
print("target_os", target_os, "is not in _TARGET_OS_PARAMS, please update foreign_cc/private/cmake_script.bzl; triggered by", current_label)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason not to actually fail() here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, I just did it this way for parity with the checks above, but I can make it fail if you'd prefer that

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants