diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2026-01-01 19:48:40 -0700 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2026-01-01 19:48:40 -0700 |
| commit | 10c542f7a991756f195742389e26ef56a2ec9361 (patch) | |
| tree | d7edc647a026da4ad9b20aafe4a9f1509720de5a /rt | |
| parent | 628174c992a5a740feb4dc119adf8dfb1f89f992 (diff) | |
| download | montis-10c542f7a991756f195742389e26ef56a2ec9361.tar.gz montis-10c542f7a991756f195742389e26ef56a2ec9361.tar.bz2 montis-10c542f7a991756f195742389e26ef56a2ec9361.zip | |
[reorg] - Finished reorg.
Finally have coherent building on top of CMake. And installing actually
works. In addition we use a static wlroots to avoid version hell.
Diffstat (limited to 'rt')
| -rw-r--r-- | rt/CMakeLists.txt | 56 | ||||
| -rw-r--r-- | rt/src/plugin.c | 2 |
2 files changed, 51 insertions, 7 deletions
diff --git a/rt/CMakeLists.txt b/rt/CMakeLists.txt index a7a0a77..22025fb 100644 --- a/rt/CMakeLists.txt +++ b/rt/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project ( - wtr_harness + montis VERSION 0.1 LANGUAGES C) @@ -74,11 +74,55 @@ file (GLOB_RECURSE SOURCES src/*.c) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -add_executable (wtr_harness ${SOURCES} ${PLUGIN_LOAD} ${PLUGIN_INTF} +add_executable (montis ${SOURCES} ${PLUGIN_LOAD} ${PLUGIN_INTF} xdg-shell-protocol.c) -target_link_libraries(wtr_harness dl) -target_link_directories(wtr_harness PUBLIC +find_package(PkgConfig REQUIRED) + +pkg_check_modules(WLREQ REQUIRED IMPORTED_TARGET + wayland-server + wayland-client + wayland-egl + wayland-cursor + xkbcommon + pixman-1 + libinput + libudev + libseat + libdrm + gbm + egl + glesv2 +) + +target_link_libraries(montis PRIVATE PkgConfig::WLREQ dl wlroots pthread) + +pkg_check_modules(WLOPT IMPORTED_TARGET + cairo + lcms2 + libdisplay-info + libliftoff + vulkan + xwayland + xcb + xcb-composite + xcb-dri3 + xcb-errors + xcb-ewmh + xcb-icccm + xcb-present + xcb-render + xcb-renderutil + xcb-res + xcb-shm + xcb-xfixes + xcb-xinput +) + +if(WLOPT_FOUND) + target_link_libraries(montis PRIVATE PkgConfig::WLOPT) +endif() + +target_link_directories(montis PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/../wlroots") -target_link_libraries(wtr_harness wlroots-0.18 wayland-server xkbcommon pthread) -target_link_options(wtr_harness PRIVATE -Wl,--wrap=pthread_create) +target_link_options(montis PRIVATE -rdynamic) diff --git a/rt/src/plugin.c b/rt/src/plugin.c index 37a6dd3..0799b9c 100644 --- a/rt/src/plugin.c +++ b/rt/src/plugin.c @@ -116,7 +116,7 @@ static void* plugin_get_seat(void* ctx) { static int load_plugin_from_file_(int argc, char **argv, const char *filename, plugin_t *plugin) { - dlhandle_t lib = dlopen(filename, RTLD_LAZY); + dlhandle_t lib = dlopen(filename, RTLD_NOW | RTLD_GLOBAL); int ec = 0; if (!lib) { |