diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f04e7cc36d..b41484400a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -88,6 +88,9 @@ endif() if("${STATIC}" MATCHES "ON") message(STATUS "Creating a static executable") + if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(LEAN_EXTRA_LINKER_FLAGS "${LEAN_EXTRA_LINKER_FLAGS} -Wl,--whole-archive -lpthread -Wl,--no-whole-archive") + endif() set(LEAN_EXTRA_LINKER_FLAGS "${LEAN_EXTRA_LINKER_FLAGS} -static") endif()