Skip to content

Commit

Permalink
Add -latomic to samples and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdcode committed Dec 28, 2023
1 parent f389666 commit db0acd5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,13 @@ else()
string(FIND "${UC_COMPILER_MACRO}" "__mips__" UC_RET)
if(${UC_RET} GREATER_EQUAL "0")
set(UNICORN_TARGET_ARCH "mips")
set(UNICORN_CFLAGS ${UNICORN_CFLAGS} -latomic)
break()
endif()
string(FIND "${UC_COMPILER_MACRO}" "__sparc__" UC_RET)
if(${UC_RET} GREATER_EQUAL "0")
set(UNICORN_TARGET_ARCH "sparc")
set(UNICORN_CFLAGS ${UNICORN_CFLAGS} -latomic)
break()
endif()
string(FIND "${UC_COMPILER_MACRO}" "__ia64__" UC_RET)
Expand All @@ -217,6 +219,7 @@ else()
string(FIND "${UC_COMPILER_MACRO}" "_ARCH_PPC" UC_RET)
if(${UC_RET} GREATER_EQUAL "0")
set(UNICORN_TARGET_ARCH "ppc")
set(UNICORN_CFLAGS ${UNICORN_CFLAGS} -latomic)
break()
endif()
string(FIND "${UC_COMPILER_MACRO}" "__riscv" UC_RET)
Expand All @@ -228,6 +231,7 @@ else()
string(FIND "${UC_COMPILER_MACRO}" "__s390__" UC_RET)
if(${UC_RET} GREATER_EQUAL "0")
set(UNICORN_TARGET_ARCH "s390")
set(UNICORN_CFLAGS ${UNICORN_CFLAGS} -latomic)
break()
endif()
string(FIND ${UC_COMPILER_MACRO} "__tricore__" UC_RET)
Expand Down Expand Up @@ -1194,6 +1198,7 @@ if(BUILD_SHARED_LIBS)
endif()

set(UNICORN_LINK_LIBRARIES ${UNICORN_LINK_LIBRARIES} unicorn-common)
set(UNICORN_COMPILE_OPTIONS ${UNICORN_COMPILE_OPTIONS} ${UNICORN_CFLAGS})
if(UNICORN_HAS_X86)
set(UNICORN_COMPILE_OPTIONS ${UNICORN_COMPILE_OPTIONS} -DUNICORN_HAS_X86)
set(UNICORN_LINK_LIBRARIES ${UNICORN_LINK_LIBRARIES} x86_64-softmmu)
Expand Down

0 comments on commit db0acd5

Please sign in to comment.