aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-08-05 18:26:13 -0400
committerGitHub <noreply@github.com>2017-08-05 18:26:13 -0400
commitd6d1d57c69daf301bbefe76b81d8fb12f54a2812 (patch)
tree6980684640b9089bed5324388386427fbca63fdf
parentce886c03539319f7b3327a4adde3c912e349e0f4 (diff)
parentfdab81e1c95f872e61ab6ff4be65f09fe552f6f2 (diff)
Merge pull request #31 from nyorain/merged
Use meson as build system
-rw-r--r--.travis.yml7
-rw-r--r--CMake/FindA2X.cmake75
-rw-r--r--CMake/FindDRM.cmake40
-rw-r--r--CMake/FindDbus.cmake42
-rw-r--r--CMake/FindEGL.cmake41
-rw-r--r--CMake/FindGBM.cmake39
-rw-r--r--CMake/FindGLESv2.cmake41
-rw-r--r--CMake/FindLibInput.cmake72
-rw-r--r--CMake/FindLibcap.cmake56
-rw-r--r--CMake/FindSystemd.cmake40
-rw-r--r--CMake/FindUdev.cmake40
-rw-r--r--CMake/FindWayland.cmake69
-rw-r--r--CMake/FindWaylandProtocols.cmake39
-rw-r--r--CMake/FindXKBCommon.cmake19
-rw-r--r--CMake/Manpage.cmake33
-rw-r--r--CMake/Wayland.cmake77
-rw-r--r--CMakeLists.txt74
-rw-r--r--README.md7
-rw-r--r--backend/CMakeLists.txt42
-rw-r--r--backend/meson.build19
-rw-r--r--examples/CMakeLists.txt81
-rw-r--r--examples/meson.build17
-rw-r--r--meson.build77
-rw-r--r--render/CMakeLists.txt10
-rw-r--r--render/gles2/renderer.c6
-rw-r--r--render/meson.build10
-rw-r--r--session/CMakeLists.txt35
-rw-r--r--session/meson.build9
-rw-r--r--types/CMakeLists.txt20
-rw-r--r--types/meson.build9
-rw-r--r--types/wlr_output.c2
-rw-r--r--util/CMakeLists.txt6
-rw-r--r--util/meson.build4
33 files changed, 157 insertions, 1001 deletions
diff --git a/.travis.yml b/.travis.yml
index 30fb8d76..5684de93 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,7 +8,8 @@ compiler:
arch:
packages:
- - cmake
+ - meson
+ - ninja
- wayland
- wayland-protocols
- mesa
@@ -16,8 +17,8 @@ arch:
- libxkbcommon
- libcap
script:
- - "cmake -DCMAKE_BUILD_TYPE=Release ."
- - "make"
+ - "meson build"
+ - "ninja -C build"
script:
- "curl -s https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh | bash"
diff --git a/CMake/FindA2X.cmake b/CMake/FindA2X.cmake
deleted file mode 100644
index b38f5086..00000000
--- a/CMake/FindA2X.cmake
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# (c)2015 KiCad Developers
-# (c)2015 Brian Sidebotham <brian.sidebotham@gmail.com>
-#
-# CMake module to find a2x (part of the asciidoc toolchain).
-#
-# Variables generated:
-#
-# A2X_FOUND true when A2X_COMMAND is valid
-# A2X_COMMAND The command to run a2x (may be a list including an interpreter)
-# A2X_VERSION The a2x version that has been found
-#
-
-# Have a go at finding a a2x executable
-find_program( A2X_PROGRAM a2x )
-
-# Found something, attempt to try and use it...
-if( A2X_PROGRAM )
- execute_process(
- COMMAND ${A2X_PROGRAM} --version
- OUTPUT_VARIABLE _OUT
- ERROR_VARIABLE _ERR
- RESULT_VARIABLE _RES
- OUTPUT_STRIP_TRAILING_WHITESPACE )
-
- # If it worked, set the A2X_COMMAND
- if( _RES MATCHES 0 )
- set( A2X_COMMAND "${A2X_PROGRAM}" )
- endif()
-endif()
-
-# If nothing could be found, test to see if we can just find the script file,
-# that we'll then run with the python interpreter
-if( NOT A2X_COMMAND )
- find_file( A2X_SCRIPT a2x.py )
-
- if( A2X_SCRIPT )
- # Find the python interpreter quietly
- if( NOT PYTHONINTERP_FOUND )
- find_package( PYTHONINTERP QUIET )
- endif()
-
- if( NOT PYTHONINTERP_FOUND )
- # Python's not available so can't find a2x...
- set( A2X_COMMAND "" )
- else()
- # Build the python based command
- set( A2X_COMMAND "${PYTHON_EXECUTABLE}" "${A2X_SCRIPT}" )
-
- execute_process(
- COMMAND ${A2X_COMMAND} --version
- OUTPUT_VARIABLE _OUT
- ERROR_VARIABLE _ERR
- RESULT_VARIABLE _RES
- OUTPUT_STRIP_TRAILING_WHITESPACE )
-
- # If it still can't be run, then give up
- if( NOT _RES MATCHES 0 )
- set( A2X_COMMAND "" )
- endif()
- endif()
- endif()
-endif()
-
-# If we've found a command that works, check the version
-if( A2X_COMMAND )
- string(REGEX REPLACE ".*a2x[^0-9.]*\([0-9.]+\).*" "\\1" A2X_VERSION "${_OUT}")
-endif()
-
-# Generate the *_FOUND as necessary, etc.
-include( FindPackageHandleStandardArgs )
-find_package_handle_standard_args(
- A2X
- REQUIRED_VARS A2X_COMMAND
- VERSION_VAR A2X_VERSION )
diff --git a/CMake/FindDRM.cmake b/CMake/FindDRM.cmake
deleted file mode 100644
index 383647cd..00000000
--- a/CMake/FindDRM.cmake
+++ /dev/null
@@ -1,40 +0,0 @@
-#.rst:
-# FindDRM
-# -------
-#
-# Find DRM library
-#
-# Try to find DRM library on UNIX systems. The following values are defined
-#
-# ::
-#
-# DRM_FOUND - True if drm is available
-# DRM_INCLUDE_DIRS - Include directories for drm
-# DRM_LIBRARIES - List of libraries for drm
-# DRM_DEFINITIONS - List of definitions for drm
-#
-#=============================================================================
-# Copyright (c) 2015 Jari Vetoniemi
-#
-# Distributed under the OSI-approved BSD License (the "License");
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-include(FeatureSummary)
-set_package_properties(DRM PROPERTIES
- URL "http://dri.freedesktop.org/"
- DESCRIPTION "Kernel module that gives direct hardware access to DRI clients")
-
-find_package(PkgConfig)
-pkg_check_modules(PC_DRM QUIET libdrm)
-find_library(DRM_LIBRARIES NAMES drm HINTS ${PC_DRM_LIBRARY_DIRS})
-find_path(DRM_INCLUDE_DIRS NAMES drm.h PATH_SUFFIXES libdrm drm HINTS ${PC_DRM_INCLUDE_DIRS})
-
-set(DRM_DEFINITIONS ${PC_DRM_CFLAGS_OTHER})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(DRM DEFAULT_MSG DRM_INCLUDE_DIRS DRM_LIBRARIES)
-mark_as_advanced(DRM_INCLUDE_DIRS DRM_LIBRARIES DRM_DEFINITIONS)
diff --git a/CMake/FindDbus.cmake b/CMake/FindDbus.cmake
deleted file mode 100644
index 715e527b..00000000
--- a/CMake/FindDbus.cmake
+++ /dev/null
@@ -1,42 +0,0 @@
-#.rst:
-# FindDbus
-# -----------
-#
-# Find Dbus library
-#
-# Try to find Dbus library on UNIX systems. The following values are defined
-#
-# ::
-#
-# DBUS_FOUND - True if dbus is available
-# DBUS_INCLUDE_DIRS - Include directories for dbus
-# DBUS_LIBRARIES - List of libraries for dbus
-# DBUS_DEFINITIONS - List of definitions for dbus
-#
-#=============================================================================
-# Copyright (c) 2015 Jari Vetoniemi
-#
-# Distributed under the OSI-approved BSD License (the "License");
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-include(FeatureSummary)
-set_package_properties(Dbus PROPERTIES
- URL "http://www.freedesktop.org/wiki/Software/dbus/"
- DESCRIPTION "Message bus system")
-
-find_package(PkgConfig)
-pkg_check_modules(PC_DBUS QUIET dbus-1)
-find_path(DBUS_SYSTEM_INCLUDES dbus/dbus.h PATH_SUFFIXES dbus-1.0)
-find_path(DBUS_LIB_INCLUDES dbus/dbus-arch-deps.h HINTS ${PC_DBUS_INCLUDE_DIRS} ${CMAKE_LIBRARY_PATH}/dbus-1.0/include ${CMAKE_SYSTEM_LIBRARY_PATH}/dbus-1.0/include)
-find_library(DBUS_LIBRARIES NAMES dbus-1 HINTS ${PC_DBUS_LIBRARY_DIRS})
-
-set(DBUS_INCLUDE_DIRS ${DBUS_SYSTEM_INCLUDES} ${DBUS_LIB_INCLUDES})
-set(DBUS_DEFINITIONS ${PC_DBUS_CFLAGS_OTHER})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(DBUS DEFAULT_MSG DBUS_INCLUDE_DIRS DBUS_LIBRARIES)
-mark_as_advanced(DBUS_INCLUDE_DIRS DBUS_LIBRARIES DBUS_SYSTEM_INCLUDES DBUS_LIB_INCLUDES DBUS_DEFINITIONS)
diff --git a/CMake/FindEGL.cmake b/CMake/FindEGL.cmake
deleted file mode 100644
index c044d1ce..00000000
--- a/CMake/FindEGL.cmake
+++ /dev/null
@@ -1,41 +0,0 @@
-#.rst:
-# FindEGL
-# -------
-#
-# Find EGL library
-#
-# Try to find EGL library. The following values are defined
-#
-# ::
-#
-# EGL_FOUND - True if egl is available
-# EGL_INCLUDE_DIRS - Include directories for egl
-# EGL_LIBRARIES - List of libraries for egl
-# EGL_DEFINITIONS - List of definitions for egl
-#
-#=============================================================================
-# Copyright (c) 2015 Jari Vetoniemi
-#
-# Distributed under the OSI-approved BSD License (the "License");
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-include(FeatureSummary)
-set_package_properties(EGL PROPERTIES
- URL "http://www.khronos.org/egl/"
- DESCRIPTION "Native Platform Interface")
-
-find_package(PkgConfig)
-pkg_check_modules(PC_EGL QUIET egl)
-find_library(EGL_LIBRARIES NAMES egl EGL HINTS ${PC_EGL_LIBRARY_DIRS})
-find_path(EGL_INCLUDE_DIRS NAMES EGL/egl.h HINTS ${PC_EGL_INCLUDE_DIRS})
-
-set(EGL_DEFINITIONS ${PC_EGL_CFLAGS_OTHER})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARIES EGL_INCLUDE_DIRS)
-mark_as_advanced(EGL_INCLUDE_DIRS EGL_LIBRARIES EGL_DEFINITIONS)
-
diff --git a/CMake/FindGBM.cmake b/CMake/FindGBM.cmake
deleted file mode 100644
index 85df1f7c..00000000
--- a/CMake/FindGBM.cmake
+++ /dev/null
@@ -1,39 +0,0 @@
-#.rst:
-# FindGBM
-# -------
-#
-# Find GBM library
-#
-# Try to find GBM library on UNIX systems. The following values are defined
-#
-# ::
-#
-# GBM_FOUND - True if gbm is available
-# GBM_INCLUDE_DIRS - Include directories for gbm
-# GBM_LIBRARIES - List of libraries for gbm
-# GBM_DEFINITIONS - List of definitions for gbm
-#
-#=============================================================================
-# Copyright (c) 2015 Jari Vetoniemi
-#
-# Distributed under the OSI-approved BSD License (the "License");
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-set_package_properties(GBM PROPERTIES
- URL "http://www.mesa3d.org/"
- DESCRIPTION "Generic buffer manager")
-
-find_package(PkgConfig)
-pkg_check_modules(PC_GBM QUIET gbm)
-find_library(GBM_LIBRARIES NAMES gbm HINTS ${PC_GBM_LIBRARY_DIRS})
-find_path(GBM_INCLUDE_DIRS gbm.h HINTS ${PC_GBM_INCLUDE_DIRS})
-
-set(GBM_DEFINITIONS ${PC_GBM_CFLAGS_OTHER})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(GBM DEFAULT_MSG GBM_INCLUDE_DIRS GBM_LIBRARIES)
-mark_as_advanced(GBM_INCLUDE_DIRS GBM_LIBRARIES GBM_DEFINITIONS)
diff --git a/CMake/FindGLESv2.cmake b/CMake/FindGLESv2.cmake
deleted file mode 100644
index c2120efa..00000000
--- a/CMake/FindGLESv2.cmake
+++ /dev/null
@@ -1,41 +0,0 @@
-#.rst:
-# FindGLESv2
-# -------
-#
-# Find GLESv2 library
-#
-# Try to find GLESv2 library. The following values are defined
-#
-# ::
-#
-# GLESv2_FOUND - True if glesv2 is available
-# GLESv2_INCLUDE_DIRS - Include directories for glesv2
-# GLESv2_LIBRARIES - List of libraries for glesv2
-# GLESv2_DEFINITIONS - List of definitions for glesv2
-#
-#=============================================================================
-# Copyright (c) 2015 Jari Vetoniemi
-#
-# Distributed under the OSI-approved BSD License (the "License");
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-include(FeatureSummary)
-set_package_properties(GLESv2 PROPERTIES
- URL "https://www.khronos.org/opengles/"
- DESCRIPTION "The Standard for Embedded Accelerated 3D Graphics")
-
-find_package(PkgConfig)
-pkg_check_modules(PC_GLES2 QUIET glesv2)
-find_library(GLESv2_LIBRARIES NAMES GLESv2 ${PC_GLES2_LIBRARY_DIRS})
-find_path(GLESv2_INCLUDE_DIRS NAMES GLES2/gl2.h HINTS ${PC_GLES2_INCLUDE_DIRS})
-
-set(GLESv2_DEFINITIONS ${PC_GLES2_CFLAGS_OTHER})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(GLESv2 DEFAULT_MSG GLESv2_LIBRARIES GLESv2_INCLUDE_DIRS)
-mark_as_advanced(GLESv2_INCLUDE_DIRS GLESv2_LIBRARIES GLESv2_DEFINITIONS)
-
diff --git a/CMake/FindLibInput.cmake b/CMake/FindLibInput.cmake
deleted file mode 100644
index 8e3b222b..00000000
--- a/CMake/FindLibInput.cmake
+++ /dev/null
@@ -1,72 +0,0 @@
-#.rst:
-# FindLibInput
-# -------
-#
-# Find LibInput library
-#
-# Try to find LibInpu library. The following values are defined
-#
-# ::
-#
-# LIBINPUT_FOUND - True if libinput is available
-# LIBINPUT_INCLUDE_DIRS - Include directories for libinput
-# LIBINPUT_LIBRARIES - List of libraries for libinput
-# LIBINPUT_DEFINITIONS - List of definitions for libinput
-#
-# and also the following more fine grained variables
-#
-# ::
-#
-# LIBINPUT_VERSION
-# LIBINPUT_VERSION_MAJOR
-# LIBINPUT_VERSION_MINOR
-# LIBINPUT_VERSION_MICRO
-#
-#=============================================================================
-# Copyright (c) 2015 Jari Vetoniemi
-#
-# Distributed under the OSI-approved BSD License (the "License");
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-include(FeatureSummary)
-set_package_properties(LibInput PROPERTIES
- URL "http://freedesktop.org/wiki/Software/libinput/"
- DESCRIPTION "Library to handle input devices")
-
-find_package(PkgConfig)
-pkg_check_modules(PC_INPUT QUIET libinput)
-find_library(LIBINPUT_LIBRARIES NAMES input HINTS ${PC_INPUT_LIBRARY_DIRS})
-find_path(LIBINPUT_INCLUDE_DIRS libinput.h HINTS ${PC_INPUT_INCLUDE_DIRS})
-
-set(LIBINPUT_VERSION ${PC_INPUT_VERSION})
-string(REPLACE "." ";" VERSION_LIST "${PC_INPUT_VERSION}")
-
-LIST(LENGTH VERSION_LIST n)
-if (n EQUAL 3)
- list(GET VERSION_LIST 0 LIBINPUT_VERSION_MAJOR)
- list(GET VERSION_LIST 1 LIBINPUT_VERSION_MINOR)
- list(GET VERSION_LIST 2 LIBINPUT_VERSION_MICRO)
-else ()
- set(LIBINPUT_VERSION "9999.9999.9999")
- set(LIBINPUT_VERSION_MAJOR 9999)
- set(LIBINPUT_VERSION_MINOR 9999)
- set(LIBINPUT_VERSION_MICRO 9999)
- message(WARNING "Could not detect libinput version, assuming you have recent one")
-endif ()
-
-# This is compatible with libinput-version.h that exists in upstream
-# but isn't in distribution (probably forgotten)
-set(LIBINPUT_DEFINITIONS ${PC_INPUT_CFLAGS_OTHER}
- -DLIBINPUT_VERSION=\"${LIBINPUT_VERSION}\"
- -DLIBINPUT_VERSION_MAJOR=${LIBINPUT_VERSION_MAJOR}
- -DLIBINPUT_VERSION_MINOR=${LIBINPUT_VERSION_MINOR}
- -DLIBINPUT_VERSION_MICRO=${LIBINPUT_VERSION_MICRO})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(LIBINPUT DEFAULT_MSG LIBINPUT_INCLUDE_DIRS LIBINPUT_LIBRARIES)
-mark_as_advanced(LIBINPUT_INCLUDE_DIRS LIBINPUT_LIBRARIES LIBINPUT_DEFINITIONS
- LIBINPUT_VERSION LIBINPUT_VERSION_MAJOR LIBINPUT_VERSION_MICRO LIBINPUT_VERSION_MINOR)
diff --git a/CMake/FindLibcap.cmake b/CMake/FindLibcap.cmake
deleted file mode 100644
index b34e5e37..00000000
--- a/CMake/FindLibcap.cmake
+++ /dev/null
@@ -1,56 +0,0 @@
-#.rst:
-# FindLibcap
-# -------
-#
-# Find Libcap library
-#
-# Try to find Libcap library. The following values are defined
-#
-# ::
-#
-# Libcap_FOUND - True if Libcap is available
-# Libcap_INCLUDE_DIRS - Include directories for Libcap
-# Libcap_LIBRARIES - List of libraries for Libcap
-# Libcap_DEFINITIONS - List of definitions for Libcap
-#
-# and also the following more fine grained variables
-#
-# ::
-#
-# Libcap_VERSION
-# Libcap_VERSION_MAJOR
-# Libcap_VERSION_MINOR
-#
-#=============================================================================
-# Copyright (c) 2017 Jerzi Kaminsky
-#
-# Distributed under the OSI-approved BSD License (the "License");
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-include(FeatureSummary)
-set_package_properties(Libcap PROPERTIES
- URL "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2"
- DESCRIPTION "Library for getting and setting POSIX.1e capabilities")
-
-find_package(PkgConfig)
-pkg_check_modules(PC_CAP QUIET Libcap)
-find_library(Libcap_LIBRARIES NAMES cap HINTS ${PC_CAP_LIBRARY_DIRS})
-find_path(Libcap_INCLUDE_DIRS sys/capability.h HINTS ${PC_CAP_INCLUDE_DIRS})
-
-set(Libcap_VERSION ${PC_CAP_VERSION})
-string(REPLACE "." ";" VERSION_LIST "${PC_CAP_VERSION}")
-
-LIST(LENGTH VERSION_LIST n)
-if (n EQUAL 2)
- list(GET VERSION_LIST 0 Libcap_VERSION_MAJOR)
- list(GET VERSION_LIST 1 Libcap_VERSION_MINOR)
-endif ()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Libcap DEFAULT_MSG Libcap_INCLUDE_DIRS Libcap_LIBRARIES)
-mark_as_advanced(Libcap_INCLUDE_DIRS Libcap_LIBRARIES Libcap_DEFINITIONS
- Libcap_VERSION Libcap_VERSION_MAJOR Libcap_VERSION_MICRO Libcap_VERSION_MINOR)
diff --git a/CMake/FindSystemd.cmake b/CMake/FindSystemd.cmake
deleted file mode 100644
index 09d60115..00000000
--- a/CMake/FindSystemd.cmake
+++ /dev/null
@@ -1,40 +0,0 @@
-#.rst:
-# FindSystemd
-# -------
-#
-# Find Systemd library
-#
-# Try to find Systemd library on UNIX systems. The following values are defined
-#
-# ::
-#
-# SYSTEMD_FOUND - True if Systemd is available
-# SYSTEMD_INCLUDE_DIRS - Include directories for Systemd
-# SYSTEMD_LIBRARIES - List of libraries for Systemd
-# SYSTEMD_DEFINITIONS - List of definitions for Systemd
-#
-#=============================================================================
-# Copyright (c) 2015 Jari Vetoniemi
-#
-# Distributed under the OSI-approved BSD License (the "License");
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-include(FeatureSummary)
-set_package_properties(Systemd PROPERTIES
- URL "http://freedesktop.org/wiki/Software/systemd/"
- DESCRIPTION "System and Service Manager")
-
-find_package(PkgConfig)
-pkg_check_modules(PC_SYSTEMD QUIET libsystemd)
-find_library(SYSTEMD_LIBRARIES NAMES systemd ${PC_SYSTEMD_LIBRARY_DIRS})
-find_path(SYSTEMD_INCLUDE_DIRS systemd/sd-login.h HINTS ${PC_SYSTEMD_INCLUDE_DIRS})
-
-set(SYSTEMD_DEFINITIONS ${PC_SYSTEMD_CFLAGS_OTHER})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(SYSTEMD DEFAULT_MSG SYSTEMD_INCLUDE_DIRS SYSTEMD_LIBRARIES)
-mark_as_advanced(SYSTEMD_INCLUDE_DIRS SYSTEMD_LIBRARIES SYSTEMD_DEFINITIONS)
diff --git a/CMake/FindUdev.cmake b/CMake/FindUdev.cmake
deleted file mode 100644
index dd97d8e0..00000000
--- a/CMake/FindUdev.cmake
+++ /dev/null
@@ -1,40 +0,0 @@
-#.rst:
-# FindUdev
-# -------
-#
-# Find udev library
-#
-# Try to find udev library on UNIX systems. The following values are defined
-#
-# ::
-#
-# UDEV_FOUND - True if udev is available
-# UDEV_INCLUDE_DIRS - Include directories for udev
-# UDEV_LIBRARIES - List of libraries for udev
-# UDEV_DEFINITIONS - List of definitions for udev
-#
-#=============================================================================
-# Copyright (c) 2015 Jari Vetoniemi
-#
-# Distributed under the OSI-approved BSD License (the "License");
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-include(FeatureSummary)
-set_package_properties(Udev PROPERTIES
- URL "https://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html"
- DESCRIPTION "Device manager for the Linux kernel")
-
-find_package(PkgConfig)
-pkg_check_modules(PC_UDEV QUIET libudev)
-find_library(UDEV_LIBRARIES NAMES udev HINTS ${PC_UDEV_LIBRARY_DIRS})
-find_path(UDEV_INCLUDE_DIRS libudev.h HINTS ${PC_UDEV_INCLUDE_DIRS})
-
-set(UDEV_DEFINITIONS ${PC_UDEV_CFLAGS_OTHER})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(UDEV DEFAULT_MSG UDEV_INCLUDE_DIRS UDEV_LIBRARIES)
-mark_as_advanced(UDEV_INCLUDE_DIRS UDEV_LIBRARIES UDEV_DEFINITIONS)
diff --git a/CMake/FindWayland.cmake b/CMake/FindWayland.cmake
deleted file mode 100644
index 465d2665..00000000
--- a/CMake/FindWayland.cmake
+++ /dev/null
@@ -1,69 +0,0 @@
-#.rst:
-# FindWayland
-# -----------
-#
-# Find Wayland installation
-#
-# Try to find Wayland. The following values are defined
-#
-# ::
-#
-# WAYLAND_FOUND - True if Wayland is found
-# WAYLAND_LIBRARIES - Link these to use Wayland
-# WAYLAND_INCLUDE_DIRS - Include directories for Wayland
-# WAYLAND_DEFINITIONS - Compiler flags for using Wayland
-#
-# and also the following more fine grained variables:
-#
-# ::
-#
-# WAYLAND_CLIENT_FOUND, WAYLAND_CLIENT_INCLUDE_DIRS, WAYLAND_CLIENT_LIBRARIES
-# WAYLAND_SERVER_FOUND, WAYLAND_SERVER_INCLUDE_DIRS, WAYLAND_SERVER_LIBRARIES
-# WAYLAND_EGL_FOUND, WAYLAND_EGL_INCLUDE_DIRS, WAYLAND_EGL_LIBRARIES
-#
-#=============================================================================
-# Copyright (c) 2015 Jari Vetoniemi
-# 2013 Martin Gräßlin <mgraesslin@kde.org>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-include(FeatureSummary)
-set_package_properties(Wayland PROPERTIES
- URL "http://wayland.freedesktop.org/"
- DESCRIPTION "Protocol for implementing compositors")
-
-find_package(PkgConfig)
-pkg_check_modules(PC_WAYLAND QUIET wayland-client>=1.7 wayland-server>=1.7 wayland-egl)
-
-find_library(WAYLAND_CLIENT_LIBRARIES NAMES wayland-client HINTS ${PC_WAYLAND_LIBRARY_DIRS})
-find_library(WAYLAND_SERVER_LIBRARIES NAMES wayland-server HINTS ${PC_WAYLAND_LIBRARY_DIRS})
-find_library(WAYLAND_EGL_LIBRARIES NAMES wayland-egl HINTS ${PC_WAYLAND_LIBRARY_DIRS})
-
-find_path(WAYLAND_CLIENT_INCLUDE_DIRS NAMES wayland-client.h HINTS ${PC_WAYLAND_INCLUDE_DIRS})
-find_path(WAYLAND_SERVER_INCLUDE_DIRS NAMES wayland-server.h HINTS ${PC_WAYLAND_INCLUDE_DIRS})
-find_path(WAYLAND_EGL_INCLUDE_DIRS NAMES wayland-egl.h HINTS ${PC_WAYLAND_INCLUDE_DIRS})
-
-set(WAYLAND_INCLUDE_DIRS ${WAYLAND_CLIENT_INCLUDE_DIRS} ${WAYLAND_SERVER_INCLUDE_DIRS} ${WAYLAND_EGL_INCLUDE_DIRS})
-set(WAYLAND_LIBRARIES ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES} ${WAYLAND_EGL_LIBRARIES})
-set(WAYLAND_DEFINITIONS ${PC_WAYLAND_CFLAGS})
-
-list(REMOVE_DUPLICATES WAYLAND_INCLUDE_DIRS)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(WAYLAND_CLIENT DEFAULT_MSG WAYLAND_CLIENT_LIBRARIES WAYLAND_CLIENT_INCLUDE_DIRS)
-find_package_handle_standard_args(WAYLAND_SERVER DEFAULT_MSG WAYLAND_SERVER_LIBRARIES WAYLAND_SERVER_INCLUDE_DIRS)
-find_package_handle_standard_args(WAYLAND_EGL DEFAULT_MSG WAYLAND_EGL_LIBRARIES WAYLAND_EGL_INCLUDE_DIRS)
-find_package_handle_standard_args(WAYLAND DEFAULT_MSG WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIRS)
-
-mark_as_advanced(
- WAYLAND_INCLUDE_DIRS WAYLAND_LIBRARIES
- WAYLAND_CLIENT_INCLUDE_DIRS WAYLAND_CLIENT_LIBRARIES
- WAYLAND_SERVER_INCLUDE_DIRS WAYLAND_SERVER_LIBRARIES
- WAYLAND_EGL_INCLUDE_DIRS WAYLAND_EGL_LIBRARIES
- WAYLAND_DEFINITIONS
- )
diff --git a/CMake/FindWaylandProtocols.cmake b/CMake/FindWaylandProtocols.cmake
deleted file mode 100644
index 8a8129b5..00000000
--- a/CMake/FindWaylandProtocols.cmake
+++ /dev/null
@@ -1,39 +0,0 @@
-#.rst:
-# FindWaylandProtocols
-# -------
-#
-# Find wayland protocol description files
-#
-# Try to find wayland protocol files. The following values are defined
-#
-# ::
-#
-# WAYLANDPROTOCOLS_FOUND - True if wayland protocol files are available
-# WAYLANDPROTOCOLS_PATH - Path to wayland protocol files
-#
-#=============================================================================
-# Copyright (c) 2015 Jari Vetoniemi
-#
-# Distributed under the OSI-approved BSD License (the "License");
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-include(FeatureSummary)
-set_package_properties(WaylandProtocols PROPERTIES
- URL "https://cgit.freedesktop.org/wayland/wayland-protocols"
- DESCRIPTION "Wayland protocol development")
-
-unset(WAYLANDPROTOCOLS_PATH)
-
-find_package(PkgConfig)
-if (PKG_CONFIG_FOUND)
- execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols
- OUTPUT_VARIABLE WAYLANDPROTOCOLS_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
-endif ()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(WaylandProtocols DEFAULT_MSG WAYLANDPROTOCOLS_PATH)
-mark_as_advanced(WAYLANDPROTOCOLS_PATH)
diff --git a/CMake/FindXKBCommon.cmake b/CMake/FindXKBCommon.cmake
deleted file mode 100644
index 30ac503a..00000000
--- a/CMake/FindXKBCommon.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
-# - Find XKBCommon
-# Once done, this will define
-#
-# XKBCOMMON_FOUND - System has XKBCommon
-# XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories
-# XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon
-# XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon
-
-find_package(PkgConfig)
-pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon)
-find_path(XKBCOMMON_INCLUDE_DIRS NAMES xkbcommon/xkbcommon.h HINTS ${PC_XKBCOMMON_INCLUDE_DIRS})
-find_library(XKBCOMMON_LIBRARIES NAMES xkbcommon HINTS ${PC_XKBCOMMON_LIBRARY_DIRS})
-
-set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(XKBCOMMON DEFAULT_MSG XKBCOMMON_LIBRARIES XKBCOMMON_INCLUDE_DIRS)
-mark_as_advanced(XKBCOMMON_LIBRARIES XKBCOMMON_INCLUDE_DIRS)
-
diff --git a/CMake/Manpage.cmake b/CMake/Manpage.cmake
deleted file mode 100644
index cc04d710..00000000
--- a/CMake/Manpage.cmake
+++ /dev/null
@@ -1,33 +0,0 @@
-find_package(A2X)
-
-if (A2X_FOUND)
- add_custom_target(man ALL)
-
- function(add_manpage name section)
- add_custom_command(
- OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}
- COMMAND ${A2X_COMMAND}
- --no-xmllint
- --doctype manpage
- --format manpage
- -D ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
- ${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt
- COMMENT Generating manpage for ${name}.${section}
- )
-
- add_custom_target(man-${name}.${section}
- DEPENDS
- ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}
- )
- add_dependencies(man
- man-${name}.${section}
- )
-
- install(
- FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}
- DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/man/man${section}
- COMPONENT documentation
- )
- endfunction()
-endif()
diff --git a/CMake/Wayland.cmake b/CMake/Wayland.cmake
deleted file mode 100644
index 6647c5ee..00000000
--- a/CMake/Wayland.cmake
+++ /dev/null
@@ -1,77 +0,0 @@
-#=============================================================================
-# Copyright (C) 2012-2013 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# * Neither the name of Pier Luigi Fiorini nor the names of his
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#=============================================================================
-
-find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner)
-
-# wayland_add_protocol_client(outfiles inputfile basename)
-function(WAYLAND_ADD_PROTOCOL_CLIENT _sources _protocol _basename)
- if(NOT WAYLAND_SCANNER_EXECUTABLE)
- message(FATAL "The wayland-scanner executable has not been found on your system. You must install it.")
- endif()
-
- get_filename_component(_infile ${_protocol} ABSOLUTE)
- set(_client_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-client-protocol.h")
- set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-protocol.c")
-
- add_custom_command(OUTPUT "${_client_header}"
- COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header < ${_infile} > ${_client_header}
- DEPENDS ${_infile} VERBATIM)
-
- add_custom_command(OUTPUT "${_code}"
- COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code < ${_infile} > ${_code}
- DEPENDS ${_infile} VERBATIM)
-
- list(APPEND ${_sources} "${_client_header}" "${_code}")
- set(${_sources} ${${_sources}} PARENT_SCOPE)
-endfunction()
-
-# wayland_add_protocol_server(outfiles inputfile basename)
-function(WAYLAND_ADD_PROTOCOL_SERVER _sources _protocol _basename)
- if(NOT WAYLAND_SCANNER_EXECUTABLE)
- message(FATAL "The wayland-scanner executable has not been found on your system. You must install it.")
- endif()
-
- get_filename_component(_infile ${_protocol} ABSOLUTE)
- set(_server_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-server-protocol.h")
- set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-protocol.c")
-
- add_custom_command(OUTPUT "${_server_header}"
- COMMAND ${WAYLAND_SCANNER_EXECUTABLE} server-header < ${_infile} > ${_server_header}
- DEPENDS ${_infile} VERBATIM)
-
- add_custom_command(OUTPUT "${_code}"
- COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code < ${_infile} > ${_code}
- DEPENDS ${_infile} VERBATIM)
-
- list(APPEND ${_sources} "${_server_header}" "${_code}")
- set(${_sources} ${${_sources}} PARENT_SCOPE)
-endfunction()
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index 8457d93c..00000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-cmake_minimum_required(VERSION 3.1.0)
-
-project(wlroots C)
-
-set(CMAKE_C_STANDARD 11)
-set(CMAKE_C_EXTENSIONS OFF)
-set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra")
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-field-initializers") # fuck off, clang
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-braces") # oh my god clang
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
-if (CMAKE_COMPILER_IS_GNUCC)
- if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wimplicit-fallthrough=0")
- endif()
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-lto-type-mismatch")
-endif()
-if (CMAKE_BUILD_TYPE MATCHES Release)
- # Some variables are only used for assertions
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable")
-endif()
-
-list(INSERT CMAKE_MODULE_PATH 0
- ${CMAKE_CURRENT_SOURCE_DIR}/CMake
-)
-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
- execute_process(
- COMMAND git describe --always --tags
- OUTPUT_VARIABLE GIT_COMMIT_HASH
- OUTPUT_STRIP_TRAILING_WHITESPACE
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- )
- execute_process(
- COMMAND git rev-parse --abbrev-ref HEAD
- OUTPUT_VARIABLE GIT_BRANCH
- OUTPUT_STRIP_TRAILING_WHITESPACE
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- )
-endif()
-
-add_definitions(-DWLR_GIT_VERSION=\"${GIT_COMMIT_HASH}\")
-add_definitions(-DWLR_GIT_BRANCH=\"${GIT_BRANCH}\")
-add_definitions(-DWLR_SRC_DIR=\"${CMAKE_SOURCE_DIR}\")
-
-string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC)
-add_definitions(-DWLR_VERSION_DATE=\"${CURRENT_DATE}\")
-
-find_package(Wayland REQUIRED)
-find_package(WaylandProtocols REQUIRED)
-find_package(EGL REQUIRED)
-find_package(GLESv2 REQUIRED)
-find_package(DRM REQUIRED)
-find_package(GBM REQUIRED)
-find_package(LibInput REQUIRED)
-find_package(XKBCommon REQUIRED)
-find_package(Udev REQUIRED)
-find_package(Libcap)
-find_package(Systemd)
-
-include(Wayland)
-include(Manpage)
-
-include_directories(include)
-
-add_subdirectory(backend)
-add_subdirectory(types)
-add_subdirectory(session)
-add_subdirectory(render)
-add_subdirectory(util)
-
-add_subdirectory(examples)
diff --git a/README.md b/README.md
index 9648f2c2..98c359fc 100644
--- a/README.md
+++ b/README.md
@@ -23,8 +23,5 @@ Install dependencies:
Run these commands:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release ..
- make
- sudo make install
+ meson build
+ ninja -C build
diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt
deleted file mode 100644
index 5486b302..00000000
--- a/backend/CMakeLists.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-include_directories(
- ${PROTOCOLS_INCLUDE_DIRS}
- ${WAYLAND_INCLUDE_DIR}
- ${DRM_INCLUDE_DIRS}
- ${LIBINPUT_INCLUDE_DIRS}
-)
-
-add_library(wlr-backend
- wayland/backend.c
- wayland/registry.c
- wayland/wl_seat.c
- wayland/output.c
- drm/backend.c
- drm/drm.c
-
- libinput/backend.c
- libinput/events.c
- libinput/keyboard.c
- libinput/pointer.c
- libinput/touch.c
- libinput/tablet_tool.c
- libinput/tablet_pad.c
-
- multi/backend.c
- backend.c
- egl.c
- udev.c
-)
-
-target_link_libraries(wlr-backend
- wlr-util
- wlr-types
- ${WAYLAND_LIBRARIES}
- ${DRM_LIBRARIES}
- ${GBM_LIBRARIES}
- ${GLESv2_LIBRARIES}
- ${EGL_LIBRARIES}
- ${SYSTEMD_LIBRARIES}
- ${UDEV_LIBRARIES}
- ${LIBINPUT_LIBRARIES}
- ${GBM_LIBRARIES}
-)
diff --git a/backend/meson.build b/backend/meson.build
new file mode 100644
index 00000000..02b79e65
--- /dev/null
+++ b/backend/meson.build
@@ -0,0 +1,19 @@
+wlr_files += files(
+ 'backend.c',
+ 'egl.c',
+ 'udev.c',
+ 'drm/backend.c',
+ 'drm/drm.c',
+ 'libinput/backend.c',
+ 'libinput/events.c',
+ 'libinput/keyboard.c',
+ 'libinput/pointer.c',
+ 'libinput/tablet_pad.c',
+ 'libinput/tablet_tool.c',
+ 'libinput/touch.c',
+ 'multi/backend.c',
+ 'wayland/backend.c',
+ 'wayland/output.c',
+ 'wayland/registry.c',
+ 'wayland/wl_seat.c',
+)
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
deleted file mode 100644
index f3f555c3..00000000
--- a/examples/CMakeLists.txt
+++ /dev/null
@@ -1,81 +0,0 @@
-include_directories(
- ${DRM_INCLUDE_DIRS}
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${XKBCOMMON_INCLUDE_DIRS}
-)
-
-add_executable(simple
- simple.c
- shared.c
-)
-
-target_link_libraries(simple
- wlr-backend
- wlr-session
- ${XKBCOMMON_LIBRARIES}
-)
-
-add_executable(rotation
- rotation.c
- shared.c
- cat.c
-)
-
-target_link_libraries(rotation
- wlr-backend
- wlr-session
- wlr-render
- ${XKBCOMMON_LIBRARIES}
-)
-
-add_executable(pointer
- pointer.c
- shared.c
- cat.c
-)
-
-target_link_libraries(pointer
- wlr-backend
- wlr-session
- wlr-render
- ${XKBCOMMON_LIBRARIES}
-)
-
-add_executable(touch
- touch.c
- shared.c
- cat.c
-)
-
-target_link_libraries(touch
- wlr-backend
- wlr-session
- wlr-render
- ${XKBCOMMON_LIBRARIES}
-)
-
-add_executable(tablet
- tablet.c
- shared.c
-)
-
-target_link_libraries(tablet
- wlr-backend
- wlr-session
- wlr-render
- ${XKBCOMMON_LIBRARIES}
-)
-
-add_executable(compositor
- compositor/main.c
- compositor/wl_compositor.c
- compositor/wl_shell.c
- shared.c
-)
-
-target_link_libraries(compositor
- wlr-backend
- wlr-session
- wlr-render
- ${XKBCOMMON_LIBRARIES}
-)
diff --git a/examples/meson.build b/examples/meson.build
new file mode 100644
index 00000000..ed49444f
--- /dev/null
+++ b/examples/meson.build
@@ -0,0 +1,17 @@
+lib_shared = static_library('shared',
+ ['shared.c', 'cat.c'],
+ dependencies: dep_wlr)
+
+executable('simple', 'simple.c', dependencies: dep_wlr, link_with: lib_shared)
+executable('rotation', 'rotation.c', dependencies: dep_wlr, link_with: lib_shared)
+executable('pointer', 'pointer.c', dependencies: dep_wlr, link_with: lib_shared)
+executable('touch', 'touch.c', dependencies: dep_wlr, link_with: lib_shared)
+executable('tablet', 'tablet.c', dependencies: dep_wlr, link_with: lib_shared)
+
+compositor_src = [
+ 'compositor/main.c',
+ 'compositor/wl_compositor.c',
+ 'compositor/wl_shell.c',
+]
+
+executable('compositor', compositor_src, dependencies: dep_wlr, link_with: lib_shared)
diff --git a/meson.build b/meson.build
new file mode 100644
index 00000000..9d603e22
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,77 @@
+project('wlroots', 'c',
+ license: 'MIT',
+ default_options: 'c_std=c11')
+
+add_project_arguments('-Wall', '-Wextra', '-Wno-unused-parameter', '-Werror', language: 'c')
+add_project_arguments('-DWLR_SRC_DIR="@0@"'.format(meson.source_root()), language: 'c')
+add_project_link_arguments('-Wl,-rpath,@0@'.format(meson.build_root()), language: 'c')
+
+wlr_inc = include_directories('include')
+
+#add_project_arguments('-flto', language: 'c')
+#add_project_link_arguments('-flto', language: 'c')
+
+cc = meson.get_compiler('c')
+
+# Clang complains about some zeroed initialiser lists (= {0}), even though they are valid
+if cc.get_id() == 'clang'
+ add_project_arguments('-Wno-missing-field-initializers', language: 'c')
+ add_project_arguments('-Wno-missing-braces', language: 'c')
+endif
+
+dep_wayland_server = dependency('wayland-server')
+dep_wayland_client = dependency('wayland-client')
+dep_wayland_egl = dependency('wayland-egl')
+dep_wayland_proto = dependency('wayland-protocols')
+dep_egl = dependency('egl')
+dep_glesv2 = dependency('glesv2')
+dep_drm = dependency('libdrm')
+dep_gbm = dependency('gbm')
+dep_libinput = dependency('libinput')
+dep_xkbcommon = dependency('xkbcommon')
+dep_udev = dependency('libudev')
+dep_libcap = dependency('libcap', required: false)
+dep_systemd = dependency('libsystemd', required: false)
+dep_math = cc.find_library('m', required: false)
+
+all_deps = [
+ dep_wayland_server,
+ dep_wayland_client,
+ dep_wayland_egl,
+ dep_wayland_proto,
+ dep_egl,
+ dep_glesv2,
+ dep_drm,
+ dep_gbm,
+ dep_libinput,
+ dep_xkbcommon,
+ dep_udev,
+ dep_libcap,
+ dep_systemd,
+ dep_math,
+]
+
+if dep_libcap.found()
+ add_project_arguments('-DHAS_LIBCAP', language: 'c')
+endif
+
+if dep_systemd.found()
+ add_project_arguments('-DHAS_SYSTEMD', language: 'c')
+endif
+
+wlr_files = []
+
+subdir('backend')
+subdir('render')
+subdir('session')
+subdir('types')
+subdir('util')
+
+lib_wlr = library('wlroots', wlr_files,
+ dependencies: all_deps,
+ include_directories: wlr_inc)
+dep_wlr = declare_dependency(link_with: lib_wlr,
+ dependencies: all_deps,
+ include_directories: wlr_inc)
+
+subdir('examples')
diff --git a/render/CMakeLists.txt b/render/CMakeLists.txt
deleted file mode 100644
index d412ddbc..00000000
--- a/render/CMakeLists.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-add_library(wlr-render
- matrix.c
- wlr_renderer.c
- wlr_surface.c
- gles2/shaders.c
- gles2/renderer.c
- gles2/surface.c
- gles2/pixel_format.c
- gles2/util.c
-)
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index 897dc3b8..f2a57a56 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -123,7 +123,11 @@ static void draw_quad() {
static bool wlr_gles2_render_surface(struct wlr_renderer_state *state,
struct wlr_surface *surface, const float (*matrix)[16]) {
- assert(surface && surface->valid);
+ if(!surface || !surface->valid) {
+ wlr_log(L_ERROR, "attempt to render invalid surface");
+ return false;
+ }
+
wlr_surface_bind(surface);
GL_CALL(glUniformMatrix4fv(0, 1, GL_FALSE, *matrix));
// TODO: source alpha from somewhere else I guess
diff --git a/render/meson.build b/render/meson.build
new file mode 100644
index 00000000..2fdba62c
--- /dev/null
+++ b/render/meson.build
@@ -0,0 +1,10 @@
+wlr_files += files(
+ 'matrix.c',
+ 'wlr_renderer.c',
+ 'wlr_surface.c',
+ 'gles2/pixel_format.c',
+ 'gles2/renderer.c',
+ 'gles2/shaders.c',
+ 'gles2/surface.c',
+ 'gles2/util.c',
+)
diff --git a/session/CMakeLists.txt b/session/CMakeLists.txt
deleted file mode 100644
index bacd412f..00000000
--- a/session/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-include_directories(
- ${WAYLAND_INCLUDE_DIR}
- ${DRM_INCLUDE_DIRS}
-)
-
-set(sources
- session.c
- direct.c
- direct-ipc.c
-)
-
-set(libs
- wlr-util
- ${WAYLAND_LIBRARIES}
-)
-
-if (SYSTEMD_FOUND)
- add_definitions(${SYSTEMD_DEFINITIONS})
- include_directories(${SYSTEMD_INCLUDE_DIRS})
-
- add_definitions(-DHAS_SYSTEMD)
- list(APPEND sources logind.c)
- list(APPEND libs ${SYSTEMD_LIBRARIES})
-endif ()
-
-if (Libcap_FOUND)
- add_definitions(${Libcap_DEFINITIONS})
- include_directories(${Libcap_INCLUDE_DIRS})
-
- add_definitions(-DHAS_LIBCAP)
- list(APPEND libs ${Libcap_LIBRARIES})
-endif ()
-
-add_library(wlr-session ${sources})
-target_link_libraries(wlr-session ${libs})
diff --git a/session/meson.build b/session/meson.build
new file mode 100644
index 00000000..4521cff6
--- /dev/null
+++ b/session/meson.build
@@ -0,0 +1,9 @@
+wlr_files += files(
+ 'direct-ipc.c',
+ 'direct.c',
+ 'session.c',
+)
+
+if dep_systemd.found()
+ wlr_files += files('logind.c')
+endif
diff --git a/types/CMakeLists.txt b/types/CMakeLists.txt
deleted file mode 100644
index 648db820..00000000
--- a/types/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-include_directories(
- ${PROTOCOLS_INCLUDE_DIRS}
- ${WAYLAND_INCLUDE_DIR}
-)
-
-add_library(wlr-types
- wlr_output.c
- wlr_input_device.c
- wlr_keyboard.c
- wlr_pointer.c
- wlr_touch.c
- wlr_tablet_tool.c
- wlr_tablet_pad.c
-)
-
-target_link_libraries(wlr-types
- wlr-util
- wlr-render
- ${WAYLAND_LIBRARIES}
-)
diff --git a/types/meson.build b/types/meson.build
new file mode 100644
index 00000000..323806c6
--- /dev/null
+++ b/types/meson.build
@@ -0,0 +1,9 @@
+wlr_files += files(
+ 'wlr_input_device.c',
+ 'wlr_keyboard.c',
+ 'wlr_output.c',
+ 'wlr_pointer.c',
+ 'wlr_tablet_pad.c',
+ 'wlr_tablet_tool.c',
+ 'wlr_touch.c',
+)
diff --git a/types/wlr_output.c b/types/wlr_output.c
index 434a1d9a..fecfe5de 100644
--- a/types/wlr_output.c
+++ b/types/wlr_output.c
@@ -206,7 +206,7 @@ bool wlr_output_set_cursor(struct wlr_output *output,
output->cursor.texture = wlr_render_surface_init(output->cursor.renderer);
}
- wlr_surface_attach_pixels(output->cursor.texture, WL_SHM_FORMAT_XBGR8888,
+ wlr_surface_attach_pixels(output->cursor.texture, WL_SHM_FORMAT_ABGR8888,
stride, width, height, buf);
return true;
diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt
deleted file mode 100644
index 5a057889..00000000
--- a/util/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-add_library(wlr-util STATIC
- list.c
- log.c
-)
-
-target_link_libraries(wlr-util m)
diff --git a/util/meson.build b/util/meson.build
new file mode 100644
index 00000000..7b80c23f
--- /dev/null
+++ b/util/meson.build
@@ -0,0 +1,4 @@
+wlr_files += files(
+ 'list.c',
+ 'log.c',
+)