X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2FCMakeLists.txt;h=17796be06991b7604e342602921574d61d4a95f5;hb=9dfa6b9427115e7402ce25e40e4d78b20d559c93;hp=70f2ad379fc9f55d1aeed784e6cf853ddbb10764;hpb=224a49e95723b74640ac9f99f9d33be6ee3686d2;p=staging%2Fwindowmanager.git diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 70f2ad3..17796be 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,20 +1,43 @@ -wlproto(IVI_APP ivi-application) 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 - ${IVI_APP_PROTO} - ${IVI_CON_PROTO}) + util.cpp + util.hpp + ${IVI_CON_PROTO} json_helper.cpp json_helper.hpp) + +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) @@ -29,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 @@ -39,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})