[libgfbgraph/wip/mnth/port-to-meson] meson prototype



commit fc41aa9dc050b34dcb59baeb5a300125e62574fa
Author: Leesoo Ahn <yisooan fedoraproject org>
Date:   Sun Oct 13 15:31:37 2019 +0900

    meson prototype
    
    it needs a test.

 gfbgraph/meson.build | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build          | 21 ++++++++++++++++++++
 tests/meson.build    | 29 +++++++++++++++++++++++++++
 3 files changed, 105 insertions(+)
---
diff --git a/gfbgraph/meson.build b/gfbgraph/meson.build
new file mode 100644
index 0000000..41d6829
--- /dev/null
+++ b/gfbgraph/meson.build
@@ -0,0 +1,55 @@
+lib_sources = [
+  'gfbgraph-album.c',
+  'gfbgraph-authorizer.c',
+  'gfbgraph-common.c',
+  'gfbgraph-connectable.c',
+  'gfbgraph-goa-authorizer.c',
+  'gfbgraph-node.c',
+  'gfbgraph-photo.c',
+  'gfbgraph-simple-authorizer.c',
+  'gfbgraph-user.c',
+]
+
+lib_headers = [
+  'gfbgraph.h',
+  'gfbgraph-album.h',
+  'gfbgraph-authorizer.h',
+  'gfbgraph-common.h',
+  'gfbgraph-connectable.h',
+  'gfbgraph-goa-authorizer.h',
+  'gfbgraph-node.h',
+  'gfbgraph-photo.h',
+  'gfbgraph-simple-authorizer.h',
+  'gfbgraph-user.h',
+]
+
+lib_deps = [
+  dependency('glib-2.0'),
+  dependency('gio-2.0'),
+  dependency('json-glib-1.0'),
+  dependency('rest-0.7'),
+  dependency('libsoup-2.4'),
+  dependency('goa-1.0'),
+]
+
+lib_c_args = [
+  '-DG_LOG_DOMAIN="GFBGraph"',
+  '-g',
+  '-Og'
+]
+
+extra_c_args = [
+  '-DLIBSOUP_USE_UNSTABLE_REQUEST_API',
+  '-DGOA_API_IS_SUBJECT_TO_CHANGE'
+]
+
+gfbgraph_lib = shared_library('gfbgraph-' + api_version,
+  lib_sources,
+  include_directories: root_dir,
+  dependencies: lib_deps,
+  c_args: lib_c_args + extra_c_args,
+  install: true,
+)
+
+install_headers(lib_headers, subdir: 'gfbgraph')
+
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..ca4607e
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,21 @@
+project('libgfbgraph', 'c',
+        version: '0.2.4',
+        meson_version: '>=0.48',
+        license: 'LGPL2.1')
+
+gnome = import('gnome')
+
+gfbgraph_version = meson.project_version()
+version_split = gfbgraph_version.split('.')
+MAJOR_VERSION = version_split[0]
+MINOR_VERSION = version_split[1]
+MICRO_VERSION = version_split[2]
+
+api_version = '@0@.@1@'.format(MAJOR_VERSION, MINOR_VERSION)
+
+root_dir = include_directories('.')
+
+subdir('gfbgraph')
+
+subdir('tests')
+
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000..f27f053
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,29 @@
+configure_file(input : 'credentials.ini',
+               output : 'credentials.ini',
+               copy: true)
+
+test('autoptr',
+  executable('autoptr', 'autoptr.c',
+             include_directories: root_dir,
+             dependencies: lib_deps,
+             c_args: lib_c_args,
+             link_with: gfbgraph_lib),
+  env: [
+    'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+    'G_TEST_BUILDDIR=@0@'.format(meson.current_source_dir()),
+  ]
+)
+
+test('gtestutils',
+  executable('gtestutils', 'gtestutils.c',
+             include_directories: root_dir,
+             dependencies: lib_deps,
+             c_args: lib_c_args,
+             link_with: gfbgraph_lib),
+  env: [
+    'CREDENTIALS_PATH=@0@'.format(meson.current_source_dir()),
+    'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+    'G_TEST_BUILDDIR=@0@'.format(meson.current_source_dir()),
+  ]
+)
+


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