diff options
| author | Petr Štetiar | 2020-10-13 12:23:46 +0000 |
|---|---|---|
| committer | Petr Štetiar | 2020-10-13 13:27:49 +0000 |
| commit | de08a2c71ca83e783ab6cfc2bb6dda07b25bf381 (patch) | |
| tree | edb5d459192826d119deedbb39b244217ec3017a | |
| parent | cdc18fbb3ea8b5da866e049251d8bad79e4fbd04 (diff) | |
| download | mdnsd-de08a2c71ca83e783ab6cfc2bb6dda07b25bf381.tar.gz | |
cmake: create static library
So it could be reused in other binaries for fuzzing etc.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
| -rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8be878d..e087203 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations) SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") -SET(SOURCES main.c dns.c announce.c cache.c service.c util.c ubus.c interface.c) +SET(SOURCES dns.c announce.c cache.c service.c util.c ubus.c interface.c) FIND_PATH(ubox_include_dir NAMES libubox/usock.h) FIND_PATH(ubus_include_dir NAMES libubus.h) @@ -22,9 +22,11 @@ IF(DEBUG) ADD_DEFINITIONS(-DDEBUG -g3) ENDIF() -ADD_EXECUTABLE(umdns ${SOURCES}) +ADD_LIBRARY(umdns-lib STATIC ${SOURCES}) +TARGET_LINK_LIBRARIES(umdns-lib ${LIBS}) -TARGET_LINK_LIBRARIES(umdns ${LIBS}) +ADD_EXECUTABLE(umdns main.c) +TARGET_LINK_LIBRARIES(umdns umdns-lib) INSTALL(TARGETS umdns RUNTIME DESTINATION sbin |