summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt23
-rw-r--r--src/afb-client-demo.c2
-rw-r--r--src/export-afbwsc.map9
3 files changed, 32 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3b3c6fd4..f41a3a88 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -51,6 +51,9 @@ ADD_LIBRARY(afb-lib STATIC
websock.c
)
+###########################################
+# build and install afb-daemon
+###########################################
ADD_EXECUTABLE(afb-daemon main.c)
TARGET_LINK_LIBRARIES(afb-daemon
afb-lib
@@ -66,11 +69,29 @@ TARGET_LINK_LIBRARIES(afb-daemon
INSTALL(TARGETS afb-daemon
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+###########################################
+# build and install libafbwsc
+###########################################
+ADD_LIBRARY(afbwsc SHARED afb-ws.c afb-ws-client.c afb-wsj1.c websock.c afb-common.c)
+TARGET_LINK_LIBRARIES(afbwsc
+ ${libsystemd_LIBRARIES}
+ -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export-afbwsc.map
+ -Wl,--as-needed
+ -Wl,--gc-sections
+)
+INSTALL(TARGETS afbwsc LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+INSTALL(FILES afb-wsj1.h afb-ws-client.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/afb)
+
+###########################################
+# build and install afb-client-demo
+###########################################
ADD_EXECUTABLE(afb-client-demo afb-client-demo.c)
TARGET_LINK_LIBRARIES(afb-client-demo
- afb-lib
+ afbwsc
${link_libraries}
${libsystemd_LIBRARIES}
)
INSTALL(TARGETS afb-client-demo
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+
diff --git a/src/afb-client-demo.c b/src/afb-client-demo.c
index 349a0274..6344d6a3 100644
--- a/src/afb-client-demo.c
+++ b/src/afb-client-demo.c
@@ -30,7 +30,7 @@
#include <systemd/sd-event.h>
-#include "afb-common.h"
+#include "afb-common.h" /* TODO: remove dependency to afb-common.h */
#include "afb-wsj1.h"
#include "afb-ws-client.h"
diff --git a/src/export-afbwsc.map b/src/export-afbwsc.map
new file mode 100644
index 00000000..c775a16f
--- /dev/null
+++ b/src/export-afbwsc.map
@@ -0,0 +1,9 @@
+{
+global:
+ afb_ws_client_connect_wsj1;
+ afb_wsj1_*;
+ afb_common_*;
+local:
+ *;
+};
+