mirror of
https://github.com/swaywm/sway.git
synced 2025-10-31 22:25:26 -04:00
cmake: build common code only once
This creates (static) libraries for protocols/, common/, and wayland/.
This commit is contained in:
parent
f76b7f5385
commit
cce9c338c0
9 changed files with 93 additions and 78 deletions
|
|
@ -1,37 +1,17 @@
|
|||
find_package(Wayland REQUIRED)
|
||||
find_package(Cairo REQUIRED)
|
||||
find_package(Pango REQUIRED)
|
||||
|
||||
include(Wayland)
|
||||
WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell
|
||||
../protocols/xdg-shell.xml
|
||||
xdg-shell
|
||||
)
|
||||
WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell
|
||||
../protocols/desktop-shell.xml
|
||||
desktop-shell
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${PROTOCOLS_INCLUDE_DIRS}
|
||||
${WAYLAND_CLIENT_INCLUDE_DIR}
|
||||
${CAIRO_INCLUDE_DIRS}
|
||||
${PANGO_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
file(GLOB sources *.c)
|
||||
file(GLOB common ../common/*.c)
|
||||
file(GLOB wl_sources ../wayland/*.c)
|
||||
|
||||
add_executable(swaybg
|
||||
${sources}
|
||||
${wl_sources}
|
||||
${common}
|
||||
${proto-xdg-shell}
|
||||
${proto-desktop-shell}
|
||||
main.c
|
||||
)
|
||||
|
||||
target_link_libraries(swaybg
|
||||
sway-common
|
||||
sway-wayland
|
||||
${WAYLAND_CLIENT_LIBRARIES}
|
||||
${WAYLAND_CURSOR_LIBRARIES}
|
||||
${CAIRO_LIBRARIES}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue