From 39138496359f05d792d5d8d9e50d4d6384296280 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sat, 21 Oct 2023 22:29:41 +0200 Subject: [PATCH] Use --start/end-group on linux to fix ld geomserver --- cmake/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 1fc7b4b3e9..d57da2ab7d 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -415,9 +415,13 @@ if(BUILD_IFCGEOM) if(WASM_BUILD) set(OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) else() - # OPENCASCADE_LIBRARIES repeated N times below in order to fix cyclic dependencies - use --start-group ... --end-group instead? + # OPENCASCADE_LIBRARIES repeated N times below in order to fix cyclic dependencies # tfk: --start-group ... --end-group didn't work on the apple linker when last tested - set(OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + if(APPLE) + set(OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + else() + set(OPENCASCADE_LIBRARIES -Wl,--start-group ${OPENCASCADE_LIBRARIES} -Wl,--end-group ${CMAKE_THREAD_LIBS_INIT}) + endif() endif() if(NOT APPLE AND NOT WIN32)