aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ciimage/Dockerfile2
-rw-r--r--mesonbuild/mesonmain.py19
-rw-r--r--mesonbuild/modules/gnome.py6
-rw-r--r--test cases/frameworks/7 gnome/gdbus/meson.build4
-rw-r--r--test cases/frameworks/7 gnome/installed_files.txt1
5 files changed, 26 insertions, 6 deletions
diff --git a/ciimage/Dockerfile b/ciimage/Dockerfile
index 8573367..73f1495 100644
--- a/ciimage/Dockerfile
+++ b/ciimage/Dockerfile
@@ -3,7 +3,7 @@ FROM ubuntu:artful
RUN apt-get -y update && apt-get -y upgrade \
&& apt-get -y install git wget unzip \
&& apt-get -y build-dep meson \
-&& apt-get -y install qt5-default clang \
+&& apt-get -y install qt5-default qtbase5-private-dev clang \
&& apt-get -y install pkg-config-arm-linux-gnueabihf g++-7-arm-linux-gnueabihf \
&& apt-get -y install doxygen \
&& apt-get -y install python3-pip libxml2-dev libxslt1-dev cmake libyaml-dev \
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index c4a4d2a..2b6281d 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -15,10 +15,12 @@
import sys, stat, traceback, argparse
import datetime
import os.path
+import platform
+import cProfile as profile
+
from . import environment, interpreter, mesonlib
from . import build
from . import mconf, mintro, mtest, rewriter, minit
-import platform
from . import mlog, coredata
from .mesonlib import MesonException
from .wrap import WrapMode, wraptool
@@ -36,6 +38,8 @@ def create_parser():
p.add_argument('--wrap-mode', default=WrapMode.default,
type=wrapmodetype, choices=WrapMode,
help='Special wrap mode to use')
+ p.add_argument('--profile-self', action='store_true', dest='profile',
+ help=argparse.SUPPRESS)
p.add_argument('directories', nargs='*')
return p
@@ -175,7 +179,11 @@ class MesonApp:
mlog.log('Target machine cpu:', mlog.bold(intr.builtin['target_machine'].cpu_method([], {})))
mlog.log('Build machine cpu family:', mlog.bold(intr.builtin['build_machine'].cpu_family_method([], {})))
mlog.log('Build machine cpu:', mlog.bold(intr.builtin['build_machine'].cpu_method([], {})))
- intr.run()
+ if self.options.profile:
+ fname = os.path.join(self.build_dir, 'meson-private', 'profile-interpreter.log')
+ profile.runctx('intr.run()', globals(), locals(), filename=fname)
+ else:
+ intr.run()
try:
dumpfile = os.path.join(env.get_scratch_dir(), 'build.dat')
# We would like to write coredata as late as possible since we use the existence of
@@ -185,7 +193,12 @@ class MesonApp:
# sync with the time that gets applied to any files. Thus, we dump this file as late as
# possible, but before build files, and if any error occurs, delete it.
cdf = env.dump_coredata()
- g.generate(intr)
+ if self.options.profile:
+ fname = 'profile-{}-backend.log'.format(self.options.backend)
+ fname = os.path.join(self.build_dir, 'meson-private', fname)
+ profile.runctx('g.generate(intr)', globals(), locals(), filename=fname)
+ else:
+ g.generate(intr)
build.save(b, dumpfile)
# Post-conf scripts must be run after writing coredata or else introspection fails.
g.run_postconf_scripts()
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index abefe05..be090e2 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -959,11 +959,15 @@ This will become a hard error in the future.''')
self._print_gdbus_warning()
cmd += ['--generate-c-code', '@OUTDIR@/' + namebase, '@INPUT@']
outputs = [namebase + '.c', namebase + '.h']
+ install = kwargs.get('install_header', False)
custom_kwargs = {'input': xml_files,
'output': outputs,
'command': cmd,
- 'build_by_default': build_by_default
+ 'build_by_default': build_by_default,
+ 'install': install,
}
+ if install and 'install_dir' in kwargs:
+ custom_kwargs['install_dir'] = [False, kwargs['install_dir']]
ct = build.CustomTarget(target_name, state.subdir, state.subproject, custom_kwargs)
# Ensure that the same number (and order) of arguments are returned
# regardless of the gdbus-codegen (glib) version being used
diff --git a/test cases/frameworks/7 gnome/gdbus/meson.build b/test cases/frameworks/7 gnome/gdbus/meson.build
index 68ad706..4625931 100644
--- a/test cases/frameworks/7 gnome/gdbus/meson.build
+++ b/test cases/frameworks/7 gnome/gdbus/meson.build
@@ -14,7 +14,9 @@ gdbus_src = gnome.gdbus_codegen('generated-gdbus',
annotations : [
['com.example.Hello()', 'org.freedesktop.DBus.Deprecated', 'true']
],
- docbook : 'generated-gdbus-doc'
+ docbook : 'generated-gdbus-doc',
+ install_header : true,
+ install_dir : get_option('includedir')
)
assert(gdbus_src.length() == 3, 'expected 3 targets')
diff --git a/test cases/frameworks/7 gnome/installed_files.txt b/test cases/frameworks/7 gnome/installed_files.txt
index ac132ef..7502888 100644
--- a/test cases/frameworks/7 gnome/installed_files.txt
+++ b/test cases/frameworks/7 gnome/installed_files.txt
@@ -15,3 +15,4 @@ usr/share/gir-1.0/MesonDep2-1.0.gir
usr/share/glib-2.0/schemas/com.github.meson.gschema.xml
usr/share/simple-resources.gresource
usr/include/simple-resources.h
+usr/include/generated-gdbus.h