[glib] meson: Use files() for headers and sources



commit 2e5bb92de6a976f0ffb2f57b28c00e0adeb03eb6
Author: Nirbheek Chauhan <nirbheek centricular com>
Date:   Wed Nov 22 14:11:11 2017 +0530

    meson: Use files() for headers and sources
    
    This allows them to be fetched via subproject().get_variable(). Needed
    for the gobject-introspection meson port.

 glib/meson.build    |   30 +++++++++++++++---------------
 gobject/meson.build |   12 +++++-------
 2 files changed, 20 insertions(+), 22 deletions(-)
---
diff --git a/glib/meson.build b/glib/meson.build
index 223b7fe..7de7ace 100644
--- a/glib/meson.build
+++ b/glib/meson.build
@@ -13,24 +13,24 @@ else
   subdir('gnulib')
 endif
 
-glib_headers = [
+glib_headers = files(
   'glib.h',
   'glib-unix.h',
   'glib-object.h',
-]
+)
 install_headers(glib_headers, subdir : 'glib-2.0')
 
-glib_deprecated_headers = [
+glib_deprecated_headers = files(
   'deprecated/gallocator.h',
   'deprecated/gcache.h',
   'deprecated/gcompletion.h',
   'deprecated/gmain.h',
   'deprecated/grel.h',
   'deprecated/gthread.h',
-]
+)
 install_headers(glib_deprecated_headers, subdir : 'glib-2.0/glib/deprecated')
 
-glib_sub_headers = [
+glib_sub_headers = files(
   'glib-autocleanups.h',
   'galloca.h',
   'garray.h',
@@ -105,18 +105,18 @@ glib_sub_headers = [
   'gversionmacros.h',
   'gwin32.h',
   'gprintf.h',
-]
+)
 install_headers(glib_sub_headers, subdir : 'glib-2.0/glib')
 
-deprecated_sources = [
+deprecated_sources = files(
   'deprecated/gallocator.c',
   'deprecated/gcache.c',
   'deprecated/gcompletion.c',
   'deprecated/grel.c',
   'deprecated/gthread-deprecated.c'
-]
+)
 
-glib_sources = [
+glib_sources = files(
   'garray.c',
   'gasyncqueue.c',
   'gatomic.c',
@@ -194,15 +194,15 @@ glib_sources = [
   'gversion.c',
   'gwakeup.c',
   'gprintf.c',
-]
+)
 
 if host_system == 'windows'
-  thread_src = ['gthread-win32.c']
-  plat_src = ['gwin32.c', 'gspawn-win32.c', 'giowin32.c']
+  glib_sources += files('gthread-win32.c')
+  glib_sources += files('gwin32.c', 'gspawn-win32.c', 'giowin32.c')
   platform_deps = [winsock2, cc.find_library('winmm')]
 else
-  thread_src = ['gthread-posix.c']
-  plat_src = ['glib-unix.c', 'gspawn.c', 'giounix.c']
+  glib_sources += files('gthread-posix.c')
+  glib_sources += files('glib-unix.c', 'gspawn.c', 'giounix.c')
   platform_deps = []
 endif
 
@@ -222,7 +222,7 @@ endif
 
 libglib = shared_library('glib-2.0',
   glib_dtrace_obj, glib_dtrace_hdr,
-  sources : [deprecated_sources, glib_sources, thread_src, plat_src],
+  sources : [deprecated_sources, glib_sources],
   version : library_version,
   soversion : soversion,
   install : true,
diff --git a/gobject/meson.build b/gobject/meson.build
index 4a392c2..ba01dd5 100644
--- a/gobject/meson.build
+++ b/gobject/meson.build
@@ -1,4 +1,4 @@
-gobject_install_headers = files([
+gobject_install_headers = files(
   'gobject-autocleanups.h',
   'glib-types.h',
   'gbinding.h',
@@ -19,11 +19,10 @@ gobject_install_headers = files([
   'gvaluecollector.h',
   'gvaluetypes.h',
   'gobjectnotifyqueue.c', # sic
-])
+)
 install_headers(gobject_install_headers, subdir : 'glib-2.0/gobject')
 
-gobject_c_sources = [
-#  'gobject_probes.d',
+gobject_sources = files(
   'gatomicarray.c',
   'gbinding.c',
   'gboxed.c',
@@ -31,7 +30,6 @@ gobject_c_sources = [
   'genums.c',
   'gmarshal.c',
   'gobject.c',
-  'gobject_trace.h',
   'gparam.c',
   'gparamspecs.c',
   'gsignal.c',
@@ -43,7 +41,7 @@ gobject_c_sources = [
   'gvaluearray.c',
   'gvaluetransform.c',
   'gvaluetypes.c',
-]
+)
 
 if enable_dtrace
   gobject_dtrace_obj = dtrace_obj_gen.process('gobject_probes.d')
@@ -55,7 +53,7 @@ endif
 
 libgobject = shared_library('gobject-2.0',
   gobject_dtrace_obj, gobject_dtrace_hdr,
-  sources : [gobject_c_sources],
+  sources : gobject_sources,
   version : library_version,
   soversion : soversion,
   install : true,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]