Fix linker flags since threadpool needs pthreads

This commit is contained in:
rexy712 2020-09-25 06:12:03 -07:00
parent 4c81c2b8b8
commit f0d9d6f6ab

View File

@ -8,7 +8,6 @@ set(librexy_VERSION_REVISION 0)
set(INCLUDE_PATH ${CMAKE_SOURCE_DIR}/include) set(INCLUDE_PATH ${CMAKE_SOURCE_DIR}/include)
include_directories(BEFORE SYSTEM "${INCLUDE_PATH}") include_directories(BEFORE SYSTEM "${INCLUDE_PATH}")
set(LIBREXY_LIBFLAGS "-lrexy")
option(ENABLE_SHARED "Build shared library" ON) option(ENABLE_SHARED "Build shared library" ON)
option(ENABLE_PROFILING "Enable asan" OFF) option(ENABLE_PROFILING "Enable asan" OFF)
@ -21,8 +20,11 @@ target_compile_options(ensure PRIVATE -Wall -Wextra -pedantic -std=c++17)
if(ENABLE_SHARED) if(ENABLE_SHARED)
add_library(rexy SHARED ${SOURCE_LIST}) add_library(rexy SHARED ${SOURCE_LIST})
set_target_properties(rexy PROPERTIES SOVERSION "${librexy_VERSION_MAJOR}.${librexy_VERSION_MINOR}.${librexy_VERSION_REVISION}") 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() else()
add_library(rexy STATIC ${SOURCE_LIST}) add_library(rexy STATIC ${SOURCE_LIST})
set(LIBREXY_LIBFLAGS "-lrexy -lpthread")
endif() endif()
if(ENABLE_PROFILING) if(ENABLE_PROFILING)