Skip to content

Commit 19c8f76

Browse files
committed
Fix example flags on mac
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
1 parent 3c6811b commit 19c8f76

4 files changed

Lines changed: 20 additions & 0 deletions

File tree

examples/05_cpp/1_cpp_node/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ find_library(CSP_LIBRARY NAMES _cspimpl.so PATHS "${CSP_LIB_DIR}" NO_DEFAULT_PAT
1818
# Position independent code for shared libraries
1919
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
2020

21+
# macOS: don't link against build python
22+
if(APPLE)
23+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup")
24+
endif()
25+
2126
# Shared library naming conventions
2227
set(CMAKE_SHARED_LIBRARY_PREFIX _)
2328
set(CMAKE_SHARED_LIBRARY_SUFFIX .so)

examples/05_cpp/2_cpp_node_with_struct/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ find_library(CSP_LIBRARY NAMES _cspimpl.so PATHS "${CSP_LIB_DIR}" NO_DEFAULT_PAT
1818
# Position independent code for shared libraries
1919
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
2020

21+
# macOS: don't link against build python
22+
if(APPLE)
23+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup")
24+
endif()
25+
2126
# Shared library naming conventions
2227
set(CMAKE_SHARED_LIBRARY_PREFIX _)
2328
set(CMAKE_SHARED_LIBRARY_SUFFIX .so)

examples/05_cpp/3_cpp_adapter/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ find_library(CSP_LIBRARY NAMES _cspimpl.so PATHS "${CSP_LIB_DIR}" NO_DEFAULT_PAT
1818
# Position independent code for shared libraries
1919
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
2020

21+
# macOS: don't link against build python
22+
if(APPLE)
23+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup")
24+
endif()
25+
2126
# Shared library naming conventions
2227
set(CMAKE_SHARED_LIBRARY_PREFIX _)
2328
set(CMAKE_SHARED_LIBRARY_SUFFIX .so)

examples/05_cpp/4_c_api_adapter/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ find_library(CSP_LIBRARY NAMES _cspimpl.so PATHS "${CSP_LIB_DIR}" NO_DEFAULT_PAT
1818
# Position independent code for shared libraries
1919
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
2020

21+
# macOS: don't link against build python
22+
if(APPLE)
23+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup")
24+
endif()
25+
2126
# Shared library naming conventions
2227
set(CMAKE_SHARED_LIBRARY_PREFIX _)
2328
set(CMAKE_SHARED_LIBRARY_SUFFIX .so)

0 commit comments

Comments
 (0)