[CMAKE] Check CMAKE_SYSTEM_PROCESSOR after project() (#1008)
Some checks failed
Build and Release Box86 / build (ubuntu-20.04, TEGRAX1, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-20.04, TEGRAX1, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-20.04, TEGRAX1ARM32, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-20.04, TEGRAX1ARM32, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, A64, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, A64, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, ADLINK, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, ADLINK, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, ANDROID, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, ANDROID, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, GAMESHELL, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, GAMESHELL, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, I386, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, I386, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, ODROIDXU4, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, ODROIDXU4, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, OTHER_ARM, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, OTHER_ARM, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, PANDORA, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, PANDORA, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, PHYTIUM, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, PHYTIUM, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, PYRA, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, PYRA, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, RK3288, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, RK3288, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, RK3399, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, RK3399, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, RPI4, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, RPI4, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, RPI4ARM64, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, RPI4ARM64, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, SD845, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, SD845, Trace) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, SD888, Release) (push) Has been cancelled
Build and Release Box86 / build (ubuntu-latest, SD888, Trace) (push) Has been cancelled

This commit is contained in:
Mike Wang 2024-10-29 23:56:37 +08:00 committed by GitHub
parent a7855d3bcb
commit c993aacd04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,14 +76,8 @@ else()
endif()
cmake_host_system_information(RESULT CMAKE_HOST_SYSTEM_PROCESSOR QUERY OS_PLATFORM)
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}" "armhf" _armhf)
string(COMPARE EQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}" "arm" _arm)
string(COMPARE EQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}" "armv8l" _armv8l)
if(_aarch64 AND (RK3399 OR ODROIDN2 OR TEGRAX1 OR TEGRA_T194 OR TEGRA_T234 OR RPI3ARM64 OR RPI4ARM64 OR PHYTIUM OR SD845 OR SD888 OR ADLINK OR A64 OR LX2160A OR RK3588 OR ARM64))
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "aarch64" AND (RK3399 OR ODROIDN2 OR TEGRAX1 OR TEGRA_T194 OR TEGRA_T234 OR RPI3ARM64 OR RPI4ARM64 OR PHYTIUM OR SD845 OR SD888 OR ADLINK OR A64 OR LX2160A OR RK3588 OR ARM64))
set(COMPILER_TRIPLE arm-linux-gnueabihf-gcc)
find_program(COMPILER_FOUND ${COMPILER_TRIPLE})
@ -98,6 +92,13 @@ project(box86 C ASM)
enable_testing()
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}" "armhf" _armhf)
string(COMPARE EQUAL "${CMAKE_SYSTEM_PROCESSOR}" "arm" _arm)
string(COMPARE EQUAL "${CMAKE_SYSTEM_PROCESSOR}" "armv8l" _armv8l)
set(default_build_type "RelwithDebInfo")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")