summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-10-03 14:33:21 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2019-10-04 16:02:32 +0200
commitb5bd40e1e68b739307e20e19d2164c5b370846df (patch)
tree91d05e9d740e7e0413509ab7a563b3ce14444b62 /CMakeLists.txt
parentd4a2c432763b033acf7c94ee7e121aca5a3a4f10 (diff)
Isolate compatibility with old cynara
The compatibility items of the old cynara librarie are separated and isolated. The option WITH_CYNARA_COMPAT activates it or not. Change-Id: Iba77c97d8df31f5f515b57411487943192451ac6 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 9 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5879513..f96a1d6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,7 +44,9 @@ set(CYNARA_SOVERSION 1.99)
add_definitions(-DCYNARA_VERSION="${CYNARA_VERSION}")
-set(SYSTEMD ON CACHE BOOL "should use systemd")
+option(WITH_SYSTEMD "should include systemd compatibility" ON)
+option(WITH_CYNARA_COMPAT "produce artifacts for compatibility with cynara" OFF)
+
set(DEFAULT_DB_DIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/cynara"
CACHE PATH "directory path of the database")
set(DEFAULT_SOCKET_DIR "${CMAKE_INSTALL_FULL_RUNSTATEDIR}/cynara"
@@ -55,7 +57,6 @@ set(DEFAULT_INIT_FILE "${DEFAULT_CONFIG_DIR}/cynara.initial")
###########################################################################
-include_directories(include)
link_libraries(-Wl,--as-needed -Wl,--gc-sections -Wl,--no-undefined)
add_compile_options(-Wall -Wextra -Wconversion)
@@ -64,27 +65,22 @@ add_compile_options(-Wno-sign-compare -Wno-sign-conversion)
add_compile_options(-Werror=maybe-uninitialized)
add_compile_options(-Werror=implicit-function-declaration)
add_compile_options(-ffunction-sections -fdata-sections)
-add_compile_options(-fPIC)
-add_compile_options(-g)
-add_compile_options(-fstack-protector -D_FORTIFY_SOURCE=2 -O2)
-add_compile_options(-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.)
-
-set(CMAKE_C_FLAGS_PROFILING "-g -O2 -pg")
-set(CMAKE_C_FLAGS_DEBUG "-g -ggdb --fstack-protector -D_FORTIFY_SOURCE=2")
-set(CMAKE_C_FLAGS_RELEASE "-g -O2")
-set(CMAKE_C_FLAGS_CCOV "-g -O2 --coverage")
+add_compile_options(-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.)
###########################################################################
-if(SYSTEMD)
+if(WITH_SYSTEMD)
PKG_CHECK_MODULES(libsystemd REQUIRED libsystemd>=222)
add_subdirectory(systemd)
endif()
-add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(pkgconfig)
+if(WITH_CYNARA_COMPAT)
+ add_subdirectory(compat)
+endif()
+
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/cynara.initial
DESTINATION