Skip to content

Commit

Permalink
Build Mac Python extensions with 2-level namespace
Browse files Browse the repository at this point in the history
The flat namespace is long deprecated and has caused issues
with IMP builds (salilab/imp#1062) so we're probably better
off using the 2-level namespace here.
  • Loading branch information
benmwebb committed Dec 14, 2023
1 parent a151cdd commit 5520c6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions swig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ENDIF()

set_property(TARGET "${SWIG_MODULE_RMF_REAL_NAME}" PROPERTY FOLDER "RMF")
if(APPLE)
set_target_properties("${SWIG_MODULE_RMF_REAL_NAME}" PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
set_target_properties("${SWIG_MODULE_RMF_REAL_NAME}" PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif(APPLE)
set_target_properties("${SWIG_MODULE_RMF_REAL_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")

Expand Down Expand Up @@ -76,7 +76,7 @@ ENDIF()

set_property(TARGET "${SWIG_MODULE_RMF_HDF5_REAL_NAME}" PROPERTY FOLDER "RMF")
if(APPLE)
set_target_properties("${SWIG_MODULE_RMF_HDF5_REAL_NAME}" PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
set_target_properties("${SWIG_MODULE_RMF_HDF5_REAL_NAME}" PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif(APPLE)
set_target_properties("${SWIG_MODULE_RMF_HDF5_REAL_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")

Expand All @@ -97,7 +97,7 @@ ENDIF(WIN32)
# Apple linkers complain by default if there are undefined symbols
IF(APPLE)
SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS
"${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -flat_namespace -undefined suppress")
"${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -undefined dynamic_lookup")
ENDIF(APPLE)

INSTALL(TARGETS ${SWIG_MODULE_RMF_HDF5_REAL_NAME} DESTINATION ${CMAKE_INSTALL_PYTHONDIR})
Expand Down

0 comments on commit 5520c6f

Please sign in to comment.