cmake: add opton to link against LLVM's libc++
[staging/windowmanager.git] / src / CMakeLists.txt
index 17796be..f2c9b3a 100644 (file)
@@ -7,19 +7,25 @@ pkg_check_modules(SD REQUIRED libsystemd>=222)
 # We do not want a prefix for our module
 set(CMAKE_SHARED_MODULE_PREFIX "")
 
+add_custom_command(
+   OUTPUT afb_binding_api.hpp afb_binding_glue.inl
+   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../generate-binding-glue.py
+   COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/../generate-binding-glue.py)
+
 add_library(winman MODULE
    main.cpp
    wayland.cpp
    wayland.hpp
    util.cpp
    util.hpp
-   ${IVI_CON_PROTO} json_helper.cpp json_helper.hpp)
+   ${IVI_CON_PROTO} json_helper.cpp json_helper.hpp app.hpp app.cpp result.hpp afb_binding_api.hpp afb_binding_glue.inl)
 
 target_include_directories(winman
     PRIVATE
         ${AFB_INCLUDE_DIRS}
         ${SD_INCLUDE_DIRS}
-        ../include)
+        ../include
+        ../src)
 
 target_link_libraries(winman
     PRIVATE
@@ -29,6 +35,9 @@ target_link_libraries(winman
 
 target_compile_definitions(winman
     PRIVATE
+        AFB_BINDING_VERSION=2
+        # We do not want source location of messages
+        AFB_BINDING_PRAGMA_NO_VERBOSE_DETAILS
         WINMAN_VERSION_STRING="${PACKAGE_VERSION}"
         _GNU_SOURCE)  # XXX should I define this here?!
 
@@ -56,6 +65,12 @@ set_target_properties(winman
 
         LINK_FLAGS "-Wl,--version-script=../../export.map")
 
+if (LINK_LIBCXX)
+   set_target_properties(winman
+           PROPERTIES
+           LINK_FLAGS "-Wl,--version-script=../../export.map -lc++")
+endif()
+
 if (NOT ${SANITIZER_MODE} STREQUAL "none" AND NOT ${SANITIZER_MODE} STREQUAL "")
    target_compile_options(winman
       PRIVATE