From: Takashi Sakamoto Date: Wed, 16 Mar 2022 00:03:48 +0000 (+0900) Subject: meson: minor code refactoring for include directories X-Git-Tag: v0.3.0~258 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=1481b52bc7e7a27867beacadccf75d4e7d869fdf;p=alsa-gobject.git meson: minor code refactoring for include directories The path to include directory for installation is referred by several parts. This commit adds local variable for it. Signed-off-by: Takashi Sakamoto --- diff --git a/src/ctl/meson.build b/src/ctl/meson.build index 5bafe57..e9eff30 100644 --- a/src/ctl/meson.build +++ b/src/ctl/meson.build @@ -49,6 +49,8 @@ dependencies = [ libudev, ] +inc_dir = join_paths(meson.project_name(), path) + # Generate enumerations for GObject fashion. if has_enumerations enum_header = '@0@-enum-types.h'.format(name) @@ -57,7 +59,7 @@ if has_enumerations symbol_prefix: name, identifier_prefix: namespace, install_header: true, - install_dir: join_paths(get_option('includedir'), meson.project_name(), path), + install_dir: join_paths(get_option('includedir'), inc_dir), header_prefix: '#include <@0@-enum-types.h>'.format(join_paths(path, name)), ) sources += enums @@ -71,7 +73,7 @@ if has_marshaller sources: '@0@-sigs-marshal.list'.format(name), stdinc: true, install_header: true, - install_dir: join_paths(get_option('includedir'), meson.project_name(), path), + install_dir: join_paths(get_option('includedir'), inc_dir), ) sources += signal_marshallers endif @@ -93,7 +95,7 @@ library = library(name, ) install_headers(headers, - subdir: join_paths(meson.project_name(), path), + subdir: inc_dir, ) # Generate pkg-config file for development. diff --git a/src/hwdep/meson.build b/src/hwdep/meson.build index 38aa2d0..b3a766a 100644 --- a/src/hwdep/meson.build +++ b/src/hwdep/meson.build @@ -41,6 +41,8 @@ dependencies = [ libudev, ] +inc_dir = join_paths(meson.project_name(), path) + # Generate enumerations for GObject fashion. if has_enumerations enum_header = '@0@-enum-types.h'.format(name) @@ -49,7 +51,7 @@ if has_enumerations symbol_prefix: name, identifier_prefix: namespace, install_header: true, - install_dir: join_paths(get_option('includedir'), meson.project_name(), path), + install_dir: join_paths(get_option('includedir'), inc_dir), header_prefix: '#include <@0@-enum-types.h>'.format(join_paths(path, name)), ) sources += enums @@ -63,7 +65,7 @@ if has_marshaller sources: '@0@-sigs-marshal.list'.format(name), stdinc: true, install_header: true, - install_dir: join_paths(get_option('includedir'), meson.project_name(), path), + install_dir: join_paths(get_option('includedir'), inc_dir), ) sources += signal_marshallers endif @@ -85,7 +87,7 @@ library = library(name, ) install_headers(headers, - subdir: join_paths(meson.project_name(), path), + subdir: inc_dir, ) # Generate pkg-config file for development. diff --git a/src/rawmidi/meson.build b/src/rawmidi/meson.build index 3d45f7f..049bffd 100644 --- a/src/rawmidi/meson.build +++ b/src/rawmidi/meson.build @@ -47,6 +47,8 @@ dependencies = [ libudev, ] +inc_dir = join_paths(meson.project_name(), path) + # Generate enumerations for GObject fashion. if has_enumerations enum_header = '@0@-enum-types.h'.format(name) @@ -55,7 +57,7 @@ if has_enumerations symbol_prefix: name, identifier_prefix: namespace, install_header: true, - install_dir: join_paths(get_option('includedir'), meson.project_name(), path), + install_dir: join_paths(get_option('includedir'), inc_dir), header_prefix: '#include <@0@-enum-types.h>'.format(join_paths(path, name)), ) sources += enums @@ -69,7 +71,7 @@ if has_marshaller sources: '@0@-sigs-marshal.list'.format(name), stdinc: true, install_header: true, - install_dir: join_paths(get_option('includedir'), meson.project_name(), path), + install_dir: join_paths(get_option('includedir'), inc_dir), ) sources += signal_marshallers endif @@ -91,7 +93,7 @@ library = library(name, ) install_headers(headers, - subdir: join_paths(meson.project_name(), path), + subdir: inc_dir, ) # Generate pkg-config file for development. diff --git a/src/seq/meson.build b/src/seq/meson.build index 0407f6c..5c150f9 100644 --- a/src/seq/meson.build +++ b/src/seq/meson.build @@ -80,6 +80,8 @@ dependencies = [ alsatimer_dependency, ] +inc_dir = join_paths(meson.project_name(), path) + # Generate enumerations for GObject fashion. if has_enumerations enum_header = '@0@-enum-types.h'.format(name) @@ -88,7 +90,7 @@ if has_enumerations symbol_prefix: name, identifier_prefix: namespace, install_header: true, - install_dir: join_paths(get_option('includedir'), meson.project_name(), path), + install_dir: join_paths(get_option('includedir'), inc_dir), header_prefix: '#include <@0@-enum-types.h>'.format(join_paths(path, name)), ) sources += enums @@ -102,7 +104,7 @@ if has_marshaller sources: '@0@-sigs-marshal.list'.format(name), stdinc: true, install_header: true, - install_dir: join_paths(get_option('includedir'), meson.project_name(), path), + install_dir: join_paths(get_option('includedir'), inc_dir), ) sources += signal_marshallers endif @@ -124,7 +126,7 @@ library = library(name, ) install_headers(headers, - subdir: join_paths(meson.project_name(), path), + subdir: inc_dir, ) # Generate pkg-config file for development. diff --git a/src/timer/meson.build b/src/timer/meson.build index 7de7b24..cc21e90 100644 --- a/src/timer/meson.build +++ b/src/timer/meson.build @@ -61,6 +61,8 @@ dependencies = [ libudev, ] +inc_dir = join_paths(meson.project_name(), path) + # Generate enumerations for GObject fashion. if has_enumerations enum_header = '@0@-enum-types.h'.format(name) @@ -69,7 +71,7 @@ if has_enumerations symbol_prefix: name, identifier_prefix: namespace, install_header: true, - install_dir: join_paths(get_option('includedir'), meson.project_name(), path), + install_dir: join_paths(get_option('includedir'), inc_dir), header_prefix: '#include <@0@-enum-types.h>'.format(join_paths(path, name)), ) sources += enums @@ -83,7 +85,7 @@ if has_marshaller sources: '@0@-sigs-marshal.list'.format(name), stdinc: true, install_header: true, - install_dir: join_paths(get_option('includedir'), meson.project_name(), path), + install_dir: join_paths(get_option('includedir'), inc_dir), ) sources += signal_marshallers endif @@ -105,7 +107,7 @@ library = library(name, ) install_headers(headers, - subdir: join_paths(meson.project_name(), path), + subdir: inc_dir, ) # Generate pkg-config file for development.