Skip to content

Commit

Permalink
Making util a shared library instead of static to reduce the number o…
Browse files Browse the repository at this point in the history
…f db connections during runtime.
  • Loading branch information
intjftw committed Jan 11, 2023
1 parent 38f6012 commit 1eb5971
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include_directories(
include_directories(SYSTEM
${ODB_INCLUDE_DIRS})

add_library(util STATIC
add_library(util SHARED
src/dbutil.cpp
src/dynamiclibrary.cpp
src/filesystem.cpp
Expand All @@ -17,13 +17,14 @@ add_library(util STATIC
src/pipedprocess.cpp
src/util.cpp)

target_compile_options(util PUBLIC -fPIC)

target_link_libraries(util
gvc
${Boost_LIBRARIES})

string(TOLOWER "${DATABASE}" _database)
if (${_database} STREQUAL "sqlite")
target_link_libraries(util
sqlite3)
endif()

install(TARGETS util DESTINATION ${INSTALL_LIB_DIR})

0 comments on commit 1eb5971

Please sign in to comment.