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] Check CMAKE_SYSTEM_PROCESSOR after project() #1008

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

MikeWang000000
Copy link
Contributor

Architecture variables (_x86, _aarch64 ...) are set incorrectly while cross-compiling.
They should mark the architecture of cross-compiling target instead of current machine.

box86/CMakeLists.txt

Lines 857 to 868 in a7855d3

if(_aarch64 OR _armhf OR _arm OR _armv8l)
if(TERMUX)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm")
else()
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf")
endif()
elseif(_x86_64 OR _x86)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
else()
#probably wrong...
execute_process(COMMAND "dpkg --print-architecture" OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
endif()

Currently, box86-<version>_Linux-i386.deb is generated even if CMAKE_SYSTEM_PROCESSOR is set to armhf in CMAKE_TOOLCHAIN_FILE.

Copy link
Owner

@ptitSeb ptitSeb left a comment

Choose a reason for hiding this comment

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

There is a test to avoid the possibility of install on x86 / i686 that should still be done using host?

CMakeLists.txt Show resolved Hide resolved
@ptitSeb ptitSeb merged commit c993aac into ptitSeb:master Oct 29, 2024
36 checks passed
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