mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	Merge pull request #526 from besser82/bugfix/config_header_avoid_clashes
Further improvements to header files and shared lib version
This commit is contained in:
		
						commit
						fea5aee9cf
					
				
					 18 changed files with 52 additions and 23 deletions
				
			
		| 
						 | 
					@ -18,7 +18,7 @@
 | 
				
			||||||
#include <linux/major.h>
 | 
					#include <linux/major.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#include <xf86drm.h>
 | 
					#include <xf86drm.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/util/log.h>
 | 
					#include <wlr/util/log.h>
 | 
				
			||||||
#include "backend/session/direct-ipc.h"
 | 
					#include "backend/session/direct-ipc.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,7 +10,7 @@
 | 
				
			||||||
#include <sys/stat.h>
 | 
					#include <sys/stat.h>
 | 
				
			||||||
#include <fcntl.h>
 | 
					#include <fcntl.h>
 | 
				
			||||||
#include <wayland-server.h>
 | 
					#include <wayland-server.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/backend/session/interface.h>
 | 
					#include <wlr/backend/session/interface.h>
 | 
				
			||||||
#include <wlr/util/log.h>
 | 
					#include <wlr/util/log.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,7 +9,7 @@
 | 
				
			||||||
#include <wayland-server.h>
 | 
					#include <wayland-server.h>
 | 
				
			||||||
#include <xf86drm.h>
 | 
					#include <xf86drm.h>
 | 
				
			||||||
#include <xf86drmMode.h>
 | 
					#include <xf86drmMode.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/backend/session.h>
 | 
					#include <wlr/backend/session.h>
 | 
				
			||||||
#include <wlr/backend/session/interface.h>
 | 
					#include <wlr/backend/session/interface.h>
 | 
				
			||||||
#include <wlr/util/log.h>
 | 
					#include <wlr/util/log.h>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,9 +7,10 @@
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <unistd.h>
 | 
					#include <unistd.h>
 | 
				
			||||||
#include <sys/param.h>
 | 
					#include <sys/param.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/util/log.h>
 | 
					#include <wlr/util/log.h>
 | 
				
			||||||
#include <wlr/types/wlr_box.h>
 | 
					#include <wlr/types/wlr_box.h>
 | 
				
			||||||
 | 
					#include "support/config.h"
 | 
				
			||||||
#include "shared.h"
 | 
					#include "shared.h"
 | 
				
			||||||
#include "ini.h"
 | 
					#include "ini.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1
									
								
								include/meson.build
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								include/meson.build
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					subdir('wlr')
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
#define _ROOTSTON_DESKTOP_H
 | 
					#define _ROOTSTON_DESKTOP_H
 | 
				
			||||||
#include <time.h>
 | 
					#include <time.h>
 | 
				
			||||||
#include <wayland-server.h>
 | 
					#include <wayland-server.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/types/wlr_output.h>
 | 
					#include <wlr/types/wlr_output.h>
 | 
				
			||||||
#include <wlr/types/wlr_output_layout.h>
 | 
					#include <wlr/types/wlr_output_layout.h>
 | 
				
			||||||
#include <wlr/types/wlr_compositor.h>
 | 
					#include <wlr/types/wlr_compositor.h>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#ifndef _ROOTSTON_SERVER_H
 | 
					#ifndef _ROOTSTON_SERVER_H
 | 
				
			||||||
#define _ROOTSTON_SERVER_H
 | 
					#define _ROOTSTON_SERVER_H
 | 
				
			||||||
#include <wayland-server.h>
 | 
					#include <wayland-server.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/backend.h>
 | 
					#include <wlr/backend.h>
 | 
				
			||||||
#include <wlr/backend/session.h>
 | 
					#include <wlr/backend/session.h>
 | 
				
			||||||
#include <wlr/types/wlr_data_device.h>
 | 
					#include <wlr/types/wlr_data_device.h>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
