X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2FCMakeLists.txt;h=4a0eafe4939201f0834610b8fb41924c5af3ca3f;hb=8e831f9b2e461c94a8ee0e229812bcf2d42ae2a5;hp=565f9fdc1d6d8bb9623c5131bf6f3b133535a7a4;hpb=2d220fc2257d24c4be7ca7b60ba526b654395220;p=staging%2Fwindowmanager.git diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 565f9fd..4a0eafe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,18 +1,43 @@ 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 - util.c - util.h + util.cpp + 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(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Release") + target_compile_definitions(winman + PRIVATE + _GLIBCXX_DEBUG) +endif() + target_compile_options(winman PRIVATE -Wall -Wextra -Wno-unused-parameter -Wno-comment) @@ -27,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 @@ -37,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})