File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,11 @@ endmacro(add_spt3g_library lib_name)
5858macro (add_spt3g_module lib_name )
5959 set (mod_name "_lib${lib_name} " )
6060 pybind11_add_module (${mod_name} MODULE WITH_SOABI ${ARGN} )
61- if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
62- # Assume Linux-style ld linker
63- target_link_options (${mod_name} PUBLIC "LINKER:--no-as-needed" )
61+ # Assume Linux-style ld linker
62+ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.17)
63+ target_link_options (${prog_name} PUBLIC "LINKER:--no-as-needed" )
64+ else ()
65+ set_target_properties (${prog_name} PROPERTIES LINK_FLAGS "-Wl,--no-as-needed" )
6466 endif ()
6567 target_link_libraries (${mod_name} PUBLIC ${lib_name} )
6668 set_target_properties (${mod_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${SPT3G_MODULE_DIR} )
You can’t perform that action at this time.
0 commit comments