File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,7 +48,13 @@ function(impact_link_python_embed target)
4848 set (_impact_pylib ${IMPACT_PYTHON_EMBED_LIBRARY} )
4949 endif ()
5050 if (_impact_pylib)
51- target_link_libraries (${target} -Wl,--no-as-needed ${_impact_pylib} -Wl,--as-needed )
51+ # --no-as-needed is GNU-ld only; Apple's linker rejects it outright and
52+ # never drops a needed library anyway.
53+ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND NOT APPLE AND NOT MSVC )
54+ target_link_libraries (${target} PRIVATE -Wl,--no-as-needed ${_impact_pylib} -Wl,--as-needed )
55+ else ()
56+ target_link_libraries (${target} PRIVATE ${_impact_pylib} )
57+ endif ()
5258 endif ()
5359endfunction ()
5460
@@ -97,7 +103,7 @@ if(NOT TARGET GTest::GTest)
97103endif ()
98104
99105add_executable (ImpactGTestDriver itkImpactBackendGTest.cxx )
100- target_link_libraries (ImpactGTestDriver ${Impact-Test_LIBRARIES} Impact GTest::GTest )
106+ target_link_libraries (ImpactGTestDriver PRIVATE ${Impact-Test_LIBRARIES} Impact GTest::GTest )
101107impact_link_python_embed (ImpactGTestDriver )
102108# The ImpactConvexAdam.RealLungCT* gtest runs on a real lung-CT pair (and the M258 model)
103109# kept out of git. Fetch them via ITK ExternalData from the committed .sha512 content links
You can’t perform that action at this time.
0 commit comments