Skip to content
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

cmake: treat building for another ISA as a cross-compile. #1353

Conversation

guyharris
Copy link
Member

CMake appears to have the notion that a build is only a cross-compile if the targt operating system is different. This is an incorrect notion, as even if the target is the same OS but a different instruction set, you may not be able to do tests that involve compiling and running a program.

Check whether CMAKE_GENERATOR_PLATFORM is set and has a value different from that of CMAKE_HOST_SYSTEM_PROCESSOR and, if that's the case, set CMAKE_CROSSCOMPILING to TRUE.

This should fix issue #1352.

(A different strategy may be necessary for cross-builds with UNIX toolchains.)

CMake appears to have the notion that a build is only a cross-compile if
the targt *operating system* is different.  This is an incorrect notion,
as even if the target is the *same* OS but a different instruction set,
you may not be able to do tests that involve compiling and running a
program.

Check whether CMAKE_GENERATOR_PLATFORM is set and has a value different
from that of CMAKE_HOST_SYSTEM_PROCESSOR and, if that's the case, set
CMAKE_CROSSCOMPILING to TRUE.

This should fix issue the-tcpdump-group#1352.

(A different strategy may be necessary for cross-builds with UNIX
toolchains.)
@guyharris guyharris merged commit 1341c38 into the-tcpdump-group:master Sep 19, 2024
19 checks passed
@guyharris guyharris deleted the other-isa-same-os-is-a-crosscompile branch September 19, 2024 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant