From f0d9d6f6ab6ad46ba4798c90924ca0ef8a5fa6ef Mon Sep 17 00:00:00 2001 From: rexy712 Date: Fri, 25 Sep 2020 06:12:03 -0700 Subject: [PATCH] Fix linker flags since threadpool needs pthreads --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1272214..7a03f9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,6 @@ set(librexy_VERSION_REVISION 0) set(INCLUDE_PATH ${CMAKE_SOURCE_DIR}/include) include_directories(BEFORE SYSTEM "${INCLUDE_PATH}") -set(LIBREXY_LIBFLAGS "-lrexy") option(ENABLE_SHARED "Build shared library" ON) option(ENABLE_PROFILING "Enable asan" OFF) @@ -21,8 +20,11 @@ target_compile_options(ensure PRIVATE -Wall -Wextra -pedantic -std=c++17) if(ENABLE_SHARED) add_library(rexy SHARED ${SOURCE_LIST}) set_target_properties(rexy PROPERTIES SOVERSION "${librexy_VERSION_MAJOR}.${librexy_VERSION_MINOR}.${librexy_VERSION_REVISION}") + set(LIBREXY_LIBFLAGS "-lrexy") + target_link_libraries(rexy "-lpthread") else() add_library(rexy STATIC ${SOURCE_LIST}) + set(LIBREXY_LIBFLAGS "-lrexy -lpthread") endif() if(ENABLE_PROFILING)