From bff0746d7ff9501235e0c6f2707c8c6b5fb07577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Sat, 4 May 2024 09:29:21 +0200 Subject: [PATCH 1/4] build: Indent by two spaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guido Günther Part-of: --- meson.build | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/meson.build b/meson.build index 8ed256ecf..279ca5abb 100644 --- a/meson.build +++ b/meson.build @@ -58,28 +58,28 @@ gmobile_dep = dependency('gmobile', embed_wlroots = get_option('embed-wlroots') if not embed_wlroots.disabled() - # Try first to find wlroots as a subproject, then as a system dependency - wlroots_proj = subproject( - 'wlroots', - default_options: ['examples=false', 'renderers=gles2'], - required: false, - ) - - if embed_wlroots.enabled() and not wlroots_proj.found() - error('Wlroots subproject not found but enabled') - endif + # Try first to find wlroots as a subproject, then as a system dependency + wlroots_proj = subproject( + 'wlroots', + default_options: ['examples=false', 'renderers=gles2'], + required: false, + ) + + if embed_wlroots.enabled() and not wlroots_proj.found() + error('Wlroots subproject not found but enabled') + endif endif if not embed_wlroots.disabled() and wlroots_proj.found() - wlroots = wlroots_proj.get_variable('wlroots') + wlroots = wlroots_proj.get_variable('wlroots') else - wlroots = dependency('wlroots', version: ['>= 0.17.0', '< 0.18.0']) + wlroots = dependency('wlroots', version: ['>= 0.17.0', '< 0.18.0']) endif wlroots_has_xwayland = wlroots.get_variable(pkgconfig: 'have_xwayland', internal: 'have_xwayland') == 'true' if get_option('xwayland').enabled() and not wlroots_has_xwayland - error('Cannot enable Xwayland in phoc: wlroots has been built without Xwayland support') + error('Cannot enable Xwayland in phoc: wlroots has been built without Xwayland support') endif have_xwayland = get_option('xwayland').enabled() -- GitLab From de7babafad18be29259ac53a440bf01be94775c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Sat, 4 May 2024 09:26:02 +0200 Subject: [PATCH 2/4] build: The wlroots library is a subproject wrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: e9b9ef02 ("build: Use meson wrap for the wlroots submodule") Signed-off-by: Guido Günther Part-of: --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 279ca5abb..93ea3746c 100644 --- a/meson.build +++ b/meson.build @@ -187,7 +187,7 @@ configure_file( summary({ 'wlroots version': wlroots.version(), - 'wlroots as submodule': not embed_wlroots.disabled() and wlroots_proj.found(), + 'wlroots as subproject': not embed_wlroots.disabled() and wlroots_proj.found(), 'Xwayland': have_xwayland, 'Documentation': get_option('gtk_doc'), 'Manual pages': get_option('man'), -- GitLab From f7bd5441382f06cfa79443e71b83d9ecce2734d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Sat, 4 May 2024 09:24:26 +0200 Subject: [PATCH 3/4] build: Add tests to summary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guido Günther Part-of: --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 93ea3746c..66a24f076 100644 --- a/meson.build +++ b/meson.build @@ -192,6 +192,7 @@ summary({ 'Documentation': get_option('gtk_doc'), 'Manual pages': get_option('man'), 'Tracing': use_dtrace, + 'Tests': get_option('tests'), }, bool_yn: true, section: 'Build', -- GitLab From 6b75d2fffa1c0d72773d6753fbcf85be061db5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Sat, 4 May 2024 09:08:59 +0200 Subject: [PATCH 4/4] build: Separate generated sources and headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reduces the number of build steps from 465 to 222 (when linking against a shared wlroots). Signed-off-by: Guido Günther Part-of: --- src/meson.build | 20 ++++++++++++++------ tests/meson.build | 7 ++++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/meson.build b/src/meson.build index 62cb63f61..95c51e3f0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -109,13 +109,20 @@ sources = files( 'xdg-toplevel-decoration.c', 'xdg-toplevel-decoration.h', ) + phoc_anim_sources + libphoc_generated_sources = [ + phoc_anim_enum_sources[0], + phoc_enum_sources[0], + phoc_marshalers[0], + protos_sources, +] + +libphoc_generated_headers = [ phoc_config_h, - phoc_anim_enum_sources, - phoc_enum_sources, - phoc_marshalers, + phoc_anim_enum_sources[1], + phoc_enum_sources[1], + phoc_marshalers[1], server_protos_headers, - protos_sources, ] phoc_deps = [ @@ -145,6 +152,7 @@ phoc_lib = both_libraries( 'phoc', sources, libphoc_generated_sources, + libphoc_generated_headers, include_directories: phoc_anim_inc, dependencies: phoc_deps, install: false, @@ -156,7 +164,7 @@ libphoc_dep = declare_dependency( protocol_inc], link_with: phoc_lib, dependencies: phoc_deps, - sources: libphoc_generated_sources) + sources: libphoc_generated_headers) libphoc_static_dep = declare_dependency( include_directories: [include_directories('.'), @@ -164,7 +172,7 @@ libphoc_static_dep = declare_dependency( protocol_inc], link_with: phoc_lib.get_static_lib(), dependencies: phoc_deps, - sources: libphoc_generated_sources) + sources: libphoc_generated_headers) if get_option('gtk_doc') phoc_gir_extra_args = [ diff --git a/tests/meson.build b/tests/meson.build index 900c765ee..71b141fdc 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -56,7 +56,12 @@ phoctest_sources = [ 'testlib-layer-shell.c', ] -phoctest_lib = static_library('phoctest', phoctest_sources, client_protos_headers, +phoctest_lib = static_library('phoctest', + [ + phoctest_sources, + client_protos_headers, + protos_sources, + ], c_args: test_cflags, dependencies: [libphoc_dep, wayland_client]) -- GitLab