meson setup

This commit is contained in:
Artur Mukhamadiev 2025-07-03 21:23:59 +03:00
parent ab2a62458d
commit 9b02b94805
5 changed files with 21 additions and 62 deletions

View File

@ -1,12 +0,0 @@
cmake_minimum_required(VERSION 3.20)
project(wayland-cli)
add_executable(${PROJECT_NAME})
target_sources(${PROJECT_NAME} PRIVATE main.cc)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
find_package(Wayland REQUIRED)
target_link_libraries(${PROJECT_NAME} Wayland::Wayland)

View File

@ -1,17 +0,0 @@
{
"version": 8,
"configurePresets": [
{
"name": "base-gcc",
"displayName": "Basic gcc preset",
"description": "Using compilers: C = /usr/bin/gcc, CXX = /usr/bin/g++",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}",
"CMAKE_C_COMPILER": "/usr/bin/gcc",
"CMAKE_CXX_COMPILER": "/usr/bin/g++",
"CMAKE_BUILD_TYPE": "Debug"
}
}
]
}

View File

@ -1,33 +0,0 @@
# Find the Wayland package
find_path(WAYLAND_INCLUDE_DIR
NAMES wayland-client.h
PATH_SUFFIXES wayland
)
find_library(WAYLAND_LIBRARY
NAMES wayland-client
)
find_library(WAYLAND_EGL_LIBRARY
NAMES wayland-egl
)
# Handle the QUIETLY and REQUIRED arguments and set WAYLAND_FOUND to TRUE if all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Wayland
DEFAULT_MSG
WAYLAND_LIBRARY
WAYLAND_EGL_LIBRARY
WAYLAND_INCLUDE_DIR)
if(WAYLAND_FOUND)
add_library(Wayland::Wayland INTERFACE IMPORTED)
set(WAYLAND_LIBRARIES ${WAYLAND_LIBRARY} ${WAYLAND_EGL_LIBRARY})
set_target_properties(Wayland::Wayland PROPERTIES
INTERFACE_LINK_LIBRARIES "${WAYLAND_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${WAYLAND_INCLUDE_DIR}"
)
endif()
mark_as_advanced(WAYLAND_INCLUDE_DIR WAYLAND_LIBRARY)

8
meson.build Normal file
View File

@ -0,0 +1,8 @@
project('wl-cli', 'cpp')
client = dependency('wayland-client')
egl = dependency('wayland-egl')
src = ['main.cc']
executable('wl-cli', sources : src, dependencies : [client, egl])

13
subprojects/wayland.wrap Normal file
View File

@ -0,0 +1,13 @@
[wrap-file]
directory = wayland-1.23.1
source_url = https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.23.1/downloads/wayland-1.23.1.tar.xz
source_filename = wayland-1.23.1.tar.xz
source_hash = 864fb2a8399e2d0ec39d56e9d9b753c093775beadc6022ce81f441929a81e5ed
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/wayland_1.23.1-1/wayland-1.23.1.tar.xz
wrapdb_version = 1.23.1-1
[provide]
wayland-cursor = wayland_cursor_dep
wayland-egl = wayland_egl_dep
wayland-server = wayland_server_dep
wayland-client = wayland_client_dep