From 6d4497371014cacbf0dc4ed9983fd6617ec25c9a Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 16 Mar 2020 16:47:05 -0700 Subject: [PATCH] meson: Deduplicate generation of wayland-version.h Signed-off-by: Matt Turner --- src/meson.build | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/meson.build b/src/meson.build index a61d40f6..2d1485c6 100644 --- a/src/meson.build +++ b/src/meson.build @@ -4,6 +4,14 @@ wayland_version_h.set('WAYLAND_VERSION', meson.project_version()) wayland_version_h.set('WAYLAND_VERSION_MAJOR', wayland_version[0].to_int()) wayland_version_h.set('WAYLAND_VERSION_MINOR', wayland_version[1].to_int()) wayland_version_h.set('WAYLAND_VERSION_MICRO', wayland_version[2].to_int()) +configure_file( + input: 'wayland-version.h.in', + output: 'wayland-version.h', + configuration: wayland_version_h, + install: get_option('libraries'), + install_dir: join_paths(get_option('prefix'), get_option('includedir')) +) + wayland_util = static_library( 'wayland-util', @@ -18,12 +26,6 @@ wayland_util_dep = declare_dependency( if get_option('scanner') # wayland-scanner - configure_file( - input: 'wayland-version.h.in', - output: 'wayland-version.h', - configuration: wayland_version_h, - ) - configure_file( input: '../protocol/wayland.dtd', output: 'wayland.dtd.embed', @@ -66,17 +68,6 @@ endif if get_option('libraries') # wayland libraries - # Duplicated inside the "if get_option('scanner')" block above since we - # still need the wayland-version.h to build the scanner, but do not want - # to install it. Meson 0.50 adds "install: bool" which will let us - # deduplicate this block. - configure_file( - input: 'wayland-version.h.in', - output: 'wayland-version.h', - configuration: wayland_version_h, - install_dir: join_paths(get_option('prefix'), get_option('includedir')) - ) - mathlib_dep = cc.find_library('m', required: false) threads_dep = dependency('threads', required: false)