#define _ROOTSTON_VIEW_H
 | 
					#define _ROOTSTON_VIEW_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdbool.h>
 | 
					#include <stdbool.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/types/wlr_box.h>
 | 
					#include <wlr/types/wlr_box.h>
 | 
				
			||||||
#include <wlr/types/wlr_surface.h>
 | 
					#include <wlr/types/wlr_surface.h>
 | 
				
			||||||
#include <wlr/types/wlr_xdg_shell_v6.h>
 | 
					#include <wlr/types/wlr_xdg_shell_v6.h>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										14
									
								
								include/wlr/meson.build
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								include/wlr/meson.build
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					version_array = meson.project_version().split('.')
 | 
				
			||||||
 | 
					version_data = configuration_data()
 | 
				
			||||||
 | 
					version_data.set_quoted('WLR_VERSION_STR',   meson.project_version())
 | 
				
			||||||
 | 
					version_data.set('WLR_VERSION_MAJOR',        version_array[0])
 | 
				
			||||||
 | 
					version_data.set('WLR_VERSION_MINOR',        version_array[1])
 | 
				
			||||||
 | 
					version_data.set('WLR_VERSION_MICRO',        version_array[2])
 | 
				
			||||||
 | 
					version_data.set('WLR_VERSION_NUM',          '(WLR_VERSION_MAJOR << 16) | (WLR_VERSION_MINOR << 8) | WLR_VERSION_MICRO')
 | 
				
			||||||
 | 
					version_data.set('WLR_VERSION_API_CURRENT',  so_version[0])
 | 
				
			||||||
 | 
					version_data.set('WLR_VERSION_API_REVISION', so_version[1])
 | 
				
			||||||
 | 
					version_data.set('WLR_VERSION_API_AGE',      so_version[2])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					header_install_dir = 'include/@0@/wlr'.format(meson.project_name())
 | 
				
			||||||
 | 
					configure_file(output: 'config.h',  install_dir: header_install_dir, configuration: conf_data)
 | 
				
			||||||
 | 
					configure_file(output: 'version.h', install_dir: header_install_dir, configuration: version_data)
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <time.h>
 | 
					#include <time.h>
 | 
				
			||||||
#include <stdbool.h>
 | 
					#include <stdbool.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/types/wlr_compositor.h>
 | 
					#include <wlr/types/wlr_compositor.h>
 | 
				
			||||||
#include <wlr/types/wlr_seat.h>
 | 
					#include <wlr/types/wlr_seat.h>
 | 
				
			||||||
#include <xcb/xcb.h>
 | 
					#include <xcb/xcb.h>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										29
									
								
								meson.build
									
										
									
									
									
								
							
							
						
						
									
										29
									
								
								meson.build
									
										
									
									
									
								
							| 
						 | 
					@ -1,6 +1,7 @@
 | 
				
			||||||
