diff --git a/.gitignore b/.gitignore index 6f5abf3..0c6b108 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,6 @@ docs/spec.pdf .tex .pdf docs/overall_picture.png +vendor/ +\#*# +*.\#* diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f2afd5..b79780e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,10 +135,11 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) endif() # Feynman Setup =================================== - + add_definitions(-DWLR_USE_UNSTABLE) include_directories(SYSTEM ${PROJECT_BINARY_DIR}/src) include_directories(SYSTEM ${FEYNMAN_EMACS_DIR}/inculde) + # Hide all the symbols by default if(NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET AND NOT DEFINED CMAKE_VISIBILITY_INLINES_HIDDEN) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cfd6f92..b44bb13 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,10 +14,16 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . + add_library(feynman SHARED feynman.c + queue.c + compositor.c + utils.c + xdg-shell-protocol.c ) + set_target_properties(feynman PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} @@ -40,4 +46,29 @@ generate_export_header(feynman EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/src/export find_package(PkgConfig REQUIRED) pkg_check_modules(WLROOTS REQUIRED IMPORTED_TARGET wlroots) -target_link_libraries(feynman PUBLIC PkgConfig::WLROOTS) +target_link_libraries(feynman PUBLIC + PkgConfig::WLROOTS) + +# find Wayland protocols +pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) + +# find 'wayland-scanner' executable +pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner) + +set(XDG_PROT_DEF "${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml") +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-protocol.h + COMMAND ${WAYLAND_SCANNER} client-header ${XDG_PROT_DEF} xdg-shell-protocol.h) + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-protocol.c + COMMAND ${WAYLAND_SCANNER} private-code ${XDG_PROT_DEF} xdg-shell-protocol.c + DEPENDS xdg-shell-protocol.h) + +target_include_directories(feynman PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_sources(feynman PRIVATE xdg-shell-protocol.c) + +find_package(Threads REQUIRED) +target_link_libraries(feynman PRIVATE Threads::Threads) + +include_directories(SYSTEM ${WLROOTS_INCLUDE_DIRS})