]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
meson: code refactoring to remove useless assignments for include headers
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Wed, 16 Mar 2022 00:03:48 +0000 (09:03 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Thu, 17 Mar 2022 07:17:10 +0000 (16:17 +0900)
In meson build, gnome.mkenums_simple() and gnome.genmarshal()
voluntarily install headers, therefore it's useless to install
them explicitly by install_headers().

This commit removes useless assignments for include headers. I note that
gnome.generate_gir() fails to parse codes when enums are prior to
headers and sources. This commit also reorder entries for safe.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/ctl/meson.build
src/hwdep/meson.build
src/rawmidi/meson.build
src/seq/meson.build
src/timer/meson.build

index e9eff308f5c85f8054f9e430d20e581871fed06f..f98d7dd7b57a65f44b89a93f24f9e425d6b6b82a 100644 (file)
@@ -54,6 +54,7 @@ inc_dir = join_paths(meson.project_name(), path)
 # Generate enumerations for GObject fashion.
 if has_enumerations
   enum_header = '@0@-enum-types.h'.format(name)
+  headers += enum_header
   enums = gnome.mkenums_simple('@0@-enums'.format(name),
     sources: enum_header,
     symbol_prefix: name,
@@ -62,20 +63,21 @@ if has_enumerations
     install_dir: join_paths(get_option('includedir'), inc_dir),
     header_prefix: '#include <@0@-enum-types.h>'.format(join_paths(path, name)),
   )
-  sources += enums
-  headers += enum_header
+else
+  enums = []
 endif
 
 # Generate marshallers for GObject signals.
 if has_marshaller
-  signal_marshallers = gnome.genmarshal('@0@-sigs-marshal'.format(name),
+  marshallers = gnome.genmarshal('@0@-sigs-marshal'.format(name),
     prefix: '@0@_sigs_marshal'.format(name),
     sources: '@0@-sigs-marshal.list'.format(name),
     stdinc: true,
     install_header: true,
     install_dir: join_paths(get_option('includedir'), inc_dir),
   )
-  sources += signal_marshallers
+else
+  marshallers = []
 endif
 
 # Constrain public APIs by linker option.
@@ -84,7 +86,7 @@ mapfile_path = join_paths(meson.current_source_dir(), mapfile_name)
 linker_flag = '-Wl,--version-script,@0@'.format(mapfile_path)
 
 library = library(name,
-  sources: sources + headers + privates,
+  sources: sources + headers + privates + enums + marshallers,
   version: meson.project_version(),
   soversion: meson.project_version().split('.')[0],
   install: true,
@@ -107,7 +109,7 @@ pkg.generate(library,
 
 # Generate metadata for gobject introspection.
 gnome.generate_gir(library,
-  sources: sources + headers,
+  sources: enums + marshallers + headers + sources,
   nsversion: '0.0',
   namespace: namespace,
   symbol_prefix: '@0@_'.format(name),
index b3a766a2dce9fe0e637833a3e50eec189343b88d..cdbbbb8571267cf7919a84e8882582d40661d557 100644 (file)
@@ -46,6 +46,7 @@ inc_dir = join_paths(meson.project_name(), path)
 # Generate enumerations for GObject fashion.
 if has_enumerations
   enum_header = '@0@-enum-types.h'.format(name)
+  headers += enum_header
   enums = gnome.mkenums_simple('@0@-enums'.format(name),
     sources: enum_header,
     symbol_prefix: name,
@@ -54,20 +55,21 @@ if has_enumerations
     install_dir: join_paths(get_option('includedir'), inc_dir),
     header_prefix: '#include <@0@-enum-types.h>'.format(join_paths(path, name)),
   )
-  sources += enums
-  headers += enum_header
+else
+  enums = []
 endif
 
 # Generate marshallers for GObject signals.
 if has_marshaller
-  signal_marshallers = gnome.genmarshal('@0@-sigs-marshal'.format(name),
+  marshallers = gnome.genmarshal('@0@-sigs-marshal'.format(name),
     prefix: '@0@_sigs_marshal'.format(name),
     sources: '@0@-sigs-marshal.list'.format(name),
     stdinc: true,
     install_header: true,
     install_dir: join_paths(get_option('includedir'), inc_dir),
   )
-  sources += signal_marshallers
+else
+  marshallers = []
 endif
 
 # Constrain public APIs by linker option.
@@ -76,7 +78,7 @@ mapfile_path = join_paths(meson.current_source_dir(), mapfile_name)
 linker_flag = '-Wl,--version-script,@0@'.format(mapfile_path)
 
 library = library(name,
-  sources: sources + headers + privates,
+  sources: sources + headers + privates + enums + marshallers,
   version: meson.project_version(),
   soversion: meson.project_version().split('.')[0],
   install: true,
@@ -99,7 +101,7 @@ pkg.generate(library,
 
 # Generate metadata for gobject introspection.
 gnome.generate_gir(library,
-  sources: sources + headers,
+  sources: enums + headers + sources,
   nsversion: '0.0',
   namespace: namespace,
   symbol_prefix: '@0@_'.format(name),
index 049bffd511c07099d4ae8b8fa900d29d31238d74..30809a438d275bbd67478efdf0240f4163d2ce72 100644 (file)
@@ -52,6 +52,7 @@ inc_dir = join_paths(meson.project_name(), path)
 # Generate enumerations for GObject fashion.
 if has_enumerations
   enum_header = '@0@-enum-types.h'.format(name)
+  headers += enum_header
   enums = gnome.mkenums_simple('@0@-enums'.format(name),
     sources: enum_header,
     symbol_prefix: name,
@@ -60,20 +61,21 @@ if has_enumerations
     install_dir: join_paths(get_option('includedir'), inc_dir),
     header_prefix: '#include <@0@-enum-types.h>'.format(join_paths(path, name)),
   )
-  sources += enums
-  headers += enum_header
+else
+  enums = []
 endif
 
 # Generate marshallers for GObject signals.
 if has_marshaller
-  signal_marshallers = gnome.genmarshal('@0@-sigs-marshal'.format(name),
+  marshallers = gnome.genmarshal('@0@-sigs-marshal'.format(name),
     prefix: '@0@_sigs_marshal'.format(name),
     sources: '@0@-sigs-marshal.list'.format(name),
     stdinc: true,
     install_header: true,
     install_dir: join_paths(get_option('includedir'), inc_dir),
   )
-  sources += signal_marshallers
+else
+  marshallers = []
 endif
 
 # Constrain public APIs by linker option.
@@ -82,7 +84,7 @@ mapfile_path = join_paths(meson.current_source_dir(), mapfile_name)
 linker_flag = '-Wl,--version-script,@0@'.format(mapfile_path)
 
 library = library(name,
-  sources: sources + headers + privates,
+  sources: sources + headers + privates + enums + marshallers,
   version: meson.project_version(),
   soversion: meson.project_version().split('.')[0],
   install: true,
@@ -105,7 +107,7 @@ pkg.generate(library,
 
 # Generate metadata for gobject introspection.
 gnome.generate_gir(library,
-  sources: sources + headers,
+  sources: enums + headers + sources,
   nsversion: '0.0',
   namespace: namespace,
   symbol_prefix: '@0@_'.format(name),
index 5c150f9aee9c3136d9f6182367872df1be937f58..52095b81880b1485f04acf1cf227dffec25d34bf 100644 (file)
@@ -85,6 +85,7 @@ inc_dir = join_paths(meson.project_name(), path)
 # Generate enumerations for GObject fashion.
 if has_enumerations
   enum_header = '@0@-enum-types.h'.format(name)
+  headers += enum_header
   enums = gnome.mkenums_simple('@0@-enums'.format(name),
     sources: enum_header,
     symbol_prefix: name,
@@ -93,20 +94,22 @@ if has_enumerations
     install_dir: join_paths(get_option('includedir'), inc_dir),
     header_prefix: '#include <@0@-enum-types.h>'.format(join_paths(path, name)),
   )
-  sources += enums
-  headers += enum_header
+else
+  enum
+  s = []
 endif
 
 # Generate marshallers for GObject signals.
 if has_marshaller
-  signal_marshallers = gnome.genmarshal('@0@-sigs-marshal'.format(name),
+  marshallers = gnome.genmarshal('@0@-sigs-marshal'.format(name),
     prefix: '@0@_sigs_marshal'.format(name),
     sources: '@0@-sigs-marshal.list'.format(name),
     stdinc: true,
     install_header: true,
     install_dir: join_paths(get_option('includedir'), inc_dir),
   )
-  sources += signal_marshallers
+else
+  marshallers = []
 endif
 
 # Constrain public APIs by linker option.
@@ -115,7 +118,7 @@ mapfile_path = join_paths(meson.current_source_dir(), mapfile_name)
 linker_flag = '-Wl,--version-script,@0@'.format(mapfile_path)
 
 library = library(name,
-  sources: sources + headers + privates,
+  sources: sources + headers + privates + enums + marshallers,
   version: meson.project_version(),
   soversion: meson.project_version().split('.')[0],
   install: true,
@@ -138,7 +141,7 @@ pkg.generate(library,
 
 # Generate metadata for gobject introspection.
 gnome.generate_gir(library,
-  sources: sources + headers,
+  sources: enums + headers + sources,
   nsversion: '0.0',
   namespace: namespace,
   symbol_prefix: '@0@_'.format(name),
index cc21e906d23f81eed432efc9eed3b47a498d5610..04fc2db3e4dd1c58d37b9df545cbb80a4ce83422 100644 (file)
@@ -66,6 +66,7 @@ inc_dir = join_paths(meson.project_name(), path)
 # Generate enumerations for GObject fashion.
 if has_enumerations
   enum_header = '@0@-enum-types.h'.format(name)
+  headers += enum_header
   enums = gnome.mkenums_simple('@0@-enums'.format(name),
     sources: enum_header,
     symbol_prefix: name,
@@ -74,20 +75,21 @@ if has_enumerations
     install_dir: join_paths(get_option('includedir'), inc_dir),
     header_prefix: '#include <@0@-enum-types.h>'.format(join_paths(path, name)),
   )
-  sources += enums
-  headers += enum_header
+else
+  enums = []
 endif
 
 # Generate marshallers for GObject signals.
 if has_marshaller
-  signal_marshallers = gnome.genmarshal('@0@-sigs-marshal'.format(name),
+  marshallers = gnome.genmarshal('@0@-sigs-marshal'.format(name),
     prefix: '@0@_sigs_marshal'.format(name),
     sources: '@0@-sigs-marshal.list'.format(name),
     stdinc: true,
     install_header: true,
     install_dir: join_paths(get_option('includedir'), inc_dir),
   )
-  sources += signal_marshallers
+else
+  marshallers = []
 endif
 
 # Constrain public APIs by linker option.
@@ -96,7 +98,7 @@ mapfile_path = join_paths(meson.current_source_dir(), mapfile_name)
 linker_flag = '-Wl,--version-script,@0@'.format(mapfile_path)
 
 library = library(name,
-  sources: sources + headers + privates,
+  sources: sources + headers + privates + enums + marshallers,
   version: meson.project_version(),
   soversion: meson.project_version().split('.')[0],
   install: true,
@@ -119,7 +121,7 @@ pkg.generate(library,
 
 # Generate metadata for gobject introspection.
 alsatimer_gir = gnome.generate_gir(library,
-  sources: sources + headers,
+  sources: enums + headers + sources,
   nsversion: '0.0',
   namespace: namespace,
   symbol_prefix: '@0@_'.format(name),