aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-12-17 15:19:34 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-17 15:19:34 +0100
commit30d2f58557ca954f1500b1d6a06ea966786f3a28 (patch)
treed488139655750249c6ca4d884aaef4c71af89ffc
parenteaf644db7106061481710adb75023122ce4bc150 (diff)
Change to static lib and add default compile flags
Use the same compilation flags than in a Yocto build and make more robust the installation of the library Change-Id: Idb6b44a1772bc85080f6e700d40a3df12677f58a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--ctl-lib/CMakeLists.txt20
1 files changed, 8 insertions, 12 deletions
diff --git a/ctl-lib/CMakeLists.txt b/ctl-lib/CMakeLists.txt
index 48684e0..e2fd683 100644
--- a/ctl-lib/CMakeLists.txt
+++ b/ctl-lib/CMakeLists.txt
@@ -51,7 +51,7 @@ endforeach(PKG_CONFIG)
set(CTL_LUA_SOURCE ctl-lua.c ctl-lua-utils.c)
-ADD_COMPILE_OPTIONS(-DCONTROL_SUPPORT_LUA)
+ADD_COMPILE_OPTIONS(-DCONTROL_SUPPORT_LUA -Wall -Wextra -Wconversion -Wno-unused-parameter -Wno-sign-compare -Wno-sign-conversion -Werror=maybe-uninitialized -Werror=implicit-function-declaration -ffunction-sections -fdata-sections -fPIC)
set(CONTROLLER_HEADERS
ctl-config.h
@@ -60,7 +60,7 @@ set(CONTROLLER_HEADERS
)
# Define project Targets
-ADD_LIBRARY(${TARGET_NAME} SHARED ctl-action.c ctl-config.c ctl-onload.c ctl-plugin.c ctl-control.c ctl-event.c ${CTL_LUA_SOURCE})
+ADD_LIBRARY(${TARGET_NAME} STATIC ctl-action.c ctl-config.c ctl-onload.c ctl-plugin.c ctl-control.c ctl-event.c ${CTL_LUA_SOURCE})
# Library dependencies (include updates automatically)
TARGET_LINK_LIBRARIES(${TARGET_NAME}
@@ -80,13 +80,9 @@ INSTALL(FILES
${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
-INSTALL(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET_NAME}.so
- DESTINATION
- ${CMAKE_INSTALL_LIBDIR}
- )
-INSTALL(FILES
- ${CONTROLLER_HEADERS}
- DESTINATION
- ${CMAKE_INSTALL_INCLUDEDIR}
- )
+INSTALL(TARGETS ${TARGET_NAME}
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ )
+INSTALL(FILES ${CONTROLLER_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ )