Skip to content

Commit

Permalink
[cmake] Xcode 14 warns about -undefined dynamic_lookup; simply supp…
Browse files Browse the repository at this point in the history
…ress:

"suppress" ignores any unresolved symbol. This requires flat_namespace,
see man ld.
  • Loading branch information
Axel-Naumann committed Nov 11, 2022
1 parent b3d624f commit a05d4be
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bindings/jupyroot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ foreach(val RANGE ${how_many_pythons})
set_target_properties(${libname} PROPERTIES SUFFIX ".pyd")
target_link_libraries(${libname} PUBLIC Core ${python_library})
elseif(APPLE)
target_link_libraries(${libname} PUBLIC -Wl,-bind_at_load -Wl,-undefined -Wl,dynamic_lookup Core)
target_link_libraries(${libname} PUBLIC -Wl,-bind_at_load -Wl,-flat_namespace -Wl,-undefined -Wl,suppress Core)
else()
target_link_libraries(${libname} PUBLIC -Wl,--unresolved-symbols=ignore-all Core)
endif()
Expand Down
2 changes: 1 addition & 1 deletion bindings/pyroot/cppyy/CPyCppyy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ foreach(val RANGE ${how_many_pythons})
set_target_properties(${libname} PROPERTIES PREFIX "lib")
set_target_properties(${libname} PROPERTIES SUFFIX ".pyd")
elseif(APPLE)
target_link_libraries(${libname} PUBLIC -Wl,-bind_at_load -Wl,-undefined -Wl,dynamic_lookup cppyy_backend${python_under_version_string})
target_link_libraries(${libname} PUBLIC -Wl,-bind_at_load -Wl,-flat_namespace -Wl,-undefined -Wl,suppress cppyy_backend${python_under_version_string})
else()
target_link_libraries(${libname} PUBLIC -Wl,--unresolved-symbols=ignore-all cppyy_backend${python_under_version_string})
endif()
Expand Down
2 changes: 1 addition & 1 deletion bindings/pyroot/pythonizations/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ foreach(val RANGE ${how_many_pythons})
set_target_properties(${libname} PROPERTIES SUFFIX ".pyd")
target_link_libraries(${libname} PUBLIC Core Tree cppyy${python_under_version_string})
elseif(APPLE)
target_link_libraries(${libname} PUBLIC -Wl,-bind_at_load -Wl,-undefined -Wl,dynamic_lookup Core Tree cppyy${python_under_version_string})
target_link_libraries(${libname} PUBLIC -Wl,-bind_at_load -Wl,-flat_namespace -Wl,-undefined -Wl,suppress Core Tree cppyy${python_under_version_string})
else()
target_link_libraries(${libname} PUBLIC -Wl,--unresolved-symbols=ignore-all Core Tree cppyy${python_under_version_string})
endif()
Expand Down
2 changes: 1 addition & 1 deletion core/metacling/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ if(MSVC)
endif()

if(APPLE)
target_link_libraries(Cling PUBLIC -Wl,-bind_at_load -Wl,-undefined -Wl,dynamic_lookup)
target_link_libraries(Cling PUBLIC -Wl,-bind_at_load -Wl,-flat_namespace -Wl,-undefined -Wl,suppress)
elseif(NOT MSVC)
target_link_libraries(Cling PUBLIC -Wl,--unresolved-symbols=ignore-in-object-files)
endif()
2 changes: 1 addition & 1 deletion interpreter/cling/tools/plugins/example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ endif()

set_target_properties(clingDemoPlugin PROPERTIES LIBRARY_OUTPUT_DIRECTORY ".")
if(APPLE)
target_link_libraries(clingDemoPlugin PUBLIC -Wl,-bind_at_load -Wl,-undefined -Wl,dynamic_lookup)
target_link_libraries(clingDemoPlugin PUBLIC -Wl,-bind_at_load -Wl,-flat_namespace -Wl,-undefined -Wl,suppress)
elseif(NOT MSVC)
target_link_libraries(clingDemoPlugin PUBLIC -Wl,--unresolved-symbols=ignore-in-object-files)
endif()
Expand Down
2 changes: 1 addition & 1 deletion montecarlo/pythia6/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if(pythia6_nolink)
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
string(REGEX REPLACE "-Wl,--no-undefined" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flat_namespace -undefined suppress")
endif()
else()
if(MSVC)
Expand Down

0 comments on commit a05d4be

Please sign in to comment.