Skip to content

Commit 766e7f6

Browse files
committed
Fix executable linking
1 parent badcac8 commit 766e7f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmake/Spt3gIncludes.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ endmacro(add_spt3g_program prog_name)
2828

2929
macro(add_spt3g_executable prog_name)
3030
add_executable(${prog_name} ${ARGN})
31+
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
32+
# Assume Linux-style ld linker
33+
set_target_properties(${mod_name} PROPERTIES LINK_FLAGS "-Wl,--no-as-needed")
34+
endif()
3135
if(TARGET Python::Python)
3236
target_link_libraries(${prog_name} Python::Python)
3337
else()

0 commit comments

Comments
 (0)