File tree 3 files changed +7
-9
lines changed
3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -93,10 +93,6 @@ macro(add_cpp2py_module)
93
93
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
94
94
)
95
95
96
- if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
97
- target_link_libraries (${module_name} "-undefined dynamic_lookup" )
98
- endif ()
99
-
100
96
# Keep a list of every module target.
101
97
# Usage : e.g. Documentation top target depends on them being built first
102
98
set_property (GLOBAL APPEND PROPERTY CPP2PY_MODULES_LIST ${module_name} )
Original file line number Diff line number Diff line change @@ -134,7 +134,13 @@ ENDFUNCTION(EXEC_PYTHON_SCRIPT)
134
134
135
135
# Define python_and_numpy interface target
136
136
add_library (python_and_numpy INTERFACE )
137
- target_link_libraries (python_and_numpy INTERFACE ${PYTHON_LIBRARY} "${PYTHON_EXTRA_LIBS} " )
137
+ if (CMAKE_SYSTEM_NAME MATCHES "Darwin" )
138
+ # On OSX missing python symbols should be resolved at runtime through '-undefined dynamic_lookup'
139
+ # as the interperter shipped with e.g. anaconda provides all relevant symbols statically
140
+ target_link_libraries (python_and_numpy INTERFACE "-undefined dynamic_lookup" "${PYTHON_EXTRA_LIBS} " )
141
+ else ()
142
+ target_link_libraries (python_and_numpy INTERFACE ${PYTHON_LIBRARY} "${PYTHON_EXTRA_LIBS} " )
143
+ endif ()
138
144
target_include_directories (python_and_numpy SYSTEM INTERFACE ${PYTHON_INCLUDE_DIRS} ${PYTHON_NUMPY_INCLUDE_DIR} )
139
145
target_compile_options (python_and_numpy INTERFACE -Wno-register) # Some version of Python.h still use register
140
146
Original file line number Diff line number Diff line change @@ -56,10 +56,6 @@ macro(add_cpp2py_module)
56
56
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
57
57
)
58
58
59
- if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
60
- target_link_libraries (${module_name} "-undefined dynamic_lookup" )
61
- endif ()
62
-
63
59
# Keep a list of every module target.
64
60
# Usage : e.g. Documentation top target depends on them being built first
65
61
set_property (GLOBAL APPEND PROPERTY CPP2PY_MODULES_LIST ${module_name} )
You can’t perform that action at this time.
0 commit comments