summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2b81367..4a0eafe 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,6 +1,13 @@
wlproto(IVI_CON ivi-controller)
-add_executable(winman
+include(FindPkgConfig)
+pkg_check_modules(AFB REQUIRED afb-daemon==1.0)
+pkg_check_modules(SD REQUIRED libsystemd>=222)
+
+# We do not want a prefix for our module
+set(CMAKE_SHARED_MODULE_PREFIX "")
+
+add_library(winman MODULE
main.cpp
wayland.cpp
wayland.hpp
@@ -8,12 +15,24 @@ add_executable(winman
util.hpp
${IVI_CON_PROTO})
+target_include_directories(winman
+ PRIVATE
+ ${AFB_INCLUDE_DIRS}
+ ${SD_INCLUDE_DIRS}
+ ../include)
+
+target_link_libraries(winman
+ PRIVATE
+ ${AFB_LIBRARIES}
+ ${WLC_LIBRARIES}
+ ${SD_LIBRARIES})
+
target_compile_definitions(winman
PRIVATE
WINMAN_VERSION_STRING="${PACKAGE_VERSION}"
_GNU_SOURCE) # XXX should I define this here?!
-if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Release")
target_compile_definitions(winman
PRIVATE
_GLIBCXX_DEBUG)
@@ -33,7 +52,9 @@ set_target_properties(winman
C_EXTENSIONS OFF
C_STANDARD 99
- C_STANDARD_REQUIRED ON)
+ C_STANDARD_REQUIRED ON
+
+ LINK_FLAGS "-Wl,--version-script=../../export.map")
if (NOT ${SANITIZER_MODE} STREQUAL "none" AND NOT ${SANITIZER_MODE} STREQUAL "")
target_compile_options(winman
@@ -43,6 +64,3 @@ if (NOT ${SANITIZER_MODE} STREQUAL "none" AND NOT ${SANITIZER_MODE} STREQUAL "")
PROPERTIES
LINK_FLAGS "-fsanitize=${SANITIZER_MODE} -g")
endif()
-
-target_link_libraries(winman
- ${WLC_LIBRARIES})