Skip to content

Commit 4e4e17f

Browse files
committed
fix: support macOS compile
Signed-off-by: weedge <weege007@gmail.com>
1 parent d213140 commit 4e4e17f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,14 @@ FILE(GLOB_RECURSE SRCS
66
)
77
add_library(${TARGET} SHARED ${SRCS} ${USRC})
88

9+
# OS X 11.x doesn't have /usr/lib/libSystem.dylib and needs an explicit setting.
10+
if ( APPLE AND NOT EXISTS /usr/lib/libSystem.dylib)
11+
message(STATUS "apple...")
12+
set(CMAKE_C_COMPILER /usr/bin/clang)
13+
target_link_libraries(${TARGET} -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib)
14+
target_link_libraries(${TARGET} -lsystem)
15+
endif()
16+
17+
918
set_target_properties(${TARGET} PROPERTIES SUFFIX ".so")
1019
set_target_properties(${TARGET} PROPERTIES PREFIX "")

0 commit comments

Comments
 (0)