summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-03-05 12:16:13 +0100
committerFelix Fietkau <nbd@openwrt.org>2016-03-05 12:16:15 +0100
commit1d5dd0c269a58e0592897ff5b9261301a483777e (patch)
treeec6e995b0a4b5be12fe3be24541a370905fd17b6 /CMakeLists.txt
parent663aba340d6cd19486e77889ef6fef7f0c0d9a98 (diff)
downloadprocd-1d5dd0c269a58e0592897ff5b9261301a483777e.tar.gz
add a build-time option to disable init related code
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 9 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7299d9c..74959e0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,9 +18,12 @@ INSTALL(TARGETS setlbf
)
-SET(SOURCES procd.c signal.c watchdog.c state.c inittab.c rcS.c ubus.c system.c
+SET(SOURCES procd.c signal.c state.c inittab.c rcS.c ubus.c system.c
service/service.c service/instance.c service/validate.c service/trigger.c service/watch.c
- plug/coldplug.c plug/hotplug.c utils/utils.c)
+ utils/utils.c)
+IF(NOT DISABLE_INIT)
+ SET(SOURCES ${SOURCES} watchdog.c plug/coldplug.c plug/hotplug.c)
+ENDIF()
SET(LIBS ubox ubus json-c blobmsg_json json_script)
@@ -47,20 +50,21 @@ INSTALL(TARGETS procd
RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
)
-IF(NOT DISABLE_INIT)
+IF(DISABLE_INIT)
+ADD_DEFINITIONS(-DDISABLE_INIT)
+ELSE()
ADD_EXECUTABLE(init initd/init.c initd/early.c initd/preinit.c initd/mkdev.c watchdog.c
utils/utils.c ${SOURCES_ZRAM})
TARGET_LINK_LIBRARIES(init ${LIBS})
INSTALL(TARGETS init
RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
)
-ENDIF()
-
ADD_EXECUTABLE(udevtrigger plug/udevtrigger.c)
INSTALL(TARGETS udevtrigger
RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
)
+ENDIF()
ADD_EXECUTABLE(askfirst utils/askfirst.c)