diff options
author | Ivan Davydov <lotigara@lotigara.ru> | 2025-06-12 16:44:02 +0300 |
---|---|---|
committer | Ivan Davydov <lotigara@lotigara.ru> | 2025-06-12 16:44:02 +0300 |
commit | e76fc1d705fea18ad58c57241523dd8d2a72395f (patch) | |
tree | 7eea5bc4970eebc8458ea74cbce78689218a73e5 /cmake/TargetArch.cmake | |
parent | be6dd79a74061614060d78c2d55d90252403baed (diff) |
Try to fix the 'linux unknown' text in the pause menumain
Diffstat (limited to 'cmake/TargetArch.cmake')
-rw-r--r-- | cmake/TargetArch.cmake | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cmake/TargetArch.cmake b/cmake/TargetArch.cmake index 2e204fd..77e9ebb 100644 --- a/cmake/TargetArch.cmake +++ b/cmake/TargetArch.cmake @@ -65,6 +65,27 @@ function(target_architecture output_var) if(osx_arch_arm64) list(APPEND ARCH arm64) endif() + elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_LINUX_ARCHITECTURES) + # On Linux, we use CMAKE_LINUX_ARCHITECTURES *if* it was set + + # Linux supports many architectures, but mostly used are x86_64 and arm64. + foreach(linux_arch ${CMAKE_LINUX_ARCHITECTURES}) + if("${linux_arch}" STREQUAL "x86_64") + set(linux_arch_x86_64 TRUE) + elseif("${linux_arch}" STREQUAL "arm64") + set(linux_arch_arm64 TRUE) + else() + message(FATAL_ERROR "Invalid Linux arch name: ${linux_arch}") + endif() + endforeach() + + if(linux_arch_x86_64) + list(APPEND ARCH x86_64) + endif() + + if(linux_arch_arm64) + list(APPEND ARCH arm64) + endif() else() file(WRITE "${CMAKE_BINARY_DIR}/arch.c" "${archdetect_c_code}") @@ -85,6 +106,7 @@ function(target_architecture output_var) "${CMAKE_BINARY_DIR}/arch.c" COMPILE_OUTPUT_VARIABLE ARCH CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} + CMAKE_FLAGS CMAKE_LINUX_ARCHITECTURES=${CMAKE_LINUX_ARCHITECTURES} ) # Parse the architecture name from the compiler output |