mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-25 18:39:00 +02:00
meson: Improve MSVC and MinGW support and fix dependencies everywhere
Disable gio tests on Windows, fix .gitignore to not ignore config.h.meson, and add more things to it. Rename the library file naming and versioning to match what Autotools outputs, e.g., libglib-2.0.so.0.5000.2 on Linux, libglib-2.0-0.dll and glib-2.0-0.dll on Windows with MSVC. Several more tiny fixes, more executables built and installed, install pkg-config and m4 files, fix building of gobject tests. Changes to gdbus-codegen to support out-of-tree builds without environment variables set (which you can't in Meson). We now add the build directory to the Python module search path.
This commit is contained in:
committed by
Matthias Clasen
parent
213957970e
commit
fe2a9887a8
@@ -50,7 +50,7 @@ class CodeGenerator:
|
||||
self.ns_upper = ''
|
||||
self.ns_lower = ''
|
||||
self.interface_prefix = interface_prefix
|
||||
self.header_guard = header_name.upper().replace('.', '_').replace('-', '_').replace('/', '_')
|
||||
self.header_guard = header_name.upper().replace('.', '_').replace('-', '_').replace('/', '_').replace(':', '_')
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@@ -19,7 +19,4 @@
|
||||
#
|
||||
# Author: David Zeuthen <davidz@redhat.com>
|
||||
|
||||
DATADIR = "@datarootdir@"
|
||||
DATADIR = DATADIR.replace(
|
||||
"${prefix}", "@prefix@")
|
||||
VERSION = "@VERSION@"
|
||||
|
@@ -24,14 +24,18 @@ import os
|
||||
import sys
|
||||
|
||||
srcdir = os.getenv('UNINSTALLED_GLIB_SRCDIR', None)
|
||||
filedir = os.path.dirname(__file__)
|
||||
|
||||
if srcdir is not None:
|
||||
path = os.path.join(srcdir, 'gio', 'gdbus-2.0')
|
||||
elif os.name == 'nt':
|
||||
# Makes gdbus-codegen 'relocatable' at runtime on Windows.
|
||||
path = os.path.join(os.path.dirname(__file__), '..', 'share', 'glib-2.0')
|
||||
elif os.path.basename(filedir) == 'bin':
|
||||
# Make the prefix containing gdbus-codegen 'relocatable' at runtime by
|
||||
# adding /some/prefix/bin/../share/glib-2.0 to the python path
|
||||
path = os.path.join(filedir, '..', 'share', 'glib-2.0')
|
||||
else:
|
||||
path = os.path.join('@datadir@', 'glib-2.0')
|
||||
# Assume that the modules we need are in the current directory and add the
|
||||
# parent directory to the python path.
|
||||
path = os.path.join(filedir, '..')
|
||||
|
||||
sys.path.insert(0, os.path.abspath(path))
|
||||
from codegen import codegen_main
|
||||
|
35
gio/gdbus-2.0/codegen/meson.build
Normal file
35
gio/gdbus-2.0/codegen/meson.build
Normal file
@@ -0,0 +1,35 @@
|
||||
gdbus_codegen_files = [
|
||||
'__init__.py',
|
||||
'codegen.py',
|
||||
'codegen_main.py',
|
||||
'codegen_docbook.py',
|
||||
'dbustypes.py',
|
||||
'parser.py',
|
||||
'utils.py',
|
||||
]
|
||||
|
||||
gdbus_codegen_conf = configuration_data()
|
||||
gdbus_codegen_conf.set('VERSION', glib_version)
|
||||
gdbus_codegen_conf.set('PYTHON', python.path())
|
||||
|
||||
# Install gdbus-codegen executable
|
||||
# FIXME: Set permissions
|
||||
gdbus_codegen = configure_file(input : 'gdbus-codegen.in',
|
||||
output : 'gdbus-codegen',
|
||||
install : true,
|
||||
install_dir : 'bin', configuration : gdbus_codegen_conf)
|
||||
|
||||
configure_file(input : 'config.py.in',
|
||||
output : 'config.py',
|
||||
install : true,
|
||||
install_dir : 'share/glib-2.0/codegen', configuration : gdbus_codegen_conf)
|
||||
|
||||
blank_conf = configuration_data()
|
||||
foreach f : gdbus_codegen_files
|
||||
# Copy these into the builddir so that gdbus-codegen can be used uninstalled
|
||||
# and then install it too so that it can be used after installation
|
||||
configure_file(input : f, output : f,
|
||||
install : true,
|
||||
install_dir : 'share/glib-2.0/codegen',
|
||||
configuration : blank_conf)
|
||||
endforeach
|
Reference in New Issue
Block a user