summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeesoo Ahn <yisooan@fedoraproject.org>2019-10-13 15:31:37 +0900
committerLeesoo Ahn <yisooan@fedoraproject.org>2019-10-13 15:31:37 +0900
commitfc41aa9dc050b34dcb59baeb5a300125e62574fa (patch)
tree29458e2acb799956a0b14b28c6910e0d845945bd
parent6e3e435854574e986473095b02f48ab287e1e3ed (diff)
downloadlibgfbgraph-wip/mnth/port-to-meson.tar.gz
meson prototypewip/mnth/port-to-meson
it needs a test.
-rw-r--r--gfbgraph/meson.build55
-rw-r--r--meson.build21
-rw-r--r--tests/meson.build29
3 files changed, 105 insertions, 0 deletions
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()),
+ ]
+)
+