mirror of
https://github.com/ptitSeb/box64.git
synced 2025-02-18 13:29:44 +00:00
Use CMAKE_SYSTEM_PROCESSOR instead of CMAKE_HOST_SYSTEM_PROCESSOR
The former is exactly the same as the latter if compiling natively, which is the output of `uname -m`. But this is the wrong architecture when cross compiling where we do not want the architecture we are compiling on (the build architecture in GNU terminology) but the architecture we are compiling for (the host architecture in GNU terminology). The CMAKE_SYSTEM_PROCESSOR variable is set to the correct host architecture value when cross compiling. With this change, it is possible to cross compile a arm64 executable of box64 on an amd64 machine. Without this change, the "install" target will be omitted, because CMakeLists.txt wrongly uses the build architecture to decide whether the install target should be added or not. Instead it should use the host architecture.
This commit is contained in:
parent
50032affcf
commit
dafa5014a4
@ -746,10 +746,10 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
string(COMPARE EQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}" "i686" _x86)
|
||||
string(COMPARE EQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}" "x86_64" _x86_64)
|
||||
string(COMPARE EQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}" "aarch64" _aarch64)
|
||||
string(COMPARE EQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}" "riscv64" _riscv64)
|
||||
string(COMPARE EQUAL "${CMAKE_SYSTEM_PROCESSOR}" "i686" _x86)
|
||||
string(COMPARE EQUAL "${CMAKE_SYSTEM_PROCESSOR}" "x86_64" _x86_64)
|
||||
string(COMPARE EQUAL "${CMAKE_SYSTEM_PROCESSOR}" "aarch64" _aarch64)
|
||||
string(COMPARE EQUAL "${CMAKE_SYSTEM_PROCESSOR}" "riscv64" _riscv64)
|
||||
|
||||
if(_x86_64 OR _aarch64)
|
||||
add_definitions(-DCONFIG_64BIT)
|
||||
|
Loading…
x
Reference in New Issue
Block a user