From 222fc37c4a9eb9fb7a3cf99f7f7458b8fd401aae Mon Sep 17 00:00:00 2001 From: 0penBrain <48731257+0penBrain@users.noreply.github.com> Date: Wed, 1 May 2024 19:36:50 +0200 Subject: [PATCH] Make: use single dash argument for Apple toolchain --- cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake | 6 +++++- src/Mod/CAM/libarea/CMakeLists.txt | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake b/cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake index 445a4865fc1a..4def26bf57c2 100644 --- a/cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake +++ b/cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake @@ -73,7 +73,11 @@ macro(CompilerChecksAndSetups) endif() else(BUILD_DYNAMIC_LINK_PYTHON) if(CMAKE_COMPILER_IS_CLANGXX) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--undefined,dynamic_lookup") + if(APPLE) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,dynamic_lookup") + elseif(UNIX) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--undefined,dynamic_lookup") + endif() endif() endif(BUILD_DYNAMIC_LINK_PYTHON) endif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) diff --git a/src/Mod/CAM/libarea/CMakeLists.txt b/src/Mod/CAM/libarea/CMakeLists.txt index 738f863c4183..7616f54b99a0 100644 --- a/src/Mod/CAM/libarea/CMakeLists.txt +++ b/src/Mod/CAM/libarea/CMakeLists.txt @@ -163,7 +163,11 @@ target_link_libraries(area area-native ${area_LIBS} ${area_native_LIBS}) # TODO why CMAKE_SHARED_LINKER_FLAGS is not used here? # This is a dirty workaround! if(NOT BUILD_DYNAMIC_LINK_PYTHON AND CMAKE_COMPILER_IS_CLANGXX) - target_link_libraries(area "-Wl,--undefined,dynamic_lookup") + if(APPLE) + target_link_libraries(area "-Wl,-undefined,dynamic_lookup") + else(UNIX) + target_link_libraries(area "-Wl,--undefined,dynamic_lookup") + endif() endif() SET_BIN_DIR(area area /Mod/CAM)