[balsa] Use include_directories instead of explicit -I…
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa] Use include_directories instead of explicit -I…
- Date: Mon, 25 Sep 2017 18:42:01 +0000 (UTC)
commit 5897b665e11131d945259da22cc03688cadbcd06
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Mon Sep 25 14:41:27 2017 -0400
Use include_directories instead of explicit -I…
* libbalsa/imap/meson.build:
* libbalsa/meson.build:
* libinit_balsa/meson.build:
* libnetclient/meson.build:
* libnetclient/test/meson.build:
* meson.build:
* src/meson.build:
ChangeLog | 12 ++++++++++++
libbalsa/imap/meson.build | 22 ++++++++++------------
libbalsa/meson.build | 16 +++++++---------
libinit_balsa/meson.build | 14 ++++++--------
libnetclient/meson.build | 8 +++-----
libnetclient/test/meson.build | 11 +++++++----
meson.build | 38 ++++++++++++++++++++------------------
src/meson.build | 27 ++++++++++-----------------
8 files changed, 75 insertions(+), 73 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 493c79a..389395a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2017-09-25 Peter Bloomfield <pbloomfield bellsouth net>
+ Use include_directories instead of explicit -I…
+
+ * libbalsa/imap/meson.build:
+ * libbalsa/meson.build:
+ * libinit_balsa/meson.build:
+ * libnetclient/meson.build:
+ * libnetclient/test/meson.build:
+ * meson.build:
+ * src/meson.build:
+
+2017-09-25 Peter Bloomfield <pbloomfield bellsouth net>
+
* src/filter-run-dialog.c: include filter-funcs.h instead of
libbalsa/filter-funcs.h, same as elsewhere.
diff --git a/libbalsa/imap/meson.build b/libbalsa/imap/meson.build
index 9dfcece..c64a3ca 100644
--- a/libbalsa/imap/meson.build
+++ b/libbalsa/imap/meson.build
@@ -22,16 +22,6 @@ libimap_a_sources = [
'util.h'
]
-libimap_compile_args = ['-I' + meson.build_root(),
- '-I' + meson.current_build_dir(),
- '-I' + meson.source_root(),
- '-I' + join_paths(meson.source_root(), 'libbalsa'),
- '-I' + join_paths(meson.source_root(), 'libnetclient'),
- '-I' + join_paths(meson.source_root(), 'libbalsa', 'imap'),
- '-ansi']
-libimap_compile_dep = declare_dependency(compile_args : libimap_compile_args,
- link_args : '-lz')
-
# genmarshal
#
@@ -62,10 +52,18 @@ libimap_marshal_c = custom_target('libimap_marshal_c',
]
)
+#
+
+libimap_compile_arg = '-ansi'
+libimap_link_arg = '-lz'
+libimap_compile_dep = declare_dependency(compile_args : libimap_compile_arg,
+ link_args : libimap_link_arg)
+
libimap_a = static_library('imap', libimap_a_sources,
libimap_marshal_c, libimap_marshal_h,
- dependencies : balsa_deps + [libimap_compile_dep],
- install : false)
+ dependencies : balsa_deps + [libimap_compile_dep],
+ include_directories : [top_include, libnetclient_include],
+ install : false)
imap_tst_sources = 'imap_tst.c'
diff --git a/libbalsa/meson.build b/libbalsa/meson.build
index 9f49ab4..10c8ee6 100644
--- a/libbalsa/meson.build
+++ b/libbalsa/meson.build
@@ -135,13 +135,6 @@ libbalsa_a_sources = [
libbalsa_a_sources += libbalsa_gpgme_extra
-libbalsa_compile_args = ['-I' + meson.build_root(),
- '-I' + meson.current_build_dir(),
- '-I' + join_paths(meson.source_root(), 'libbalsa'),
- '-I' + join_paths(meson.source_root(), 'libnetclient'),
- '-I' + join_paths(meson.source_root(), 'libbalsa', 'imap')]
-libbalsa_compile_dep = declare_dependency(compile_args : libbalsa_compile_args)
-
# genmarshal
#
@@ -172,9 +165,14 @@ libbalsa_marshal_c = custom_target('libbalsa_marshal_c',
]
)
+libimap_include = include_directories('imap')
+
libbalsa_a = static_library('balsa', libbalsa_a_sources,
libbalsa_marshal_c, libbalsa_marshal_h,
- dependencies : balsa_deps + [libbalsa_compile_dep],
- install : false)
+ dependencies : balsa_deps,
+ include_directories : [top_include,
+ libnetclient_include,
+ libimap_include],
+ install : false)
subdir('imap')
diff --git a/libinit_balsa/meson.build b/libinit_balsa/meson.build
index 00a8159..6594128 100644
--- a/libinit_balsa/meson.build
+++ b/libinit_balsa/meson.build
@@ -17,12 +17,10 @@ libinit_balsa_sources = [
'assistant_helper.h'
]
-libinit_balsa_compile_args = ['-I' + meson.build_root(),
- '-I' + join_paths(meson.source_root(), 'libbalsa'),
- '-I' + join_paths(meson.source_root(), 'libnetclient'),
- '-I' + join_paths(meson.source_root(), 'src')]
-libinit_balsa_compile_dep = declare_dependency(compile_args : libinit_balsa_compile_args)
-
libinit_balsa_a = static_library('init_balsa', libinit_balsa_sources,
- dependencies : balsa_deps + [libinit_balsa_compile_dep],
- install : false)
+ dependencies : balsa_deps,
+ include_directories : [top_include,
+ libbalsa_include,
+ libnetclient_include,
+ src_include],
+ install : false)
diff --git a/libnetclient/meson.build b/libnetclient/meson.build
index d555b73..a7e8ba6 100644
--- a/libnetclient/meson.build
+++ b/libnetclient/meson.build
@@ -11,12 +11,10 @@ libnetclient_a_sources = [
'net-client-utils.h'
]
-libnetclient_compile_args = '-I' + meson.build_root()
-libbetclient_compile_dep = declare_dependency(compile_args : libnetclient_compile_args)
-
libnetclient_a = static_library('netclient', libnetclient_a_sources,
- dependencies : libnetclient_deps + [libbetclient_compile_dep],
- install : false)
+ dependencies : libnetclient_deps,
+ include_directories : top_include,
+ install : false)
if libnetclient_docs
doxygen = doxygen_program.path()
diff --git a/libnetclient/test/meson.build b/libnetclient/test/meson.build
index 3adcf7b..8ee8d96 100644
--- a/libnetclient/test/meson.build
+++ b/libnetclient/test/meson.build
@@ -8,6 +8,7 @@ if libnetclient_test
'-ftest-coverage',
'-g',
'-Wno-error']
+ link_arg = '-lgcov'
lcov_flags = ['--rc',
'lcov_branch_coverage=1']
genhtml_flags = ['--function-coverage',
@@ -18,11 +19,13 @@ if libnetclient_test
'--track-fds=yes',
'--child-silent-after-fork=yes']
- test_compile_dep = declare_dependency(compile_args : test_flags + ['-I.', '-I..'])
+ test_compile_dep = declare_dependency(compile_args : test_flags,
+ link_args : link_arg)
test_executable = executable('tests', 'tests.c',
- link_with : libnetclient_a,
- dependencies : libnetclient_deps + [test_compile_dep],
- install : false)
+ include_directories : [top_include, libnetclient_include],
+ link_with : libnetclient_a,
+ dependencies : libnetclient_deps + [test_compile_dep],
+ install : false)
test('libnetclient-test', test_executable)
# now run the test with:
# meson test --wrap='valgrind --tool=memcheck --leak-check=full --track-fds=yes
--child-silent-after-fork=yes --suppressions=valgrind.supp' libnetclient-test
diff --git a/meson.build b/meson.build
index 7663ed3..3226ebe 100644
--- a/meson.build
+++ b/meson.build
@@ -277,8 +277,8 @@ if ldap != 'false'
ldap_compile_args = []
ldap_link_args = ['-lldap', '-llber', '-lresolv']
if ldap != 'true'
- ldap_compile_args += '-I' + ldap + '/include'
- ldap_link_args += '-L' + ldap + '/lib'
+ ldap_compile_args += '-I' + join_paths(ldap, 'include')
+ ldap_link_args += '-L' + join_paths(ldap, 'lib')
endif
result = compiler.has_function('ldap_search', args : ldap_link_args)
@@ -319,8 +319,8 @@ if sqlite != 'false'
# would probably need to be set appropriately in the environment.
# There doesn't seem to be a way to do that within dependency().
real_dep = declare_dependency(dependencies : sqlite_dep,
- compile_args : '-I' + sqlite + '/include',
- link_args : '-L' + sqlite + '/lib')
+ compile_args : '-I' + join_paths(sqlite, 'include'),
+ link_args : '-L' + join_paths(sqlite, 'lib'))
else
real_dep = sqlite_dep
endif
@@ -446,8 +446,8 @@ if compface != 'false'
compface_compile_args = []
compface_link_args = ['-lcompface']
if compface != 'true'
- compface_compile_args += '-I' + compface + '/include'
- compface_link_args += '-L' + compface + '/lib'
+ compface_compile_args += '-I' + join_paths(compface, 'include')
+ compface_link_args += '-L' + join_paths(compface, 'lib')
endif
result = compiler.has_function('uncompface', args : compface_link_args)
@@ -730,21 +730,23 @@ if html_widget == 'webkit'
''')
endif
-subdirs = ['sounds',
- 'images',
- 'libnetclient',
- 'libbalsa',
- 'libinit_balsa',
- 'src',
- 'ui']
+top_include = include_directories('.')
+libnetclient_include = include_directories('libnetclient')
+libbalsa_include = include_directories('libbalsa')
+libinit_balsa_include = include_directories('libinit_balsa')
+src_include = include_directories('src')
+
+subdir('sounds')
+subdir('images')
+subdir('libnetclient')
+subdir('libbalsa')
+subdir('libinit_balsa')
+subdir('src')
+subdir('ui')
if help_files
- subdirs += 'doc'
+ subdir('doc')
endif
-foreach dir : subdirs
- subdir(dir)
-endforeach
-
if gtksourceview
gtksourceview_files = ['balsa-mail.lang', 'balsa-mail-style.xml']
gtksourceview_dir = join_paths(get_option('datadir'), 'balsa', 'gtksourceview-3.0')
diff --git a/src/meson.build b/src/meson.build
index 1279c7e..6841ed3 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -99,31 +99,24 @@ if spell_checker == 'internal'
endif
locale_dir = join_paths(get_option('prefix'), get_option('datadir'), 'locale')
-balsa_compile_args = ['-DGNOMELOCALEDIR="' + locale_dir + '"',
- '-I' + meson.build_root(),
- '-I' + meson.source_root(),
- '-I' + join_paths(meson.source_root(), 'libbalsa'),
- '-I' + join_paths(meson.source_root(), 'libnetclient')]
+balsa_compile_arg = '-DGNOMELOCALEDIR="' + locale_dir + '"'
-balsa_compile_dep = declare_dependency(compile_args : balsa_compile_args)
+balsa_compile_dep = declare_dependency(compile_args : balsa_compile_arg)
balsa_libs = [libinit_balsa_a, libbalsa_a, libimap_a, libnetclient_a]
executable('balsa', balsa_sources,
- dependencies : balsa_deps + [balsa_compile_dep],
- link_with : balsa_libs,
- install : true)
+ dependencies : balsa_deps + [balsa_compile_dep],
+ include_directories : [top_include, libbalsa_include, libnetclient_include],
+ link_with : balsa_libs,
+ install : true)
balsa_ab_sources = [
'ab-main.c',
'address-book-config.c'
]
-balsa_ab_compile_args = ['-I' + meson.build_root(),
- '-I' + join_paths(meson.source_root(), 'libbalsa')]
-
-balsa_ab_compile_dep = declare_dependency(compile_args : balsa_ab_compile_args)
-
executable('balsa_ab', balsa_ab_sources,
- dependencies : balsa_ab_deps + [balsa_ab_compile_dep],
- link_with : libbalsa_a,
- install : true)
+ dependencies : balsa_ab_deps,
+ include_directories : [top_include, libbalsa_include],
+ link_with : libbalsa_a,
+ install : true)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]