[OpenWrt-Devel] [PATCH ucert 5/9] cmake: split usign bits into static library

Petr Štetiar ynezz at true.cz
Thu Dec 19 17:04:17 EST 2019


So it could be reused easily in unit tests for example.

Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 CMakeLists.txt | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 78970d2632b5..443d79bd4e8b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,13 +28,15 @@ IF(USE_RPATH)
 	SET(CMAKE_MACOSX_RPATH 1)
 ENDIF()
 
-ADD_EXECUTABLE(ucert ucert.c usign-exec.c)
+ADD_LIBRARY(ucert_lib STATIC usign-exec.c)
+ADD_EXECUTABLE(ucert ucert.c)
+
 IF(UCERT_FULL)
 	ADD_DEFINITIONS(-DUCERT_FULL)
-	TARGET_LINK_LIBRARIES(ucert ${ubox} ${blobmsg_json} ${json})
+	TARGET_LINK_LIBRARIES(ucert ucert_lib ${ubox} ${blobmsg_json} ${json})
 ELSE()
 	ADD_DEFINITIONS(-DUCERT_STRIP_MESSAGES)
-	TARGET_LINK_LIBRARIES(ucert ${ubox})
+	TARGET_LINK_LIBRARIES(ucert ucert_lib ${ubox})
 ENDIF()
 
 INSTALL(TARGETS ucert RUNTIME DESTINATION bin)

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list