[glibmm/glibmm-2-66] Meson build: Make it possible to use glibmm as a subproject
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/glibmm-2-66] Meson build: Make it possible to use glibmm as a subproject
- Date: Fri, 26 Mar 2021 14:48:49 +0000 (UTC)
commit 98e41f19cd6f4089f815b8535c9ec12051f805a1
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Fri Mar 26 15:44:04 2021 +0100
Meson build: Make it possible to use glibmm as a subproject
glib and sigc++ can be subprojects of glibmm.
Makefile.am | 2 ++
docs/reference/meson.build | 8 ++---
examples/meson.build | 16 +++++++--
gio/giomm/meson.build | 10 +++---
gio/giomm/slot_async.cc | 2 +-
gio/src/appinfo.ccg | 2 +-
gio/src/asyncinitable.ccg | 2 +-
gio/src/bufferedinputstream.ccg | 2 +-
gio/src/bufferedoutputstream.ccg | 2 +-
gio/src/datainputstream.ccg | 2 +-
gio/src/dbusaddress.ccg | 2 +-
gio/src/dbusconnection.ccg | 2 +-
gio/src/dbusinterfacevtable.ccg | 2 +-
gio/src/dbussubtreevtable.ccg | 2 +-
gio/src/drive.ccg | 2 +-
gio/src/file.ccg | 2 +-
gio/src/fileenumerator.ccg | 2 +-
gio/src/fileinputstream.ccg | 2 +-
gio/src/fileiostream.ccg | 2 +-
gio/src/fileoutputstream.ccg | 2 +-
gio/src/inputstream.ccg | 2 +-
gio/src/iostream.ccg | 2 +-
gio/src/loadableicon.ccg | 2 +-
gio/src/mount.ccg | 2 +-
gio/src/networkaddress.ccg | 2 +-
gio/src/networkmonitor.ccg | 2 +-
gio/src/networkservice.ccg | 2 +-
gio/src/outputstream.ccg | 2 +-
gio/src/permission.ccg | 2 +-
gio/src/proxy.ccg | 2 +-
gio/src/proxyresolver.ccg | 2 +-
gio/src/resolver.ccg | 2 +-
gio/src/socket.ccg | 2 +-
gio/src/socketaddress.ccg | 2 +-
gio/src/socketaddressenumerator.ccg | 2 +-
gio/src/socketclient.ccg | 2 +-
gio/src/socketconnection.ccg | 2 +-
gio/src/socketlistener.ccg | 2 +-
gio/src/tlsconnection.ccg | 2 +-
gio/src/tlsdatabase.ccg | 2 +-
gio/src/tlsinteraction.ccg | 2 +-
gio/src/unixconnection.ccg | 2 +-
gio/src/volume.ccg | 2 +-
glib/glibmm/meson.build | 10 +++---
meson.build | 68 ++++++++++++++++++++++++++++++++++++-
subprojects/glib.wrap | 8 +++++
subprojects/sigc++-2.0.wrap | 8 +++++
tests/meson.build | 4 +--
tools/extra_defs_gen/meson.build | 17 +++++++++-
tools/meson.build | 3 +-
50 files changed, 173 insertions(+), 59 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 31aa2419..abe3d43f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -67,6 +67,8 @@ EXTRA_DIST = \
gio/meson.build \
gio/giommconfig.h.meson \
gio/giomm/meson.build \
+ subprojects/glib.wrap \
+ subprojects/sigc++-2.0.wrap \
tests/meson.build \
tools/meson.build \
tools/build_scripts/compile-schemas.py \
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 7e4bd5f1..5e2108c5 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -5,7 +5,7 @@
# glibmm_extra_h_files, giomm_extra_h_files, glibmm_built_h_file_targets,
# giomm_built_h_file_targets, glibmm_h_m4_files, install_datadir,
# python3, doc_reference_py
-# Output: install_docdir, install_devhelpdir
+# Output: install_docdir, install_devhelpdir, tag_file
tag_file_modules = [
'mm-common-libstdc++',
@@ -16,9 +16,9 @@ docinstall_flags = []
foreach module : tag_file_modules
depmod = dependency(module, required: false)
if depmod.found()
- doxytagfile = depmod.get_pkgconfig_variable('doxytagfile')
- htmlrefpub = depmod.get_pkgconfig_variable('htmlrefpub', default: '')
- htmlrefdir = depmod.get_pkgconfig_variable('htmlrefdir', default: '')
+ doxytagfile = depmod.get_variable(pkgconfig: 'doxytagfile', internal: 'doxytagfile')
+ htmlrefpub = depmod.get_variable(pkgconfig: 'htmlrefpub', internal: 'htmlrefpub', default_value: '')
+ htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', internal: 'htmlrefdir', default_value: '')
if htmlrefpub == ''
htmlrefpub = htmlrefdir
elif htmlrefdir == ''
diff --git a/examples/meson.build b/examples/meson.build
index 499d6f6e..bfcd33a9 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -1,6 +1,7 @@
# examples
-# input: glibmm_dep, giomm_dep, build_examples, compile_schemas_py
+# input: glibmm_own_dep, giomm_own_dep, build_examples, compile_schemas_py,
+# sigcxx_dep, is_host_windows
examples = [
# [[dir-name], exe-name, [sources], giomm-example (not just glibmm-example)]
@@ -10,7 +11,6 @@ examples = [
[['dbus'], 'client_bus_listnames', ['client_bus_listnames.cc'], true],
[['keyfile'], 'example', ['main.cc'], false],
[['markup'], 'parser', ['parser.cc'], false],
- [['network'], 'resolver', ['resolver.cc'], true],
[['network'], 'socket-client', ['socket-client.cc'], true],
[['network'], 'socket-server', ['socket-server.cc'], true],
[['options'], 'example', ['main.cc'], false],
@@ -23,6 +23,16 @@ examples = [
[['thread'], 'threadpool', ['threadpool.cc'], false],
]
+# Can't compile resolver.cc if sigc++-2.0 is a subproject.
+# See https://github.com/mesonbuild/meson/issues/8562
+#TODO: When the Meson issue has been fixed, and a fixed Meson version is used,
+# network/resolver can be built even if sigc++-2.0 is a subproject.
+if sigcxx_dep.type_name() != 'internal'
+ examples += [
+ [['network'], 'resolver', ['resolver.cc'], true],
+ ]
+endif
+
if not is_host_windows
examples += [
[['child_watch'], 'child_watch', ['main.cc'], false],
@@ -65,7 +75,7 @@ foreach ex : examples
endforeach
is_multithread = ex[0][0] == 'network' or ex[0][0] == 'thread'
- mm_dep = ex[3] ? giomm_dep : glibmm_dep
+ mm_dep = ex[3] ? giomm_own_dep : glibmm_own_dep
executable(ex_name, ex_sources,
cpp_args: ['-DGLIBMM_DISABLE_DEPRECATED', '-DGIOMM_DISABLE_DEPRECATED'],
diff --git a/gio/giomm/meson.build b/gio/giomm/meson.build
index 72516f56..921e7f48 100644
--- a/gio/giomm/meson.build
+++ b/gio/giomm/meson.build
@@ -6,7 +6,7 @@
# is_host_windows, gmmproc, generate_wrap_init_pl, giomm_libname,
# macos_darwin_versions
# Output: giomm_hg_ccg_basenames, giomm_extra_h_files, built_files_root,
-# giomm_built_h_file_targets, giomm_dep
+# giomm_built_h_file_targets, giomm_own_dep
giomm_defs_basefiles = [
'gio.defs',
@@ -308,6 +308,7 @@ if maintainer_mode
giomm_used_built_cc_file_targets, giomm_extra_cc_files, built_dummy_h_file_target,
version: glibmm_libversion,
darwin_versions: macos_darwin_versions,
+ implicit_include_directories: false,
include_directories: extra_include_dirs,
cpp_args: giomm_cpp_flags,
dependencies: giomm_build_dep,
@@ -357,6 +358,7 @@ else # not maintainer_mode
built_cc_files, giomm_extra_cc_files,
version: glibmm_libversion,
darwin_versions: macos_darwin_versions,
+ implicit_include_directories: false,
include_directories: extra_include_dirs,
cpp_args: giomm_cpp_flags,
dependencies: giomm_build_dep,
@@ -387,9 +389,9 @@ if not meson.is_subproject()
)
endif
-# This is useful in the main project when giomm is used as a subproject.
-# It's also used when building example programs and test programs.
-giomm_dep = declare_dependency(
+# This is used when building example programs and test programs.
+# It's also a part of giomm_dep, when glibmm is a subproject.
+giomm_own_dep = declare_dependency(
sources: glibmm_built_h_file_targets + giomm_used_built_h_file_targets,
link_with: [glibmm_library, giomm_library],
include_directories: extra_include_dirs,
diff --git a/gio/giomm/slot_async.cc b/gio/giomm/slot_async.cc
index 4f2b6e2b..41c637df 100644
--- a/gio/giomm/slot_async.cc
+++ b/gio/giomm/slot_async.cc
@@ -14,7 +14,7 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "slot_async.h"
+#include <giomm/slot_async.h>
#include <glibmm/exceptionhandler.h>
#include <giomm/asyncresult.h>
diff --git a/gio/src/appinfo.ccg b/gio/src/appinfo.ccg
index f2397908..e1c43820 100644
--- a/gio/src/appinfo.ccg
+++ b/gio/src/appinfo.ccg
@@ -17,7 +17,7 @@
#include <giomm/file.h>
#include <glibmm/listhandle.h>
#include <glibmm/vectorutils.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
#include <gio/gio.h>
namespace Gio
diff --git a/gio/src/asyncinitable.ccg b/gio/src/asyncinitable.ccg
index f6fda2f8..314c5b3f 100644
--- a/gio/src/asyncinitable.ccg
+++ b/gio/src/asyncinitable.ccg
@@ -18,7 +18,7 @@
#include <glibmm/error.h>
#include <glibmm/exceptionhandler.h>
#include <giomm/cancellable.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/bufferedinputstream.ccg b/gio/src/bufferedinputstream.ccg
index 7c828080..46128b40 100644
--- a/gio/src/bufferedinputstream.ccg
+++ b/gio/src/bufferedinputstream.ccg
@@ -16,7 +16,7 @@
#include <gio/gio.h>
#include <glibmm/error.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/bufferedoutputstream.ccg b/gio/src/bufferedoutputstream.ccg
index c334f5cb..46df37ad 100644
--- a/gio/src/bufferedoutputstream.ccg
+++ b/gio/src/bufferedoutputstream.ccg
@@ -15,7 +15,7 @@
*/
#include <gio/gio.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/datainputstream.ccg b/gio/src/datainputstream.ccg
index 6291141e..b7335210 100644
--- a/gio/src/datainputstream.ccg
+++ b/gio/src/datainputstream.ccg
@@ -16,7 +16,7 @@
#include <gio/gio.h>
#include <glibmm/error.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/dbusaddress.ccg b/gio/src/dbusaddress.ccg
index 09a21888..c9d128fc 100644
--- a/gio/src/dbusaddress.ccg
+++ b/gio/src/dbusaddress.ccg
@@ -16,7 +16,7 @@
#include <gio/gio.h>
#include <glibmm/error.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg
index e28e7b4d..3ed00be3 100644
--- a/gio/src/dbusconnection.ccg
+++ b/gio/src/dbusconnection.ccg
@@ -27,7 +27,7 @@
#include <giomm/unixfdlist.h>
#endif
-#include "slot_async.h"
+#include <giomm/slot_async.h>
#include <mutex>
namespace
diff --git a/gio/src/dbusinterfacevtable.ccg b/gio/src/dbusinterfacevtable.ccg
index d47b5a9b..15cf0ace 100644
--- a/gio/src/dbusinterfacevtable.ccg
+++ b/gio/src/dbusinterfacevtable.ccg
@@ -21,7 +21,7 @@
#include <giomm/dbusmethodinvocation.h>
#include <giomm/dbusconnection.h>
#include <giomm/dbuserror.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace
{
diff --git a/gio/src/dbussubtreevtable.ccg b/gio/src/dbussubtreevtable.ccg
index 59ea2741..8783077f 100644
--- a/gio/src/dbussubtreevtable.ccg
+++ b/gio/src/dbussubtreevtable.ccg
@@ -21,7 +21,7 @@
#include <giomm/dbusmethodinvocation.h>
#include <giomm/dbusconnection.h>
#include <giomm/dbuserror.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace
{
diff --git a/gio/src/drive.ccg b/gio/src/drive.ccg
index 08a90d41..5fab4845 100644
--- a/gio/src/drive.ccg
+++ b/gio/src/drive.ccg
@@ -18,7 +18,7 @@
#include <giomm/volume.h>
#include <glibmm/error.h>
#include <glibmm/exceptionhandler.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/file.ccg b/gio/src/file.ccg
index a1ded835..ed32abb5 100644
--- a/gio/src/file.ccg
+++ b/gio/src/file.ccg
@@ -19,7 +19,7 @@
#include <utility>
#include <glibmm/error.h>
#include <glibmm/exceptionhandler.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace
{
diff --git a/gio/src/fileenumerator.ccg b/gio/src/fileenumerator.ccg
index 9b975bc6..58830c0c 100644
--- a/gio/src/fileenumerator.ccg
+++ b/gio/src/fileenumerator.ccg
@@ -18,7 +18,7 @@
#include <giomm/file.h>
#include <glibmm/error.h>
#include <glibmm/exceptionhandler.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/fileinputstream.ccg b/gio/src/fileinputstream.ccg
index 9280054c..9bd02160 100644
--- a/gio/src/fileinputstream.ccg
+++ b/gio/src/fileinputstream.ccg
@@ -15,7 +15,7 @@
*/
#include <gio/gio.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
#include <glibmm/exceptionhandler.h>
namespace Gio
diff --git a/gio/src/fileiostream.ccg b/gio/src/fileiostream.ccg
index f358384b..32c4337a 100644
--- a/gio/src/fileiostream.ccg
+++ b/gio/src/fileiostream.ccg
@@ -15,7 +15,7 @@
*/
#include <gio/gio.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
#include <glibmm/exceptionhandler.h>
namespace Gio
diff --git a/gio/src/fileoutputstream.ccg b/gio/src/fileoutputstream.ccg
index d1180606..a95ce4ec 100644
--- a/gio/src/fileoutputstream.ccg
+++ b/gio/src/fileoutputstream.ccg
@@ -18,7 +18,7 @@
#include <glib.h>
#include <glibmm/error.h>
#include <glibmm/exceptionhandler.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/inputstream.ccg b/gio/src/inputstream.ccg
index 620f93d9..35c15319 100644
--- a/gio/src/inputstream.ccg
+++ b/gio/src/inputstream.ccg
@@ -17,7 +17,7 @@
#include <gio/gio.h>
#include <glibmm/error.h>
#include <giomm/asyncresult.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/iostream.ccg b/gio/src/iostream.ccg
index 58072155..64e07882 100644
--- a/gio/src/iostream.ccg
+++ b/gio/src/iostream.ccg
@@ -17,7 +17,7 @@
#include <gio/gio.h>
#include <glibmm/error.h>
#include <giomm/asyncresult.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/loadableicon.ccg b/gio/src/loadableicon.ccg
index 10ddbe8d..2169a1d0 100644
--- a/gio/src/loadableicon.ccg
+++ b/gio/src/loadableicon.ccg
@@ -17,7 +17,7 @@
#include <gio/gio.h>
#include <glibmm/error.h>
#include <giomm/private/icon_p.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/mount.ccg b/gio/src/mount.ccg
index 939931d1..9bef22ee 100644
--- a/gio/src/mount.ccg
+++ b/gio/src/mount.ccg
@@ -19,7 +19,7 @@
#include <giomm/drive.h>
#include <giomm/volume.h>
#include <gio/gio.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/networkaddress.ccg b/gio/src/networkaddress.ccg
index 6f2f99d6..9c56a1f5 100644
--- a/gio/src/networkaddress.ccg
+++ b/gio/src/networkaddress.ccg
@@ -17,7 +17,7 @@
#include <gio/gio.h>
#include <glibmm/error.h>
#include <giomm/asyncresult.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/networkmonitor.ccg b/gio/src/networkmonitor.ccg
index 1cd79efe..78976614 100644
--- a/gio/src/networkmonitor.ccg
+++ b/gio/src/networkmonitor.ccg
@@ -16,7 +16,7 @@
#include <glibmm/exceptionhandler.h>
#include <gio/gio.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/networkservice.ccg b/gio/src/networkservice.ccg
index a081e60f..184527ee 100644
--- a/gio/src/networkservice.ccg
+++ b/gio/src/networkservice.ccg
@@ -16,7 +16,7 @@
#include <gio/gio.h>
#include <giomm/asyncresult.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/outputstream.ccg b/gio/src/outputstream.ccg
index 6ba8fe4d..c0158723 100644
--- a/gio/src/outputstream.ccg
+++ b/gio/src/outputstream.ccg
@@ -17,7 +17,7 @@
#include <gio/gio.h>
#include <glibmm/error.h>
#include <glibmm/exceptionhandler.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/permission.ccg b/gio/src/permission.ccg
index f647cbef..4d804e94 100644
--- a/gio/src/permission.ccg
+++ b/gio/src/permission.ccg
@@ -15,7 +15,7 @@
*/
#include <gio/gio.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/proxy.ccg b/gio/src/proxy.ccg
index bac28f6f..7331996f 100644
--- a/gio/src/proxy.ccg
+++ b/gio/src/proxy.ccg
@@ -18,7 +18,7 @@
#include <utility>
#include <glibmm/error.h>
#include <glibmm/exceptionhandler.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/proxyresolver.ccg b/gio/src/proxyresolver.ccg
index 9d0a0a39..d68b0ccb 100644
--- a/gio/src/proxyresolver.ccg
+++ b/gio/src/proxyresolver.ccg
@@ -19,7 +19,7 @@
#include <glibmm/error.h>
#include <glibmm/exceptionhandler.h>
#include <glibmm/vectorutils.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/resolver.ccg b/gio/src/resolver.ccg
index 77b6f5e1..39fca957 100644
--- a/gio/src/resolver.ccg
+++ b/gio/src/resolver.ccg
@@ -16,7 +16,7 @@
#include <gio/gio.h>
#include <glibmm/error.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/socket.ccg b/gio/src/socket.ccg
index 767882e8..aacf11de 100644
--- a/gio/src/socket.ccg
+++ b/gio/src/socket.ccg
@@ -18,7 +18,7 @@
#include <glibmm/error.h>
#include <giomm/asyncresult.h>
#include <giomm/socketsource.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/socketaddress.ccg b/gio/src/socketaddress.ccg
index f5d23a7b..fdb204e0 100644
--- a/gio/src/socketaddress.ccg
+++ b/gio/src/socketaddress.ccg
@@ -17,7 +17,7 @@
#include <gio/gio.h>
#include <glibmm/error.h>
#include <giomm/asyncresult.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/socketaddressenumerator.ccg b/gio/src/socketaddressenumerator.ccg
index 9e014836..4e4e921d 100644
--- a/gio/src/socketaddressenumerator.ccg
+++ b/gio/src/socketaddressenumerator.ccg
@@ -17,7 +17,7 @@
#include <gio/gio.h>
#include <glibmm/error.h>
#include <giomm/socketaddress.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/socketclient.ccg b/gio/src/socketclient.ccg
index 8339f12d..8f17c65d 100644
--- a/gio/src/socketclient.ccg
+++ b/gio/src/socketclient.ccg
@@ -16,7 +16,7 @@
#include <gio/gio.h>
#include <giomm/asyncresult.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/socketconnection.ccg b/gio/src/socketconnection.ccg
index 13c25693..b4fb3d76 100644
--- a/gio/src/socketconnection.ccg
+++ b/gio/src/socketconnection.ccg
@@ -15,7 +15,7 @@
*/
#include <gio/gio.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/socketlistener.ccg b/gio/src/socketlistener.ccg
index c48dbb8b..567deac6 100644
--- a/gio/src/socketlistener.ccg
+++ b/gio/src/socketlistener.ccg
@@ -15,7 +15,7 @@
*/
#include <gio/gio.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/tlsconnection.ccg b/gio/src/tlsconnection.ccg
index 4ec8d7e4..8b76d82b 100644
--- a/gio/src/tlsconnection.ccg
+++ b/gio/src/tlsconnection.ccg
@@ -18,4 +18,4 @@
#include <giomm/cancellable.h>
#include <giomm/tlsdatabase.h>
#include <giomm/tlsinteraction.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
diff --git a/gio/src/tlsdatabase.ccg b/gio/src/tlsdatabase.ccg
index 80ef0a7e..08ac12bc 100644
--- a/gio/src/tlsdatabase.ccg
+++ b/gio/src/tlsdatabase.ccg
@@ -19,7 +19,7 @@
#include <giomm/socketconnectable.h>
#include <giomm/tlscertificate.h>
#include <giomm/tlsinteraction.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace
{
diff --git a/gio/src/tlsinteraction.ccg b/gio/src/tlsinteraction.ccg
index 2252149c..2a43a278 100644
--- a/gio/src/tlsinteraction.ccg
+++ b/gio/src/tlsinteraction.ccg
@@ -18,4 +18,4 @@
#include <gio/gio.h>
#include <giomm/cancellable.h>
#include <giomm/tlspassword.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
diff --git a/gio/src/unixconnection.ccg b/gio/src/unixconnection.ccg
index 3b9929c8..b3ec278d 100644
--- a/gio/src/unixconnection.ccg
+++ b/gio/src/unixconnection.ccg
@@ -16,7 +16,7 @@
#include <gio/gio.h>
#include <gio/gunixconnection.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/gio/src/volume.ccg b/gio/src/volume.ccg
index 2d1d01a8..6836a2e2 100644
--- a/gio/src/volume.ccg
+++ b/gio/src/volume.ccg
@@ -19,7 +19,7 @@
#include <giomm/file.h>
#include <giomm/drive.h>
#include <gio/gio.h>
-#include "slot_async.h"
+#include <giomm/slot_async.h>
namespace Gio
{
diff --git a/glib/glibmm/meson.build b/glib/glibmm/meson.build
index b1736082..f218db4f 100644
--- a/glib/glibmm/meson.build
+++ b/glib/glibmm/meson.build
@@ -6,7 +6,7 @@
# is_host_windows, gmmproc, generate_wrap_init_pl, glibmm_libname,
# macos_darwin_versions
# Output: glibmm_hg_ccg_basenames, glibmm_extra_h_files, built_files_root,
-# glibmm_built_h_file_targets, glibmm_h_m4_files, glibmm_dep
+# glibmm_built_h_file_targets, glibmm_h_m4_files, glibmm_own_dep
glibmm_defs_basefiles = [
'glib.defs',
@@ -261,6 +261,7 @@ if maintainer_mode
glibmm_library = library(glibmm_libname, extra_glibmm_objects,
glibmm_built_cc_file_targets, glibmm_extra_cc_files, built_dummy_h_file_target,
+ implicit_include_directories: false,
include_directories: extra_include_dirs,
cpp_args: glibmm_cpp_args,
version: glibmm_libversion,
@@ -314,6 +315,7 @@ else # not maintainer_mode
glibmm_library = library(glibmm_libname, extra_glibmm_objects,
built_cc_files, glibmm_extra_cc_files,
+ implicit_include_directories: false,
include_directories: extra_include_dirs,
cpp_args: glibmm_cpp_args,
version: glibmm_libversion,
@@ -358,9 +360,9 @@ if not meson.is_subproject()
)
endif
-# This is useful in the main project when glibmm is used as a subproject.
-# It's also used when building example programs and test programs.
-glibmm_dep = declare_dependency(
+# This is used when building example programs and test programs.
+# It's also a part of glibmm_dep, when glibmm is a subproject.
+glibmm_own_dep = declare_dependency(
sources: glibmm_built_h_file_targets,
link_with: glibmm_library,
include_directories: extra_include_dirs,
diff --git a/meson.build b/meson.build
index 4452a78a..ccab993b 100644
--- a/meson.build
+++ b/meson.build
@@ -6,7 +6,8 @@ project('glibmm', 'cpp',
default_options: [
'cpp_std=c++11'
],
- meson_version: '>= 0.50.0', # required for python3.path()
+ meson_version: '>= 0.54.0', # required for meson.override_dependency()
+ # and dep.get_variable(internal:)
)
glibmm_api_version = '2.4'
@@ -254,6 +255,71 @@ if not meson.is_subproject()
project_source_root,
'untracked' / 'build_scripts',
)
+else
+ # This is a subproject.
+
+ # A version of gmmproc that can be executed uninstalled by a main project.
+ conf_data_subproj = configuration_data()
+ conf_data_subproj.merge_from(gmmproc_conf_data)
+ conf_data_subproj.set('configure_input', 'tools/gmmproc (for execution uninstalled). Generated from
gmmproc.in')
+ conf_data_subproj.set('libdir', project_build_root)
+ gmmproc_subproj = configure_file(
+ input: 'tools' / 'gmmproc.in',
+ output: '@BASENAME@',
+ configuration: conf_data_subproj,
+ install: false,
+ )
+ gmmproc_subproj_dir = project_build_root / glibmm_pcname / 'proc'
+ run_command(
+ python3, handle_built_files_py, 'copy_built_files',
+ project_build_root,
+ gmmproc_subproj_dir,
+ 'gmmproc',
+ )
+ run_command(
+ python3, handle_built_files_py, 'copy_built_files',
+ project_build_root / 'tools',
+ gmmproc_subproj_dir,
+ 'generate_wrap_init.pl',
+ )
+
+ # Copy files needed by gmmproc from source dir to build dir.
+ # The directory structure must be the same as in the installation directory.
+ run_command(
+ python3, handle_built_files_py, 'copy_built_files',
+ project_source_root / 'tools' / 'm4',
+ gmmproc_subproj_dir / 'm4',
+ m4_basefiles,
+ )
+ run_command(
+ python3, handle_built_files_py, 'copy_built_files',
+ project_source_root / 'tools' / 'pm',
+ gmmproc_subproj_dir / 'pm',
+ pm_basefiles,
+ )
+
+ glibmm_dep = declare_dependency(
+ dependencies: glibmm_own_dep,
+ variables: {
+ 'gmmprocdir': gmmproc_subproj_dir,
+ 'doxytagfile': tag_file.full_path(),
+ 'htmlrefdir': install_prefix / install_docdir / 'reference' / 'html',
+ 'htmlrefpub': 'http://library.gnome.org/devel/' + pkg_conf_data.get_unquoted('PACKAGE_TARNAME') +
'/unstable/'
+ }
+ )
+ giomm_dep = declare_dependency(
+ dependencies: giomm_own_dep,
+ variables: {
+ 'doxytagfile': tag_file.full_path(),
+ 'htmlrefdir': install_prefix / install_docdir / 'reference' / 'html',
+ 'htmlrefpub': 'http://library.gnome.org/devel/' + pkg_conf_data.get_unquoted('PACKAGE_TARNAME') +
'/unstable/'
+ }
+ )
+
+ # A main project that looks for glibmm_pcname.pc and giomm_pcname.pc
+ # shall find glibmm_dep and giomm_dep.
+ meson.override_dependency(glibmm_pcname, glibmm_dep)
+ meson.override_dependency(giomm_pcname, giomm_dep)
endif
# Print a summary.
diff --git a/subprojects/glib.wrap b/subprojects/glib.wrap
new file mode 100644
index 00000000..a6827389
--- /dev/null
+++ b/subprojects/glib.wrap
@@ -0,0 +1,8 @@
+[wrap-git]
+directory=glib
+url=https://gitlab.gnome.org/GNOME/glib.git
+revision=master
+depth=1
+
+[provide]
+dependency_names = glib-2.0, gobject-2.0, gmodule-2.0, gio-2.0, gio-unix-2.0
diff --git a/subprojects/sigc++-2.0.wrap b/subprojects/sigc++-2.0.wrap
new file mode 100644
index 00000000..3efff75a
--- /dev/null
+++ b/subprojects/sigc++-2.0.wrap
@@ -0,0 +1,8 @@
+[wrap-git]
+directory=libsigcplusplus-2.0
+url=https://github.com/libsigcplusplus/libsigcplusplus.git
+revision=libsigc++-2-10
+depth=1
+
+[provide]
+dependency_names = sigc++-2.0
diff --git a/tests/meson.build b/tests/meson.build
index 4a31c95d..7972e125 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,6 +1,6 @@
# tests
-# input: glibmm_dep, giomm_dep
+# input: glibmm_own_dep, giomm_own_dep
test_programs = [
# [[dir-name], exe-name, [sources], giomm-example (not just glibmm-example)]
@@ -54,7 +54,7 @@ foreach ex : test_programs
endforeach
is_multithread = ex[0][0] == 'glibmm_mainloop'
- mm_dep = ex[3] ? giomm_dep : glibmm_dep
+ mm_dep = ex[3] ? giomm_own_dep : glibmm_own_dep
exe_file = executable(ex_name, ex_sources,
cpp_args: ['-DGLIBMM_DISABLE_DEPRECATED', '-DGIOMM_DISABLE_DEPRECATED'],
diff --git a/tools/extra_defs_gen/meson.build b/tools/extra_defs_gen/meson.build
index 0cc3cfba..b954f309 100644
--- a/tools/extra_defs_gen/meson.build
+++ b/tools/extra_defs_gen/meson.build
@@ -2,7 +2,7 @@
# Input: glibmm_build_dep, giomm_build_dep, glibmm_api_version,
# glibmm_libversion, glibmm_pcname, msvc14x_toolset_ver,
-# macos_darwin_versions
+# macos_darwin_versions, handle_built_files_py, project_build_root
# Output: -
glibmm_generate_extra_defs_library = library(
@@ -10,11 +10,26 @@ glibmm_generate_extra_defs_library = library(
'generate_extra_defs.cc',
version: glibmm_libversion,
darwin_versions: macos_darwin_versions,
+ implicit_include_directories: false,
cpp_args: '-DGLIBMM_GEN_EXTRA_DEFS_BUILD',
dependencies: glibmm_build_dep,
install: true,
)
+if meson.is_subproject()
+ glibmm_generate_extra_defs_dep = declare_dependency(
+ link_with: glibmm_generate_extra_defs_library,
+ )
+
+ # Copy the header file to a place where a main project can find it.
+ run_command(
+ python3, handle_built_files_py, 'copy_built_files',
+ meson.current_source_dir(),
+ project_build_root / 'glib' / 'glibmm_generate_extra_defs',
+ 'generate_extra_defs.h',
+ )
+endif
+
install_headers('generate_extra_defs.h', subdir: glibmm_pcname / 'glibmm_generate_extra_defs')
executable('generate_defs_glib', 'generate_defs_glib.cc',
diff --git a/tools/meson.build b/tools/meson.build
index ed7443dd..370c8f3f 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -1,7 +1,8 @@
# tools
# Input: perl, m4, install_prefix, install_libdir, glibmm_pcname
-# Output: install_procdir, m4_files, pm_files, gmmproc, generate_wrap_init_pl
+# Output: install_procdir, m4_basefiles, m4_files, pm_basefiles, pm_files,
+# gmmproc_conf_data, gmmproc, generate_wrap_init_pl
subdir('extra_defs_gen')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]