project(
 | 
					project(
 | 
				
			||||||
	'wlroots',
 | 
						'wlroots',
 | 
				
			||||||
	'c',
 | 
						'c',
 | 
				
			||||||
 | 
						version: '0.0.1',
 | 
				
			||||||
	license: 'MIT',
 | 
						license: 'MIT',
 | 
				
			||||||
	meson_version: '>=0.43.0',
 | 
						meson_version: '>=0.43.0',
 | 
				
			||||||
	default_options: [
 | 
						default_options: [
 | 
				
			||||||
| 
						 | 
					@ -10,6 +11,11 @@ project(
 | 
				
			||||||
	],
 | 
						],
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Format of so_version is CURRENT, REVISION, AGE.
 | 
				
			||||||
 | 
					# See: https://autotools.io/libtool/version.html
 | 
				
			||||||
 | 
					# for a reference about clean library versioning.
 | 
				
			||||||
 | 
					so_version = ['0', '0', '0']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add_project_arguments('-Wno-unused-parameter', language: 'c')
 | 
					add_project_arguments('-Wno-unused-parameter', language: 'c')
 | 
				
			||||||
add_project_arguments(
 | 
					add_project_arguments(
 | 
				
			||||||
	'-DWLR_SRC_DIR="@0@"'.format(meson.source_root()),
 | 
						'-DWLR_SRC_DIR="@0@"'.format(meson.source_root()),
 | 
				
			||||||
| 
						 | 
					@ -80,19 +86,24 @@ if elogind.found() and get_option('enable_elogind')
 | 
				
			||||||
	conf_data.set('WLR_HAS_ELOGIND', true)
 | 
						conf_data.set('WLR_HAS_ELOGIND', true)
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exclude_files = []
 | 
					exclude_headers = []
 | 
				
			||||||
wlr_parts = []
 | 
					wlr_parts = []
 | 
				
			||||||
if get_option('enable_xwayland')
 | 
					if get_option('enable_xwayland')
 | 
				
			||||||
	subdir('xwayland')
 | 
						subdir('xwayland')
 | 
				
			||||||
	wlr_parts += [lib_wlr_xwayland]
 | 
						wlr_parts += [lib_wlr_xwayland]
 | 
				
			||||||
	conf_data.set('WLR_HAS_XWAYLAND', true)
 | 
						conf_data.set('WLR_HAS_XWAYLAND', true)
 | 
				
			||||||
 | 
						exclude_headers += 'xwayland.h'
 | 
				
			||||||
 | 
						exclude_headers += 'xwm.h'
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	exclude_files += ['xwayland.h', 'xwm.h']
 | 
						exclude_headers += 'xwayland.h'
 | 
				
			||||||
 | 
						exclude_headers += 'xwm.h'
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
configure_file(output: 'config.h', install_dir: 'include/wlr', configuration: conf_data)
 | 
					exclude_headers += 'meson.build'
 | 
				
			||||||
install_subdir('include/wlr', install_dir: 'include', exclude_files: exclude_files)
 | 
					header_install_dir = 'include/@0@'.format(meson.project_name())
 | 
				
			||||||
 | 
					install_subdir('include/wlr', install_dir: header_install_dir, exclude_files: exclude_headers)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					subdir('include')
 | 
				
			||||||
subdir('protocol')
 | 
					subdir('protocol')
 | 
				
			||||||
subdir('render')
 | 
					subdir('render')
 | 
				
			||||||
subdir('backend')
 | 
					subdir('backend')
 | 
				
			||||||
| 
						 | 
					@ -131,7 +142,8 @@ wlr_deps = [
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
lib_wlr = library(
 | 
					lib_wlr = library(
 | 
				
			||||||
	'wlroots',
 | 
						meson.project_name(),
 | 
				
			||||||
 | 
						version: '.'.join(so_version),
 | 
				
			||||||
	link_whole: wlr_parts,
 | 
						link_whole: wlr_parts,
 | 
				
			||||||
	dependencies: wlr_deps,
 | 
						dependencies: wlr_deps,
 | 
				
			||||||
	include_directories: wlr_inc,
 | 
						include_directories: wlr_inc,
 | 
				
			||||||
| 
						 | 
					@ -150,8 +162,9 @@ subdir('examples')
 | 
				
			||||||
pkgconfig = import('pkgconfig')
 | 
					pkgconfig = import('pkgconfig')
 | 
				
			||||||
pkgconfig.generate(
 | 
					pkgconfig.generate(
 | 
				
			||||||
	libraries: lib_wlr,
 | 
						libraries: lib_wlr,
 | 
				
			||||||
	version: '0.0.1',
 | 
						subdirs: '@0@'.format(meson.project_name()),
 | 
				
			||||||
	filebase: 'wlroots',
 | 
						version: meson.project_version(),
 | 
				
			||||||
	name: 'wlroots',
 | 
						filebase: meson.project_name(),
 | 
				
			||||||
 | 
						name: meson.project_name(),
 | 
				
			||||||
	description: 'Wayland compositor library',
 | 
						description: 'Wayland compositor library',
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,7 +9,7 @@
 | 
				
			||||||
#include <strings.h>
 | 
					#include <strings.h>
 | 
				
			||||||
#include <unistd.h>
 | 
					#include <unistd.h>
 | 
				
			||||||
#include <sys/param.h>
 | 
					#include <sys/param.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/util/log.h>
 | 
					#include <wlr/util/log.h>
 | 
				
			||||||
#include <wlr/types/wlr_box.h>
 | 
					#include <wlr/types/wlr_box.h>
 | 
				
			||||||
#include "rootston/config.h"
 | 
					#include "rootston/config.h"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,7 @@
 | 
				
			||||||
#include <time.h>
 | 
					#include <time.h>
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <math.h>
 | 
					#include <math.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/types/wlr_box.h>
 | 
					#include <wlr/types/wlr_box.h>
 | 
				
			||||||
#include <wlr/types/wlr_compositor.h>
 | 
					#include <wlr/types/wlr_compositor.h>
 | 
				
			||||||
#include <wlr/types/wlr_cursor.h>
 | 
					#include <wlr/types/wlr_cursor.h>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,7 @@
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <unistd.h>
 | 
					#include <unistd.h>
 | 
				
			||||||
#include <wayland-server.h>
 | 
					#include <wayland-server.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/backend.h>
 | 
					#include <wlr/backend.h>
 | 
				
			||||||
#include <wlr/backend/headless.h>
 | 
					#include <wlr/backend/headless.h>
 | 
				
			||||||
#include <wlr/backend/multi.h>
 | 
					#include <wlr/backend/multi.h>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <wayland-server.h>
 | 
					#include <wayland-server.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/types/wlr_xcursor_manager.h>
 | 
					#include <wlr/types/wlr_xcursor_manager.h>
 | 
				
			||||||
#include <wlr/util/log.h>
 | 
					#include <wlr/util/log.h>
 | 
				
			||||||
#include "rootston/xcursor.h"
 | 
					#include "rootston/xcursor.h"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <stdbool.h>
 | 
					#include <stdbool.h>
 | 
				
			||||||
#include <wayland-server.h>
 | 
					#include <wayland-server.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/types/wlr_box.h>
 | 
					#include <wlr/types/wlr_box.h>
 | 
				
			||||||
#include <wlr/types/wlr_surface.h>
 | 
					#include <wlr/types/wlr_surface.h>
 | 
				
			||||||
#include <wlr/xwayland.h>
 | 
					#include <wlr/xwayland.h>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,7 @@
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <wayland-server.h>
 | 
					#include <wayland-server.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include <wlr/types/wlr_xdg_shell_v6.h>
 | 
					#include <wlr/types/wlr_xdg_shell_v6.h>
 | 
				
			||||||
#include <wlr/types/wlr_surface.h>
 | 
					#include <wlr/types/wlr_surface.h>
 | 
				
			||||||
#include <wlr/types/wlr_seat.h>
 | 
					#include <wlr/types/wlr_seat.h>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@
 | 
				
			||||||
#include <xcb/xfixes.h>
 | 
					#include <xcb/xfixes.h>
 | 
				
			||||||
#include <xcb/xcb_image.h>
 | 
					#include <xcb/xcb_image.h>
 | 
				
			||||||
#include <xcb/render.h>
 | 
					#include <xcb/render.h>
 | 
				
			||||||
#include "config.h"
 | 
					#include <wlr/config.h>
 | 
				
			||||||
#include "wlr/util/log.h"
 | 
					#include "wlr/util/log.h"
 | 
				
			||||||
#include "wlr/util/edges.h"
 | 
					#include "wlr/util/edges.h"
 | 
				
			||||||
#include "wlr/types/wlr_surface.h"
 | 
					#include "wlr/types/wlr_surface.h"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue