Skip to content

Commit

Permalink
Make: use single dash argument for Apple toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
0penBrain authored and adrianinsaval committed May 1, 2024
1 parent 7cf7922 commit 502f78e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion src/Mod/CAM/libarea/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 502f78e

Please sign in to comment.