Skip to content

Commit

Permalink
Use old linking method for non-gcc build
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Sep 18, 2024
1 parent fd8e229 commit 475b412
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ add_sip_module(pynest2d)
install_sip_module(pynest2d)

# Ensure the linking to libnest2d will not be discarded by GCC
target_link_libraries(sip_pynest2d PUBLIC
$<$<CXX_COMPILER_ID:GNU,Clang>:-Wl,--no-as-needed>
-lnest2d
$<$<CXX_COMPILER_ID:GNU,Clang>:-Wl,--as-needed>
)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_link_libraries(sip_pynest2d PUBLIC -Wl,--no-as-needed -lnest2d -Wl,--as-needed)
endif()

0 comments on commit 475b412

Please sign in to comment.