Skip to content

Commit

Permalink
chore: update CMakeLists for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
heywhy committed Jun 15, 2024
1 parent 79980c4 commit b579d6d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ cmake_path(APPEND PRIV_PATH ${MIX_COMPILE_PATH} "../priv")
add_library(nif SHARED c_src/atomic_int.cpp)

target_include_directories(nif SYSTEM PUBLIC ${ERTS_INCLUDE_DIR})
target_link_options(nif PUBLIC -undefined dynamic_lookup)

if(APPLE)
target_link_options(nif PUBLIC -undefined dynamic_lookup -flat_namespace)
elseif(LINUX)
target_link_options(nif PUBLIC -z dynamic-undefined-weak)
endif()

add_custom_command(
TARGET nif POST_BUILD
Expand Down

0 comments on commit b579d6d

Please sign in to comment.