From 666480a7fbceec3f020be4b7d374a14964e541e7 Mon Sep 17 00:00:00 2001 From: 0penBrain <48731257+0penBrain@users.noreply.github.com> Date: Fri, 8 Mar 2024 11:42:40 +0100 Subject: [PATCH] Cmake: pass 'undefined' with double dash so alternative linker can be used --- cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake | 4 ++-- src/Mod/Path/libarea/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake b/cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake index 59e2d2f2881c6..78998718732b3 100644 --- a/cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake +++ b/cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake @@ -67,13 +67,13 @@ macro(CompilerChecksAndSetups) # get linker errors as soon as possible and not at runtime e.g. for modules if(BUILD_DYNAMIC_LINK_PYTHON) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--undefined,error") elseif(UNIX) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") endif() else(BUILD_DYNAMIC_LINK_PYTHON) if(CMAKE_COMPILER_IS_CLANGXX) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,dynamic_lookup") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--undefined,dynamic_lookup") endif() endif(BUILD_DYNAMIC_LINK_PYTHON) endif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) diff --git a/src/Mod/Path/libarea/CMakeLists.txt b/src/Mod/Path/libarea/CMakeLists.txt index 62118bc7a06d8..cbaf37b54e9dd 100644 --- a/src/Mod/Path/libarea/CMakeLists.txt +++ b/src/Mod/Path/libarea/CMakeLists.txt @@ -163,7 +163,7 @@ 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") + target_link_libraries(area "-Wl,--undefined,dynamic_lookup") endif() SET_BIN_DIR(area area /Mod/Path)