Skip to content

Commit

Permalink
fix: support macOS compile
Browse files Browse the repository at this point in the history
Signed-off-by: weedge <weege007@gmail.com>
  • Loading branch information
weedge committed Aug 7, 2023
1 parent d213140 commit 4e4e17f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,14 @@ FILE(GLOB_RECURSE SRCS
)
add_library(${TARGET} SHARED ${SRCS} ${USRC})

# OS X 11.x doesn't have /usr/lib/libSystem.dylib and needs an explicit setting.
if ( APPLE AND NOT EXISTS /usr/lib/libSystem.dylib)
message(STATUS "apple...")
set(CMAKE_C_COMPILER /usr/bin/clang)
target_link_libraries(${TARGET} -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib)
target_link_libraries(${TARGET} -lsystem)
endif()


set_target_properties(${TARGET} PROPERTIES SUFFIX ".so")
set_target_properties(${TARGET} PROPERTIES PREFIX "")

0 comments on commit 4e4e17f

Please sign in to comment.