From 3d9278cb82d12d76a7c57c51dcae4533564c4883 Mon Sep 17 00:00:00 2001 From: Andre Castellanos <47199821+acastellanos95@users.noreply.github.com> Date: Sat, 3 Oct 2020 22:10:23 -0500 Subject: [PATCH] CMAKE bug fixed when SHARED and EXAMPLES are on (#597) Co-authored-by: andre --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c9b6c67..f29193b4 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,13 @@ set(INSTALL_DROGON_CMAKE_DIR if(BUILD_DROGON_SHARED) set(BUILD_TRANTOR_SHARED TRUE) set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) + set(CMAKE_THREAD_LIBS_INIT "-lpthread") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") + set(CMAKE_HAVE_THREADS_LIBRARY 1) + set(CMAKE_USE_WIN32_THREADS_INIT 0) + set(CMAKE_USE_PTHREADS_INIT 1) + set(THREADS_PREFER_PTHREAD_FLAG ON) + # set(BUILD_EXAMPLES FALSE) list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}" isSystemDir) if("${isSystemDir}" STREQUAL "-1")