# Compute the dependencies of SimGrid
#####################################
-set(SIMGRID_DEP "-lm -lstdc++")
+set(SIMGRID_DEP "-lm")
+
+if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"
+ AND NOT ${CMAKE_SYSTEM_VERSION} VERSION_LESS 10.0
+ AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+ # FreeBSD from 10.0 provide a internal C++ stack (unused by gcc)
+ set(SIMGRID_DEP "${SIMGRID_DEP} -lc++")
+else()
+ set(SIMGRID_DEP "${SIMGRID_DEP} -lstdc++")
+endif()
if(pthread)
if(${CONTEXT_THREADS})
# (that includes FindLibunwind.cmake), so simply load it now.
SET(SIMGRID_DEP "${SIMGRID_DEP} -lunwind")
+
+ # Same for libdw
+ SET(SIMGRID_DEP "${SIMGRID_DEP} -ldw")
# This supposes that the host machine is either an AMD or a X86.
# This is deeply wrong, and should be fixed by manually loading -lunwind-PLAT (FIXME)
if(PROCESSOR_x86_64)