Skip to content

Commit

Permalink
link to python on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
arahlin committed Nov 21, 2024
1 parent d1f19d6 commit 8d2dc44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ if(APPLE)
target_include_directories(spt3g INTERFACE ${Python_INCLUDE_DIRS})
target_link_libraries(spt3g INTERFACE ${Python_LIBRARIES})
endif()
# target_link_options(spt3g INTERFACE "LINKER:-undefined,dynamic_lookup")
target_link_options(spt3g INTERFACE "LINKER:-undefined,dynamic_lookup")
else()
if(TARGET Python::Module)
target_link_libraries(spt3g INTERFACE Python::Module)
Expand Down
5 changes: 4 additions & 1 deletion cmake/Spt3gIncludes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ endmacro(add_spt3g_library lib_name)

macro(add_spt3g_module lib_name)
set(mod_name "_lib${lib_name}")
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.17)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.17 AND NOT APPLE)
Python_add_library(${mod_name} MODULE WITH_SOABI ${ARGN})
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_link_options(${mod_name} PUBLIC "LINKER:--no-as-needed")
Expand All @@ -66,6 +66,9 @@ macro(add_spt3g_module lib_name)
endif()
target_include_directories(${mod_name} PRIVATE ${Python_INCLUDE_DIRS})
target_link_libraries(${mod_name} PUBLIC ${Python_LIBRARIES})
if(APPLE)
target_link_options(spt3g INTERFACE "LINKER:-undefined,dynamic_lookup")
endif()
endif()
target_link_libraries(${mod_name} PUBLIC ${lib_name})
set_target_properties(${mod_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${SPT3G_MODULE_DIR})
Expand Down

0 comments on commit 8d2dc44

Please sign in to comment.