separated main

pull/1/head
Falk Werner 4 years ago
parent d8e1fcd426
commit d304c843bc

@ -48,12 +48,15 @@ target_include_directories(userdb PUBLIC
target_compile_options(userdb PUBLIC ${OPENSSL_CFLAGS_OTHER})
add_library(webfused-static STATIC
src/webfused/daemon.c)
add_executable(webfused
src/daemon/main.c
src/webfused/main.c
)
target_link_libraries(webfused PUBLIC
target_link_libraries(webfused PUBLIC
webfused-static
userdb
${LIBCONFIG_LIBRARIES}
${OPENSSL_LIBRARIES}

@ -1,3 +1,5 @@
#include "webfused/daemon.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -154,7 +156,7 @@ static void on_interrupt(int signal_id)
shutdown_requested = true;
}
int main(int argc, char * argv[])
int wfd_daemon_run(int argc, char * argv[])
{
struct args args;
args.config = wf_server_config_create();

@ -0,0 +1,15 @@
#ifndef WFD_DAEMON_H
#define WFD_DAEMON_H
#ifdef __cplusplus
extern "C"
{
#endif
extern int wfd_daemon_run(int argc, char * argv[]);
#ifdef __cplusplus
}
#endif
#endif

@ -0,0 +1,6 @@
#include "webfused/daemon.h"
int main(int argc, char * argv[])
{
return wfd_daemon_run(argc, argv);
}
Loading…
Cancel
Save