Skip to content

Commit 9998ebf

Browse files
committed
cmake: fix native build on arm
uname -m on 32bit Arm platforms (little endian) report a machine string like armv5tejl, armv7l or armv8l. A native build on these machines fail: CMake Error at lib/processor/CMakeLists.txt:1 (add_subdirectory): add_subdirectory given source "armv8l" which is not an existing directory. Set PROJECT_PROCESSOR to arm on these machines. Signed-off-by: Benedikt Spranger <[email protected]>
1 parent ddd72ec commit 9998ebf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmake/options.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ string (TOLOWER ${CMAKE_SYSTEM_PROCESSOR} PROJECT_PROCESSOR)
4949
if("${PROJECT_PROCESSOR}" STREQUAL "arm64")
5050
set (PROJECT_PROCESSOR "aarch64")
5151
endif()
52+
53+
if("${PROJECT_PROCESSOR}" MATCH "armv[4-8].*l")
54+
set (PROJECT_PROCESSOR "arm")
55+
endif()
56+
5257
string (TOUPPER ${PROJECT_PROCESSOR} PROJECT_PROCESSOR_UPPER)
5358
string (TOLOWER ${MACHINE} PROJECT_MACHINE)
5459
string (TOUPPER ${MACHINE} PROJECT_MACHINE_UPPER)

0 commit comments

Comments
 (0)