[gnome-builder/wip/tingping/meson-build] fixup! build: Initial conversion to Meson
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/tingping/meson-build] fixup! build: Initial conversion to Meson
- Date: Mon, 3 Oct 2016 18:08:34 +0000 (UTC)
commit e84b0cd84191b2f3c7beced64ed69aa40f16c561
Author: Patrick Griffis <tingping tingping se>
Date: Mon Oct 3 14:08:23 2016 -0400
fixup! build: Initial conversion to Meson
contrib/egg/meson.build | 8 +++++
contrib/pnl/meson.build | 29 ++++++++++++++++-
contrib/tmpl/meson.build | 43 +++++++++++++++++++++-----
contrib/tmpl/tmpl-enums.h.in | 2 +-
libide/meson.build | 67 ++++++++++++++++++++++++++++------------
libide/resources/meson.build | 5 +++
meson.build | 11 ++++---
meson_options.txt | 3 ++
plugins/autotools/meson.build | 14 ++++-----
9 files changed, 138 insertions(+), 44 deletions(-)
---
diff --git a/contrib/egg/meson.build b/contrib/egg/meson.build
index 4bd62c7..3f09805 100644
--- a/contrib/egg/meson.build
+++ b/contrib/egg/meson.build
@@ -86,6 +86,14 @@ libegg = shared_library('egg-private', libegg_sources,
install_dir: get_option('libdir') + '/gnome-builder',
)
+libegg_dep = declare_dependency(
+ link_with: libegg,
+ include_directories: include_directories([
+ meson.current_source_dir(),
+ meson.current_build_dir(),
+ ])
+)
+
if get_option('with_introspection')
gnome.generate_gir(libegg,
diff --git a/contrib/pnl/meson.build b/contrib/pnl/meson.build
index 189711d..2eed0a7 100644
--- a/contrib/pnl/meson.build
+++ b/contrib/pnl/meson.build
@@ -16,12 +16,27 @@ libpnl_headers = [
'pnl-multi-paned.h',
'pnl-tab-strip.h',
'pnl-tab.h',
- 'pnl-version.h',
'pnl.h',
]
+libpnl_header_dir = get_option('includedir') + '/gnome-builder-' + meson.project_version() + '/pnl'
+
+libpnl_conf = configuration_data()
+libpnl_conf.set('MAJOR_VERSION', MAJOR_VERSION)
+libpnl_conf.set('MINOR_VERSION', MINOR_VERSION)
+libpnl_conf.set('MICRO_VERSION', MICRO_VERSION)
+libpnl_conf.set_quoted('VERSION', meson.project_version())
+
+libpnl_version_h = configure_file(
+ input: 'pnl-version.h.in',
+ output: 'pnl-version.h',
+ configuration: libpnl_conf,
+ install: true,
+ install_dir: libpnl_header_dir,
+)
+
install_headers(libpnl_headers,
- subdir: 'gnome-builder-' + meson.project_version() + '/pnl',
+ install_dir: libpnl_header_dir,
)
libpnl_resources = gnome.compile_resources('pnl-resources',
@@ -58,6 +73,7 @@ libpnl_sources = [
'pnl-util.c',
libpnl_resources[0],
libpnl_resources[1],
+ libpnl_version_h,
]
libpnl_deps = [
@@ -71,6 +87,15 @@ libpnl = shared_library('panel-gtk', libpnl_sources,
install_dir: get_option('libdir') + '/gnome-builder',
)
+libpnl_dep = declare_dependency(
+ sources: libpnl_version_h,
+ link_with: libpnl,
+ include_directories: include_directories([
+ meson.current_source_dir(),
+ meson.current_build_dir(),
+ ])
+)
+
if get_option('with_introspection')
gnome.generate_gir(libpnl,
diff --git a/contrib/tmpl/meson.build b/contrib/tmpl/meson.build
index a63836b..d141bbf 100644
--- a/contrib/tmpl/meson.build
+++ b/contrib/tmpl/meson.build
@@ -3,10 +3,25 @@ libtmpl_enum_headers = [
'tmpl-expr-types.h',
]
-gnome.mkenums('tmpl-enums',
+libtmpl_headers_subdir = 'gnome-builder-' + meson.project_version() + '/template-glib'
+libtmpl_headers_dir = get_option('includedir') + '/' + libtmpl_headers_subdir
+
+libtmpl_enums = gnome.mkenums('tmpl-enums',
h_template: 'tmpl-enums.h.in',
c_template: 'tmpl-enums.c.in',
sources: libtmpl_enum_headers,
+ install_header: true,
+ install_dir: libtmpl_headers_dir,
+)
+
+libtmpl_conf = configuration_data()
+libtmpl_conf.set10('ENABLE_TRACING', get_option('enable_tracing'))
+libtmpl_debug = configure_file(
+ input: 'tmpl-debug.h.in',
+ output: 'tmpl-debug.h',
+ configuration: libtmpl_conf,
+ install: true,
+ install_dir: libtmpl_headers_dir,
)
libtmpl_headers = [
@@ -18,21 +33,24 @@ libtmpl_headers = [
'tmpl-symbol.h',
'tmpl-template-locator.h',
'tmpl-template.h',
- 'tmpl-enums.h',
]
install_headers(libtmpl_headers,
- subdir: 'gnome-builder-' + meson.project_version() + '/template-glib',
+ subdir: libtmpl_headers_subdir
)
-libtmpl_sources = libtmpl_headers + [
+libtmpl_generated_headers = [
+ libtmpl_debug,
+ libtmpl_enums[1],
+]
+
+libtmpl_sources = libtmpl_generated_headers + libtmpl_headers + [
+ libtmpl_enums[0],
'tmpl-branch-node.c',
'tmpl-branch-node.h',
'tmpl-condition-node.c',
'tmpl-condition-node.h',
- 'tmpl-debug.h',
'tmpl-error.c',
- 'tmpl-enums.c',
'tmpl-expr-eval.c',
'tmpl-expr-node.c',
'tmpl-expr-node.h',
@@ -97,11 +115,20 @@ libtmpl = shared_library('template-glib-' + libtmpl_api_version, libtmpl_sources
install_dir: pkglibdir, # Was this the wrong dir?
)
+libtmpl_dep = declare_dependency(
+ sources: libtmpl_generated_headers,
+ link_with: libtmpl,
+ include_directories: include_directories([
+ meson.current_source_dir(),
+ meson.current_build_dir(),
+ ])
+)
+
if get_option('with_introspection')
libtmpl_introspection_sources = [
- 'tmpl-enums.c',
- 'tmpl-enums.h',
+ libtmpl_enums[0],
+ libtmpl_enums[1],
'tmpl-error.c',
'tmpl-error.h',
'tmpl-expr.c',
diff --git a/contrib/tmpl/tmpl-enums.h.in b/contrib/tmpl/tmpl-enums.h.in
index ea36434..1bb67f5 100644
--- a/contrib/tmpl/tmpl-enums.h.in
+++ b/contrib/tmpl/tmpl-enums.h.in
@@ -14,7 +14,7 @@ G_BEGIN_DECLS
/*** END file-production ***/
/*** BEGIN value-header ***/
-G_MODULE_EXPORT GType @enum_name@_get_type (void) G_GNUC_CONST;
+GType @enum_name@_get_type (void) G_GNUC_CONST;
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
/*** END value-header ***/
diff --git a/libide/meson.build b/libide/meson.build
index 3807198..219eab1 100644
--- a/libide/meson.build
+++ b/libide/meson.build
@@ -14,17 +14,20 @@ libide_enum_headers = [
'workbench/ide-layout-stack-split.h',
]
+libide_header_subdir = 'gnome-builder-' + meson.project_version() + '/libide'
+libide_header_dir = get_option('includedir') + '/' + libide_header_subdir
+
# https://github.com/mesonbuild/meson/pull/718
libide_enums = gnome.mkenums('ide-enums',
h_template: 'ide-enums.h.in',
c_template: 'ide-enums.c.in',
sources: libide_enum_headers,
+ install_header: true,
+ install_dir: libide_header_dir,
)
libide_public_headers = [
'ide-context.h',
- 'ide-debug.h',
- 'ide-enums.h',
'ide-global.h',
'ide-macros.h',
'ide-object.h',
@@ -186,16 +189,24 @@ libide_public_headers = [
'workers/ide-worker.h',
]
-install_headers(libide_public_headers,
- subdir: 'gnome-builder-' + meson.project_version() + '/libide'
+libide_conf = configuration_data()
+libide_conf.set10('ENABLE_TRACING', get_option('enable_tracing'))
+# FIXME: BUGREPORT_URL
+libide_debug_h = configure_file(
+ input: 'ide-debug.h.in',
+ output: 'ide-debug.h',
+ configuration: libide_conf,
+ install: true,
+ install_dir: libide_header_dir,
)
-libide_resources = gnome.compile_resources('ide-resources',
- 'resources/libide.gresource.xml',
- source_dir: meson.current_source_dir() + '/resources',
- c_name: 'ide',
+
+install_headers(libide_public_headers,
+ subdir: libide_header_subdir,
)
+subdir('resources')
+
libide_icons_resources = gnome.compile_resources('ide-icons-resources',
meson.source_root() + '/data/icons/hicolor/icons.gresource.xml',
source_dir: meson.source_root() + '/data/icons/hicolor',
@@ -253,7 +264,8 @@ libide_public_sources = [
'history/ide-back-forward-list-save.c',
'history/ide-back-forward-list.c',
'ide-context.c',
- 'ide-enums.c',
+ libide_enums[0],
+ libide_enums[1],
'ide-object.c',
'ide-service.c',
'ide.c',
@@ -361,7 +373,15 @@ libide_public_sources = [
'workers/ide-worker.c',
]
-libide_sources = libide_public_sources + [
+libide_generated_headers = [
+ libide_resources[1],
+ libide_icons_resources[1],
+ libide_debug_h,
+]
+
+libide_sources = libide_generated_headers + libide_public_sources + [
+ libide_resources[0],
+ libide_icons_resources[0],
'application/ide-application-actions.c',
'application/ide-application-actions.h',
'application/ide-application-command-line.c',
@@ -488,8 +508,6 @@ libide_sources = libide_public_sources + [
'workers/ide-worker-manager.h',
'workers/ide-worker-process.c',
'workers/ide-worker-process.h',
- libide_resources,
- libide_icons_resources,
]
libide_deps = [
@@ -500,27 +518,24 @@ libide_deps = [
dependency('libpeas-1.0 >= 1.18.0'),
dependency('libxml-2.0 >= 2.9.0'),
dependency('pangoft2 >= 1.38.0'),
+ libegg_dep,
+ libpnl_dep,
+ libtmpl_dep,
]
contrib_dir = meson.source_root() + '/contrib/'
libide_includes = [
- contrib_dir + 'egg',
contrib_dir + 'gd',
contrib_dir + 'nautilus',
- contrib_dir + 'pnl',
contrib_dir + 'search',
- contrib_dir + 'tmpl',
contrib_dir + 'xml',
]
libide_libs = [
- libegg,
libgd,
libnautilus,
- libpnl,
libsearch,
- libtmpl,
libxml,
]
@@ -554,19 +569,31 @@ libide = shared_library('ide-' + libide_api_version, libide_sources,
install_dir: get_option('libdir') + '/gnome-builder',
)
+libide_dep = declare_dependency(
+ sources: libide_generated_headers,
+ link_with: libide,
+ include_directories: include_directories([
+ meson.current_source_dir(),
+ meson.current_build_dir(),
+ ])
+)
+
if get_option('with_introspection')
gnome.generate_gir(libide,
- sources: libide_public_headers + libide_public_sources,
+ sources: libide_generated_headers + libide_public_headers + libide_public_sources,
nsversion: libide_api_version,
namespace: 'Ide',
symbol_prefix: 'ide',
identifier_prefix: 'Ide',
+ #dependencies: libide_dep,
includes: ['Gio-2.0', 'Gtk-3.0', 'GtkSource-3.0', 'Peas-1.0', libtmpl_gir[0]],
install: true,
install_dir_gir: get_option('datadir') + '/gnome-builder/gir-1.0',
install_dir_typelib: get_option('datadir') + '/gnome-builder/girepository-1.0',
-
+ extra_args: [
+ '-I' + meson.current_build_dir(),
+ ]
)
endif
diff --git a/libide/resources/meson.build b/libide/resources/meson.build
new file mode 100644
index 0000000..2b8b1de
--- /dev/null
+++ b/libide/resources/meson.build
@@ -0,0 +1,5 @@
+libide_resources = gnome.compile_resources('ide-resources',
+ 'libide.gresource.xml',
+ c_name: 'ide',
+)
+
diff --git a/meson.build b/meson.build
index f5b7278..c379acf 100644
--- a/meson.build
+++ b/meson.build
@@ -6,6 +6,10 @@ project('gnome-builder', 'c',
default_options: ['b_lundef=false'],
)
+MAJOR_VERSION = '3'
+MINOR_VERSION = '20'
+MICRO_VERSION = '0'
+
conf = configuration_data()
conf.set_quoted('PACKAGE_NAME', 'gnome-builder')
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
@@ -23,8 +27,8 @@ conf.set_quoted('SRCDIR', meson.source_root())
conf.set_quoted('BUILDDIR', meson.build_root())
add_global_arguments([
- '-I' + meson.build_root(),
'-DHAVE_CONFIG_H',
+ '-I' + meson.build_root(), # config.h
'-D_GNU_SOURCE',
'-fPIC', '-fPIE', # Doesn't work?
], language: 'c')
@@ -64,9 +68,6 @@ subdir('po')
executable('gnome-builder', 'src/main.c',
gui_app: true,
- link_with: libide,
install: true,
- include_directories: include_directories([
- 'libide'] + libide_includes),
- dependencies: libide_deps,
+ dependencies: libide_deps + [libide_dep],
)
diff --git a/meson_options.txt b/meson_options.txt
index 6d22361..c468929 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -7,3 +7,6 @@ option('enable_profiling', type: 'boolean', value: false)
option('with_editorconfig', type: 'boolean')
option('with_webkit', type: 'boolean')
option('with_introspection', type: 'boolean')
+
+# Plugins
+option('with_autotools', type: 'boolean')
diff --git a/plugins/autotools/meson.build b/plugins/autotools/meson.build
index 4263d35..cb9484e 100644
--- a/plugins/autotools/meson.build
+++ b/plugins/autotools/meson.build
@@ -1,3 +1,4 @@
+if get_option('with_autotools')
autotools_sources = [
'autotools-plugin.c',
@@ -21,21 +22,18 @@ autotools_deps = [
dependency('gio-2.0'),
dependency('libpeas-1.0'),
dependency('gtksourceview-3.0'),
-]
-
-autotools_includes = [
- meson.source_root() + '/contrib/egg',
- meson.source_root() + '/contrib/pnl',
- meson.source_root() + '/libide',
+ libegg_dep,
+ libpnl_dep,
+ libide_dep,
]
shared_library('autotools-plugin', autotools_sources,
dependencies: autotools_deps,
- include_directories: include_directories(autotools_includes),
- link_with: [libegg, libpnl],
c_args: ['-DGNU_MAKE_NAME="make"'],
install: true,
install_dir: plugindir,
)
install_data('autotools.plugin', install_dir: plugindir)
+
+endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]