Files
cpp-build-system/cmake/arch.cmake
Scott E. Graves 92e3e495ce
Some checks failed
sgraves/cpp-build-system_mac/pipeline/head There was a failure building this commit
sgraves/cpp-build-system/pipeline/head There was a failure building this commit
initial commit
2025-10-17 07:44:16 -05:00

17 lines
508 B
CMake

if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
message(FATAL_ERROR "32-bit compilation is not supported")
endif()
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)")
set(IS_ARM_SYSTEM 1)
endif()
if(PROJECT_IS_ARM64 AND NOT IS_ARM_SYSTEM AND NOT PROJECT_REQUIRE_ALPINE)
message(FATAL_ERROR "aarch64 cross-compile is not supported")
endif()
string(REPLACE "_" "-" PROJECT_MARCH ${PROJECT_BUILD_ARCH})
if("${PROJECT_BUILD_ARCH}" STREQUAL "aarch64")
set(PROJECT_MARCH armv8-a)
endif()