From 77b42b1d37a8a7c4a99c8c3e3ed1afeef2d7ec79 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Wed, 13 Sep 2017 00:03:01 +0200 Subject: [PATCH] Add pthread linking when dynamic --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 614fea3..58e3d7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,10 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${STATIC_BUILD}") set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++") endif () +if (NOT "${STATIC_BUILD}") + set (CMAKE_EXE_LINKER_FLAGS "-lpthread") +endif () + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") endif ()