summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-10-29 14:24:45 -0400
committerAdam <Adam@anope.org>2016-10-29 14:24:45 -0400
commitc06cc40d27e5cb83424d89cb19571eb42392abe6 (patch)
treebd8a0cec5210b7a0dcad7e46bb3070eebed53d11 /src
parentfce6169f4e134a99dbb19997337b1bb250889147 (diff)
Add sqlite amalgamation and use if no system sqlite is found. Move sqlite module out of extras.
Diffstat (limited to 'src')
-rw-r--r--src/tools/CMakeLists.txt12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
index ee445a00e..76442b4ab 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -1,11 +1,17 @@
+if(PREFER_EMBEDDED_SQLITE OR NOT SQLITE_FOUND)
+ include_directories(${Anope_SOURCE_DIR}/lib/sqlite)
+endif()
function(build_sqlite LIBNAME)
add_library(tools_anope_sqlite_${LIBNAME} SHARED anope_sqlite.cpp)
+ if(PREFER_EMBEDDED_SQLITE OR NOT SQLITE_FOUND)
+ target_link_libraries(tools_anope_sqlite_${LIBNAME} sqlite3)
+ else()
+ target_link_libraries(tools_anope_sqlite_${LIBNAME} ${SQLITE_LIBRARIES})
+ endif()
set_source_files_properties(anope_sqlite.cpp PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
set_target_properties(tools_anope_sqlite_${LIBNAME} PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}" OUTPUT_NAME "anope_sqlite_${LIBNAME}")
- install(TARGETS tools_anope_sqlite_${LIBNAME}
- DESTINATION ${LIB_DIR}
- )
+ install(TARGETS tools_anope_sqlite_${LIBNAME} DESTINATION ${LIB_DIR})
endfunction()
build_sqlite(ascii)