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)