From 475b4126954c3dfde1705fe9c49b23c17a471726 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Wed, 18 Sep 2024 09:59:32 +0200 Subject: [PATCH] Use old linking method for non-gcc build --- CMakeLists.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a1585e..9f4e01d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 - $<$:-Wl,--no-as-needed> - -lnest2d - $<$:-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()