Skip to content

Commit fd2e0e6

Browse files
authored
Add support for clangarm64 (#2228)
1 parent 94847a9 commit fd2e0e6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,18 @@ else()
169169
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine
170170
OUTPUT_VARIABLE UC_COMPILER_VERSION)
171171

172-
string(FIND "${UC_COMPILER_VERSION}" "i686" UC_RET)
173-
if(${UC_RET} GREATER_EQUAL "0")
172+
if(UC_COMPILER_VERSION MATCHES "^i686.*")
174173
set(UNICORN_TARGET_ARCH "i386")
175174
set(UNICORN_CFLAGS -m32 -static-libgcc) # Workaround for github action bugs
176175
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
177176
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
178-
else()
177+
elseif(UC_COMPILER_VERSION MATCHES "^x86_64.*")
179178
set(UNICORN_TARGET_ARCH "i386")
180179
set(UNICORN_CFLAGS -m64 -mcx16)
181180
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m64")
182181
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m64")
182+
elseif(UC_COMPILER_VERSION MATCHES "^aarch64.*")
183+
set(UNICORN_TARGET_ARCH "aarch64")
183184
endif()
184185
elseif(ANDROID_ABI)
185186
string(FIND "${ANDROID_ABI}" "arm64" UC_RET)

0 commit comments

Comments
 (0)