aboutsummaryrefslogtreecommitdiffstats
path: root/compat
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-10-04 17:28:24 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2019-10-04 21:30:12 +0200
commit2db8fa8c75a173ad49b06a97aefe16b279e5bbee (patch)
tree96d3495d2df0e59c207322f2d4517c2920e0fccc /compat
parent175e632803f9d40e019e6e7a8b3190b649b2f877 (diff)
Add DIRECT_CYNARA_COMPAT to dissociate libs
The flag DIRECT_CYNARA_COMPAT remove the dependency of libcynara-compat to libcynagora. Change-Id: Ib8ded68fc799a7cdb53acd4416b255abdf765311 Signed-off-by: José Bollo <jose.bollo@iot.bzh> fixup! 9d08a0b
Diffstat (limited to 'compat')
-rw-r--r--compat/src/CMakeLists.txt13
1 files changed, 9 insertions, 4 deletions
diff --git a/compat/src/CMakeLists.txt b/compat/src/CMakeLists.txt
index 7c8feca..351c560 100644
--- a/compat/src/CMakeLists.txt
+++ b/compat/src/CMakeLists.txt
@@ -16,12 +16,20 @@
# limitations under the License.
###########################################################################
+option(DIRECT_CYNARA_COMPAT "cynara compat access server directly without using libcynagora" OFF)
+
add_compile_definitions(_GNU_SOURCE)
###########################################
# build and install libcynara-compat
###########################################
-add_library(cynara-compat SHARED lib-compat.c)
+if(DIRECT_CYNARA_COMPAT)
+ add_library(cynara-compat SHARED lib-compat.c $<TARGET_OBJECTS:client-objects>)
+ target_include_directories(cynara-compat PRIVATE ../../src)
+else()
+ add_library(cynara-compat SHARED lib-compat.c)
+ target_link_libraries(cynara-compat PRIVATE cynagora)
+endif()
target_include_directories(cynara-compat PUBLIC ../include)
set_target_properties(cynara-compat
PROPERTIES
@@ -29,9 +37,6 @@ set_target_properties(cynara-compat
SOVERSION ${CYNARA_SOVERSION}
LINK_FLAGS -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export-cynara-compat.map
)
-target_link_libraries(cynara-compat
- PRIVATE cynagora
-)
install(TARGETS cynara-compat LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
###########################################