aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/shell-completions/zsh/_meson213
-rw-r--r--data/syntax-highlighting/emacs/meson.el (renamed from data/meson.el)0
-rw-r--r--data/syntax-highlighting/vim/README (renamed from syntax-highlighting/vim/README)0
-rw-r--r--data/syntax-highlighting/vim/ftdetect/meson.vim (renamed from syntax-highlighting/vim/ftdetect/meson.vim)0
-rw-r--r--data/syntax-highlighting/vim/indent/meson.vim (renamed from syntax-highlighting/vim/indent/meson.vim)0
-rw-r--r--data/syntax-highlighting/vim/syntax/meson.vim (renamed from syntax-highlighting/vim/syntax/meson.vim)0
-rw-r--r--docs/markdown/Reference-manual.md19
-rw-r--r--docs/markdown/Syntax.md91
-rw-r--r--docs/markdown/i18n-module.md4
-rwxr-xr-xdocs/markdown/snippets/get_unquoted.md4
-rw-r--r--docs/markdown/snippets/prefix-dependent-defaults.md10
-rw-r--r--mesonbuild/compilers/compilers.py4
-rw-r--r--mesonbuild/coredata.py31
-rw-r--r--mesonbuild/dependencies/base.py2
-rw-r--r--mesonbuild/dependencies/dev.py24
-rw-r--r--mesonbuild/dependencies/misc.py26
-rw-r--r--mesonbuild/interpreter.py15
-rw-r--r--mesonbuild/mesonmain.py7
-rw-r--r--mesonbuild/modules/qt.py24
-rw-r--r--mesonbuild/scripts/meson_install.py30
-rwxr-xr-xrun_unittests.py49
-rw-r--r--test cases/common/16 configure file/dumpprog.c7
-rw-r--r--test cases/common/16 configure file/meson.build6
-rw-r--r--test cases/frameworks/4 qt/main.cpp19
-rw-r--r--test cases/frameworks/4 qt/mainWindow.ui24
-rw-r--r--test cases/frameworks/4 qt/meson.build17
-rw-r--r--test cases/python3/2 extmodule/meson.build5
27 files changed, 531 insertions, 100 deletions
diff --git a/data/shell-completions/zsh/_meson b/data/shell-completions/zsh/_meson
new file mode 100644
index 0000000..877d700
--- /dev/null
+++ b/data/shell-completions/zsh/_meson
@@ -0,0 +1,213 @@
+#compdef meson mesonconf=meson-configure mesontest=meson-test mesonintrospect=meson-introspect
+
+# vim:ts=2 sw=2
+
+# Copyright (c) 2017 Arseny Maslennikov
+# All rights reserved. Individual authors, whether or not
+# specifically named, retain copyright in all changes; in what follows, they
+# are referred to as `the Meson development team'. This is for convenience
+# only and this body has no legal status. This file is distributed under
+# the following licence.
+#
+# Permission is hereby granted, without written agreement and without
+# licence or royalty fees, to use, copy, modify, and distribute this
+# software and to distribute modified versions of this software for any
+# purpose, provided that the above copyright notice and the following
+# two paragraphs appear in all copies of this software.
+#
+# In no event shall the Meson development team be liable to any party for
+# direct, indirect, special, incidental, or consequential damages arising out
+# of the use of this software and its documentation, even if the Meson
+# development team have been advised of the possibility of such damage.
+#
+# The Meson development team specifically disclaim any warranties, including,
+# but not limited to, the implied warranties of merchantability and fitness
+# for a particular purpose. The software provided hereunder is on an "as is"
+# basis, and the Meson development team have no obligation to provide
+# maintenance, support, updates, enhancements, or modifications.
+
+local curcontext="$curcontext" state line
+local -i ret
+
+local __meson_backends="(ninja xcode ${(j. .)${:-vs{,2010,2015,2017}}})"
+local __meson_build_types="(plain debug debugoptimized minsize release)"
+local __meson_wrap_modes="(WrapMode.{default,nofallback,nodownload})"
+
+local -a meson_commands=(
+'setup:set up a build directory'
+'configure:configure a project'
+'test:run tests'
+'introspect:query project properties'
+'wrap:manage source dependencies'
+)
+
+(( $+functions[__meson_is_build_dir] )) || __meson_is_build_dir() {
+ local mpd="${1:-$PWD}/meson-private"
+ [[ -f "$mpd/build.dat" && -f "$mpd/coredata.dat" ]]
+ return $?
+}
+
+# TODO: implement build option completion
+(( $+functions[__meson_build_options] )) || __meson_build_options() {}
+# TODO: implement target name completion
+(( $+functions[__meson_targets] )) || __meson_targets() {}
+# `meson introspect` currently can provide that information in JSON.
+# We can:
+# 1) pipe its output to python3 -m json.tool | grep "$alovelyregex" | cut <...>
+# 2) teach mintro.py to use a different output format
+# (or perhaps just to select the fields printed)
+
+(( $+functions[__meson_test_names] )) || __meson_test_names() {
+ local rtests
+ if rtests="$(_call_program meson meson test ${opt_args[-C]:+-C "$opt_args[-C]"} --list)";
+ then
+ local -a tests=(${(@f)rtests})
+ _describe -t "tests" "Meson tests" tests
+ else
+ _message -r "current working directory is not a build directory"
+ _message -r 'use -C $build_dir or cd $build_dir'
+ fi
+}
+
+(( $+functions[_meson_commands] )) || _meson_commands() {
+ _describe -t commands "Meson subcommands" meson_commands
+}
+
+(( $+functions[_meson-setup] )) || _meson-setup() {
+ local firstd secondd
+ if [[ -f "meson.build" ]]; then
+ # if there's no second argument on the command line
+ # cwd will implicitly be substituted:
+ # - as the source directory if it has a file with the name "meson.build";
+ # - as the build directory otherwise
+ # more info in mesonbuild/mesonmain.py
+ firstd="build"
+ secondd="source"
+ else
+ firstd="source"
+ secondd="build"
+ fi
+
+ _arguments \
+ '*-D-[set the value of a build option]:build option:__meson_build_options' \
+ '--prefix=[installation prefix]: :_directories' \
+ '--libdir=[library directory]: :_directories' \
+ '--libexecdir=[library executable directory]: :_directories' \
+ '--bindir=[executable directory]: :_directories' \
+ '--sbindir=[system executable directory]: :_directories' \
+ '--includedir=[header file directory]: :_directories' \
+ '--datadir=[data file directory]: :_directories' \
+ '--mandir=[manual page directory]: :_directories' \
+ '--infodir=[info page directory]: :_directories' \
+ '--localedir=[locale data directory]: :_directories' \
+ '--sysconfdir=[system configuration directory]: :_directories' \
+ '--localstatedir=[local state data directory]: :_directories' \
+ '--sharedstatedir=[arch-independent data directory]: :_directories' \
+ '--backend=[backend to use]:Meson backend:'"$__meson_backends" \
+ '--buildtype=[build type to use]:Meson build type:'"$__meson_build_types" \
+ '--strip[strip targets on install]' \
+ '--unity=[unity builds on/off]:whether to do unity builds:(on off subprojects)' \
+ '--werror[treat warnings as errors]' \
+ '--layout=[build directory layout]:build directory layout:(flat mirror)' \
+ '--default-library=[default library type]:default library type:(shared static)' \
+ '--warnlevel=[compiler warning level]:compiler warning level:warning level:(1 2 3)' \
+ '--stdsplit=[split stdout and stderr in test logs]' \
+ '--errorlogs=[prints the logs from failing tests]' \
+ '--cross-file=[cross-compilation environment description]:cross file:_files' \
+ '--wrap-mode=[special wrap mode]:wrap mode:'"$__meson_wrap_modes" \
+ ":$firstd directory:_directories" \
+ "::$secondd directory:_directories" \
+ #
+}
+
+(( $+functions[_meson-configure] )) || _meson-configure() {
+ local curcontext="$curcontext"
+ # TODO: implement 'mesonconf @file'
+ local -a specs=(
+ '--clearcache[clear cached state]'
+ '*-D-[set the value of a build option]:build option:__meson_build_options'
+ '::build directory:_directories'
+ )
+
+ _arguments \
+ '(: -)'{'--help','-h'}'[show a help message and quit]' \
+ "${(@)specs}"
+}
+
+(( $+functions[_meson-test] )) || _meson-test() {
+ local curcontext="$curcontext"
+
+ # TODO: complete test suites
+ local -a specs=(
+ '(--quiet -q)'{'--quiet','-q'}'[produce less output to the terminal]'
+ '(--verbose -v)'{'--verbose','-v'}'[do not redirect stdout and stderr]'
+ '(--timeout-multiplier -t)'{'--timeout-multiplier','-t'}'[a multiplier for test timeouts]:Python floating-point number: '
+ '-C[directory to cd into]: :_directories'
+ '--repeat[number of times to run the tests]:number of times to repeat: '
+ '--no-rebuild[do not rebuild before running tests]'
+ '--gdb[run tests under gdb]'
+ '--list[list available tests]'
+ '(--wrapper --wrap)'{'--wrapper=','--wrap='}'[wrapper to run tests with]:wrapper program:_path_commands'
+ '(--no-suite)--suite[only run tests from this suite]:test suite: '
+ '(--suite)--no-suite[do not run tests from this suite]:test suite: '
+ '--no-stdsplit[do not split stderr and stdout in logs]'
+ '--print-errorlogs[print logs for failing tests]'
+ '--benchmark[run benchmarks instead of tests]'
+ '--logbase[base name for log file]:filename: '
+ '--num-processes[how many threads to use]:number of processes: '
+ '--setup[which test setup to use]:test setup: '
+ '--test-args[arguments to pass to the tests]: : '
+ '*:Meson tests:__meson_test_names'
+ )
+
+ _arguments \
+ '(: -)'{'--help','-h'}'[show a help message and quit]' \
+ "${(@)specs}"
+}
+
+(( $+functions[_meson-introspect] )) || _meson-introspect() {
+ local curcontext="$curcontext"
+ local -a specs=(
+ '--targets[list top level targets]'
+ '--installed[list all installed files and directories]'
+ '--target-files[list source files for a given target]:target:__meson_targets'
+ '--buildsystem-files[list files that belong to the build system]'
+ '--buildoptions[list all build options]'
+ '--tests[list all unit tests]'
+ '--benchmarks[list all benchmarks]'
+ '--dependencies[list external dependencies]'
+ '--projectinfo[show project information]'
+ '::build directory:_directories'
+ )
+_arguments \
+ '(: -)'{'--help','-h'}'[show a help message and quit]' \
+ "${(@)specs}"
+}
+
+(( $+functions[_meson-wrap] )) || _meson-wrap() {
+ # TODO
+}
+
+if [[ $service != meson ]]; then
+ _call_function ret _$service
+ return ret
+fi
+
+_arguments -C -R \
+ '(: -)'{'--help','-h'}'[show a help message and quit]' \
+ '(: -)'{'--version','-v'}'[show version information and quit]' \
+ '(-): :_meson_commands' \
+ '*:: :->post-command' \
+#
+ret=$?
+
+[[ $ret = 300 ]] && case "$state" in
+ post-command)
+ service="meson-$words[1]"
+ curcontext=${curcontext%:*:*}:$service:
+ _call_function ret _$service
+ ;;
+esac
+
+return ret
+
diff --git a/data/meson.el b/data/syntax-highlighting/emacs/meson.el
index 36f7eb9..36f7eb9 100644
--- a/data/meson.el
+++ b/data/syntax-highlighting/emacs/meson.el
diff --git a/syntax-highlighting/vim/README b/data/syntax-highlighting/vim/README
index 1afa243..1afa243 100644
--- a/syntax-highlighting/vim/README
+++ b/data/syntax-highlighting/vim/README
diff --git a/syntax-highlighting/vim/ftdetect/meson.vim b/data/syntax-highlighting/vim/ftdetect/meson.vim
index 84db70c..84db70c 100644
--- a/syntax-highlighting/vim/ftdetect/meson.vim
+++ b/data/syntax-highlighting/vim/ftdetect/meson.vim
diff --git a/syntax-highlighting/vim/indent/meson.vim b/data/syntax-highlighting/vim/indent/meson.vim
index 8553ec0..8553ec0 100644
--- a/syntax-highlighting/vim/indent/meson.vim
+++ b/data/syntax-highlighting/vim/indent/meson.vim
diff --git a/syntax-highlighting/vim/syntax/meson.vim b/data/syntax-highlighting/vim/syntax/meson.vim
index 49921c1..49921c1 100644
--- a/syntax-highlighting/vim/syntax/meson.vim
+++ b/data/syntax-highlighting/vim/syntax/meson.vim
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index eee4405..2aa9665 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -282,8 +282,8 @@ system) with the given name with `pkg-config` if possible and with
[library-specific fallback detection logic](Dependencies.md)
otherwise. This function supports the following keyword arguments:
-- `default_options` *(added 0.37.0)* an array of option values that
- override those set in the project's `default_options` invocation
+- `default_options` *(added 0.37.0)* an array of default option values
+ that override those set in the subproject's `meson_options.txt`
(like `default_options` in [`project()`](#project), they only have
effect when Meson is run for the first time, and command line
arguments override any default options in build files)
@@ -1046,11 +1046,11 @@ example a subproject called `foo` must be located in
`${MESON_SOURCE_ROOT}/subprojects/foo`. Supports the following keyword
arguments:
- - `default_options`, *(added 0.37.0)* an array of default option
- values that override those set in the project's `default_options`
- invocation (like `default_options` in `project`, they only have
- effect when Meson is run for the first time, and command line
- arguments override any default options in build files)
+ - `default_options` *(added 0.37.0)* an array of default option values
+ that override those set in the subproject's `meson_options.txt`
+ (like `default_options` in `project`, they only have effect when
+ Meson is run for the first time, and command line arguments override
+ any default options in build files)
- `version` keyword argument that works just like the one in
`dependency`. It specifies what version the subproject should be,
as an example `>=1.0.1`
@@ -1556,6 +1556,11 @@ page](Configuration.md) It has three methods:
value has not been set returns `default_value` if it is defined
*(added 0.38.0)* and errors out if not
+- `get_unquoted(varname, default_value)` returns the value of `varname`
+ but without surrounding double quotes (`"`). If the value has not been
+ set returns `default_value` if it is defined and errors out if not.
+ Available since 0.43.0
+
- `has(varname)`, returns `true` if the specified variable is set
- `merge_from(other)` takes as argument a different configuration data
diff --git a/docs/markdown/Syntax.md b/docs/markdown/Syntax.md
index eaf24cf..88b9bbb 100644
--- a/docs/markdown/Syntax.md
+++ b/docs/markdown/Syntax.md
@@ -4,23 +4,39 @@ short-description: Syntax and structure of Meson files
# Syntax
-The syntax of Meson's specification language has been kept as simple as possible. It is *strongly typed* so no object is ever converted to another under the covers. Variables have no visible type which makes Meson *dynamically typed* (also known as *duck typed*).
-
-The main building blocks of the language are *variables*, *numbers*, *booleans*, *strings*, *arrays*, *function calls*, *method calls*, *if statements* and *includes*.
-
-Usually one Meson statement takes just one line. There is no way to have multiple statements on one line as in e.g. *C*. Function and method calls' argument lists can be split over multiple lines. Meson will autodetect this case and do the right thing. In other cases you can get multi-line statements by ending the line with a `\`. Apart from line ending whitespace has no syntactic meaning.
+The syntax of Meson's specification language has been kept as simple
+as possible. It is *strongly typed* so no object is ever converted to
+another under the covers. Variables have no visible type which makes
+Meson *dynamically typed* (also known as *duck typed*).
+
+The main building blocks of the language are *variables*, *numbers*,
+*booleans*, *strings*, *arrays*, *function calls*, *method calls*, *if
+statements* and *includes*.
+
+Usually one Meson statement takes just one line. There is no way to
+have multiple statements on one line as in e.g. *C*. Function and
+method calls' argument lists can be split over multiple lines. Meson
+will autodetect this case and do the right thing. In other cases you
+can get multi-line statements by ending the line with a `\`. Apart
+from line ending whitespace has no syntactic meaning.
Variables
--
-Variables in Meson work just like in other high level programming languages. A variable can contain a value of any type, such as an integer or a string. Variables don't need to be predeclared, you can just assign to them and they appear. Here's how you would assign values to two different variables.
+Variables in Meson work just like in other high level programming
+languages. A variable can contain a value of any type, such as an
+integer or a string. Variables don't need to be predeclared, you can
+just assign to them and they appear. Here's how you would assign
+values to two different variables.
```meson
var1 = 'hello'
var2 = 102
```
-One important difference in how variables work in Meson is that all variables are immutable. This is different from, for example, how Python works.
+One important difference in how variables work in Meson is that all
+objects are immutable. This is different from, for example, how Python
+works.
```meson
var1 = [1, 2, 3]
@@ -33,7 +49,8 @@ var2 += [4]
Numbers
--
-Meson supports only integer numbers. They are declared simply by writing them out. Basic arithmetic operations are supported.
+Meson supports only integer numbers. They are declared simply by
+writing them out. Basic arithmetic operations are supported.
```meson
x = 1 + 2
@@ -60,13 +77,15 @@ truth = true
Strings
--
-Strings in Meson are declared with single quotes. To enter a literal single quote do it like this:
+Strings in Meson are declared with single quotes. To enter a literal
+single quote do it like this:
```meson
single quote = 'contains a \' character'
```
-Similarly `\n` gets converted to a newline and `\\\\` to a single backslash.
+Similarly `\n` gets converted to a newline and `\\\\` to a single
+backslash.
#### String concatenation
@@ -80,7 +99,8 @@ combined = str1 + '_' + str2 # combined is now abc_xyz
#### Strings running over multiple lines
-Strings running over multiple lines can be declared with three single quotes, like this:
+Strings running over multiple lines can be declared with three single
+quotes, like this:
```meson
multiline_string = '''#include <foo.h>
@@ -89,7 +109,8 @@ int main (int argc, char ** argv) {
}'''
```
-This can also be combined with the string formatting functionality described below.
+This can also be combined with the string formatting functionality
+described below.
#### String formatting
@@ -101,11 +122,13 @@ res = template.format('text', 1, true)
# res now has value 'string: text, number: 1, bool: true'
```
-As can be seen, the formatting works by replacing placeholders of type `@number@` with the corresponding argument.
+As can be seen, the formatting works by replacing placeholders of type
+`@number@` with the corresponding argument.
#### String methods
-Strings also support a number of other methods that return transformed copies.
+Strings also support a number of other methods that return transformed
+copies.
**.strip()**
@@ -226,7 +249,9 @@ my_array += ['something']
my_array += 'else'
```
-Note appending to an array will always create a new array object and assign it to `my_array` instead of modifying the original since all objects in Meson are immutable.
+Note appending to an array will always create a new array object and
+assign it to `my_array` instead of modifying the original since all
+objects in Meson are immutable.
#### Array methods
@@ -239,7 +264,8 @@ The following methods are defined for all arrays:
Function calls
--
-Meson provides a set of usable functions. The most common use case is creating build objects.
+Meson provides a set of usable functions. The most common use case is
+creating build objects.
```meson
executable('progname', 'prog.c')
@@ -248,7 +274,8 @@ executable('progname', 'prog.c')
Method calls
--
-Objects can have methods, which are called with the dot operator. The exact methods it provides depends on the object.
+Objects can have methods, which are called with the dot operator. The
+exact methods it provides depends on the object.
```meson
myobj = some_function()
@@ -279,7 +306,9 @@ endif
## Foreach statements
-To do an operation on all elements of an array, use the `foreach` command. As an example, here's how you would define two executables with corresponding tests.
+To do an operation on all elements of an array, use the `foreach`
+command. As an example, here's how you would define two executables
+with corresponding tests.
```meson
progs = [['prog1', ['prog1.c', 'foo.c']],
@@ -291,7 +320,9 @@ foreach p : progs
endforeach
```
-Note that Meson variables are immutable. Trying to assign a new value to `progs` inside a foreach loop will not affect foreach's control flow.
+Note that Meson variables are immutable. Trying to assign a new value
+to `progs` inside a foreach loop will not affect foreach's control
+flow.
Logical operations
--
@@ -334,12 +365,20 @@ The ternary operator works just like in other languages.
x = condition ? true_value : false_value
```
-The only exception is that nested ternary operators are forbidden to improve legibility. If your branching needs are more complex than this you need to write an `if/else` construct.
+The only exception is that nested ternary operators are forbidden to
+improve legibility. If your branching needs are more complex than this
+you need to write an `if/else` construct.
Includes
--
-Most source trees have multiple subdirectories to process. These can be handled by Meson's `subdir` command. It changes to the given subdirectory and executes the contents of `meson.build` in that subdirectory. All state (variables etc) are passed to and from the subdirectory. The effect is roughly the same as if the contents of the subdirectory's Meson file would have been written where the include command is.
+Most source trees have multiple subdirectories to process. These can
+be handled by Meson's `subdir` command. It changes to the given
+subdirectory and executes the contents of `meson.build` in that
+subdirectory. All state (variables etc) are passed to and from the
+subdirectory. The effect is roughly the same as if the contents of the
+subdirectory's Meson file would have been written where the include
+command is.
```meson
test_data_dir = 'data'
@@ -349,4 +388,12 @@ subdir('tests')
User-defined functions and methods
--
-Meson does not currently support user-defined functions or methods. The addition of user-defined functions would make Meson Turing-complete which would make it harder to reason about and more difficult to integrate with tools like IDEs. More details about this are [in the FAQ](FAQ.md#why-is-meson-not-just-a-python-module-so-i-could-code-my-build-setup-in-python). If because of this limitation you find yourself copying and pasting code a lot you may be able to use a [`foreach` loop instead](#foreach-statements).
+Meson does not currently support user-defined functions or
+methods. The addition of user-defined functions would make Meson
+Turing-complete which would make it harder to reason about and more
+difficult to integrate with tools like IDEs. More details about this
+are [in the
+FAQ](FAQ.md#why-is-meson-not-just-a-python-module-so-i-could-code-my-build-setup-in-python). If
+because of this limitation you find yourself copying and pasting code
+a lot you may be able to use a [`foreach` loop
+instead](#foreach-statements).
diff --git a/docs/markdown/i18n-module.md b/docs/markdown/i18n-module.md
index 1144e29..8fb650a 100644
--- a/docs/markdown/i18n-module.md
+++ b/docs/markdown/i18n-module.md
@@ -17,21 +17,17 @@ argument which is the name of the gettext module.
* `args`: list of extra arguments to pass to `xgettext` when
generating the pot file
-
* `data_dirs`: (*Added 0.36.0*) list of directories to be set for
`GETTEXTDATADIRS` env var (Requires gettext 0.19.8+), used for local
its files
-
* `languages`: list of languages that are to be generated. As of
0.37.0 this is optional and the
[LINGUAS](https://www.gnu.org/software/gettext/manual/html_node/po_002fLINGUAS.html)
file is read.
-
* `preset`: (*Added 0.37.0*) name of a preset list of arguments,
current option is `'glib'`, see
[source](https://github.com/mesonbuild/meson/blob/master/mesonbuild/modules/i18n.py)
for for their value
-
* `install`: (*Added 0.43.0*) if false, do not install the built translations.
This function also defines targets for maintainers to use:
diff --git a/docs/markdown/snippets/get_unquoted.md b/docs/markdown/snippets/get_unquoted.md
new file mode 100755
index 0000000..5f8969d
--- /dev/null
+++ b/docs/markdown/snippets/get_unquoted.md
@@ -0,0 +1,4 @@
+# `get_unquoted()` mehod for the `configuration` data object
+
+New convenience method that allow reusing a variable value
+defined quoted. Useful in C for config.h strings for example.
diff --git a/docs/markdown/snippets/prefix-dependent-defaults.md b/docs/markdown/snippets/prefix-dependent-defaults.md
new file mode 100644
index 0000000..7cc1792
--- /dev/null
+++ b/docs/markdown/snippets/prefix-dependent-defaults.md
@@ -0,0 +1,10 @@
+# Prefix-dependent defaults for sysconfdir, localstatedir and sharedstatedir
+
+These options now default in a way consistent with
+[FHS](http://refspecs.linuxfoundation.org/fhs.shtml) and common usage.
+
+If prefix is `/usr`, default sysconfdir to `/etc`, localstatedir to `/var` and
+sharedstatedir to `/var/lib`.
+
+If prefix is `/usr/local` (the default), default localstatedir to `/var/local`
+and sharedstatedir to `/var/local/lib`.
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 5a3c8d1..032ca69 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -833,7 +833,9 @@ class Compiler:
paths = ':'.join([os.path.join('$ORIGIN', p) for p in rel_rpaths])
# Build_rpath is used as-is (it is usually absolute).
if build_rpath != '':
- paths += ':' + build_rpath
+ if paths != '':
+ paths += ':'
+ paths += build_rpath
if len(paths) < len(install_rpath):
padding = 'X' * (len(install_rpath) - len(paths))
if not paths:
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index ba5d2ac..e8b23fd 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -1,3 +1,4 @@
+
# Copyright 2012-2017 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -232,7 +233,7 @@ class CoreData:
value = self.sanitize_dir_option_value(options.prefix, key, value)
setattr(options, key, value)
else:
- value = get_builtin_option_default(key)
+ value = get_builtin_option_default(key, prefix=options.prefix)
args = [key] + builtin_options[key][1:-1] + [value]
self.builtins[key] = builtin_options[key][0](*args)
@@ -308,11 +309,19 @@ def get_builtin_option_description(optname):
else:
raise RuntimeError('Tried to get the description for an unknown builtin option \'%s\'.' % optname)
-def get_builtin_option_default(optname):
+def get_builtin_option_default(optname, prefix='', noneIfSuppress=False):
if is_builtin_option(optname):
o = builtin_options[optname]
if o[0] == UserComboOption:
return o[3]
+ if optname in builtin_dir_noprefix_options:
+ if noneIfSuppress:
+ # Return None if argparse defaulting should be suppressed for
+ # this option (so we can determine the default later based on
+ # prefix)
+ return None
+ elif prefix in builtin_dir_noprefix_options[optname]:
+ return builtin_dir_noprefix_options[optname][prefix]
return o[2]
else:
raise RuntimeError('Tried to get the default value for an unknown builtin option \'%s\'.' % optname)
@@ -331,15 +340,6 @@ builtin_options = {
'mandir': [UserStringOption, 'Manual page directory.', 'share/man'],
'infodir': [UserStringOption, 'Info page directory.', 'share/info'],
'localedir': [UserStringOption, 'Locale data directory.', 'share/locale'],
- # sysconfdir, localstatedir and sharedstatedir are a bit special. These defaults to ${prefix}/etc,
- # ${prefix}/var and ${prefix}/com but nobody uses that. Instead they always set it
- # manually to /etc, /var and /var/lib. This default values is thus pointless and not really used
- # but we set it to this for consistency with other systems.
- #
- # Projects installing to sysconfdir, localstatedir or sharedstatedir probably want
- # to set the following in project():
- #
- # default_options : ['sysconfdir=/etc', 'localstatedir=/var', 'sharedstatedir=/var/lib']
'sysconfdir': [UserStringOption, 'Sysconf data directory.', 'etc'],
'localstatedir': [UserStringOption, 'Localstate data directory.', 'var'],
'sharedstatedir': [UserStringOption, 'Architecture-independent data directory.', 'com'],
@@ -352,8 +352,13 @@ builtin_options = {
'errorlogs': [UserBooleanOption, "Whether to print the logs from failing tests.", True],
}
-# Installation directories that can reside in a path outside of the prefix
-builtin_dir_noprefix_options = {'sysconfdir', 'localstatedir', 'sharedstatedir'}
+# Special prefix-dependent defaults for installation directories that reside in
+# a path outside of the prefix in FHS and common usage.
+builtin_dir_noprefix_options = {
+ 'sysconfdir': {'/usr': '/etc'},
+ 'localstatedir': {'/usr': '/var', '/usr/local': '/var/local'},
+ 'sharedstatedir': {'/usr': '/var/lib', '/usr/local': '/var/local/lib'},
+}
forbidden_target_names = {'clean': None,
'clean-ctlist': None,
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 55c0900..fcc74b5 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -394,7 +394,7 @@ class PkgConfigDependency(ExternalDependency):
class ExternalProgram:
- windows_exts = ('exe', 'msc', 'com', 'bat')
+ windows_exts = ('exe', 'msc', 'com', 'bat', 'cmd')
def __init__(self, name, command=None, silent=False, search_dir=None):
self.name = name
diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py
index 92d4504..257bf7a 100644
--- a/mesonbuild/dependencies/dev.py
+++ b/mesonbuild/dependencies/dev.py
@@ -173,9 +173,9 @@ class LLVMDependency(ExternalDependency):
# for users who want the patch version.
self.version = out.strip().rstrip('svn')
- p, out = Popen_safe([self.llvmconfig, '--components'])[:2]
+ p, out, err = Popen_safe([self.llvmconfig, '--components'])
if p.returncode != 0:
- raise DependencyException('Could not generate modules for LLVM.')
+ raise DependencyException('Could not generate modules for LLVM:\n' + err)
self.provided_modules = shlex.split(out)
modules = stringlistify(extract_as_list(kwargs, 'modules'))
@@ -183,9 +183,9 @@ class LLVMDependency(ExternalDependency):
opt_modules = stringlistify(extract_as_list(kwargs, 'optional_modules'))
self.check_components(opt_modules, required=False)
- p, out = Popen_safe([self.llvmconfig, '--cppflags'])[:2]
+ p, out, err = Popen_safe([self.llvmconfig, '--cppflags'])
if p.returncode != 0:
- raise DependencyException('Could not generate includedir for LLVM.')
+ raise DependencyException('Could not generate includedir for LLVM:\n' + err)
cargs = mesonlib.OrderedSet(shlex.split(out))
self.compile_args = list(cargs.difference(self.__cpp_blacklist))
@@ -198,10 +198,10 @@ class LLVMDependency(ExternalDependency):
def _set_new_link_args(self):
"""How to set linker args for LLVM versions >= 3.9"""
link_args = ['--link-static', '--system-libs'] if self.static else ['--link-shared']
- p, out = Popen_safe(
- [self.llvmconfig, '--libs', '--ldflags'] + link_args + list(self.required_modules))[:2]
+ p, out, err = Popen_safe(
+ [self.llvmconfig, '--libs', '--ldflags'] + link_args + list(self.required_modules))
if p.returncode != 0:
- raise DependencyException('Could not generate libs for LLVM.')
+ raise DependencyException('Could not generate libs for LLVM:\n' + err)
self.link_args = shlex.split(out)
def _set_old_link_args(self):
@@ -213,19 +213,19 @@ class LLVMDependency(ExternalDependency):
of course we do.
"""
if self.static:
- p, out = Popen_safe(
- [self.llvmconfig, '--libs', '--ldflags', '--system-libs'] + list(self.required_modules))[:2]
+ p, out, err = Popen_safe(
+ [self.llvmconfig, '--libs', '--ldflags', '--system-libs'] + list(self.required_modules))
if p.returncode != 0:
- raise DependencyException('Could not generate libs for LLVM.')
+ raise DependencyException('Could not generate libs for LLVM:\n' + err)
self.link_args = shlex.split(out)
else:
# llvm-config will provide arguments for static linking, so we get
# to figure out for ourselves what to link with. We'll do that by
# checking in the directory provided by --libdir for a library
# called libLLVM-<ver>.(so|dylib|dll)
- p, out = Popen_safe([self.llvmconfig, '--libdir'])[:2]
+ p, out, err = Popen_safe([self.llvmconfig, '--libdir'])
if p.returncode != 0:
- raise DependencyException('Could not generate libs for LLVM.')
+ raise DependencyException('Could not generate libs for LLVM:\n' + err)
libdir = out.strip()
expected_name = 'libLLVM-{}'.format(self.version)
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
index e65675b..4a023e4 100644
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -66,6 +66,11 @@ class BoostDependency(ExternalDependency):
self.is_multithreading = threading == "multi"
self.requested_modules = self.get_requested(kwargs)
+ invalid_modules = [c for c in self.requested_modules if 'boost_' + c not in BOOST_LIBS]
+ if invalid_modules:
+ mlog.warning('Invalid Boost modules: ' + ', '.join(invalid_modules))
+ self.log_fail()
+ return
self.boost_root = None
self.boost_roots = []
@@ -198,8 +203,6 @@ class BoostDependency(ExternalDependency):
for c in candidates:
if not isinstance(c, str):
raise DependencyException('Boost module argument is not a string.')
- if 'boost_' + c not in BOOST_LIBS:
- raise DependencyException('Dependency {} not found. It is not a valid boost library.'.format(c))
return candidates
def validate_requested(self):
@@ -599,15 +602,18 @@ class Python3Dependency(ExternalDependency):
self.name = 'python3'
# We can only be sure that it is Python 3 at this point
self.version = '3'
+ self.pkgdep = None
if DependencyMethods.PKGCONFIG in self.methods:
try:
- pkgdep = PkgConfigDependency('python3', environment, kwargs)
- if pkgdep.found():
- self.compile_args = pkgdep.get_compile_args()
- self.link_args = pkgdep.get_link_args()
- self.version = pkgdep.get_version()
+ self.pkgdep = PkgConfigDependency('python3', environment, kwargs)
+ if self.pkgdep.found():
+ self.compile_args = self.pkgdep.get_compile_args()
+ self.link_args = self.pkgdep.get_link_args()
+ self.version = self.pkgdep.get_version()
self.is_found = True
return
+ else:
+ self.pkgdep = None
except Exception:
pass
if not self.is_found:
@@ -671,6 +677,12 @@ class Python3Dependency(ExternalDependency):
else:
return [DependencyMethods.PKGCONFIG]
+ def get_pkgconfig_variable(self, variable_name):
+ if self.pkgdep:
+ return self.pkgdep.get_pkgconfig_variable(variable_name)
+ else:
+ return super().get_pkgconfig_variable(variable_name)
+
class PcapDependency(ExternalDependency):
def __init__(self, environment, kwargs):
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index c7a0fb7..6300f7f 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -177,6 +177,7 @@ class ConfigurationDataHolder(MutableInterpreterObject, ObjectHolder):
'set_quoted': self.set_quoted_method,
'has': self.has_method,
'get': self.get_method,
+ 'get_unquoted': self.get_unquoted_method,
'merge_from': self.merge_from_method,
})
@@ -232,6 +233,20 @@ class ConfigurationDataHolder(MutableInterpreterObject, ObjectHolder):
return args[1]
raise InterpreterException('Entry %s not in configuration data.' % name)
+ def get_unquoted_method(self, args, kwargs):
+ if len(args) < 1 or len(args) > 2:
+ raise InterpreterException('Get method takes one or two arguments.')
+ name = args[0]
+ if name in self.held_object:
+ val = self.held_object.get(name)[0]
+ elif len(args) > 1:
+ val = args[1]
+ else:
+ raise InterpreterException('Entry %s not in configuration data.' % name)
+ if val[0] == '"' and val[-1] == '"':
+ return val[1:-1]
+ return val
+
def get(self, name):
return self.held_object.values[name] # (val, desc)
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index a1e7c1c..8d5fb85 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -37,7 +37,12 @@ def add_builtin_argument(name, **kwargs):
h = h.rstrip('.') + ' (default: %s).' % coredata.get_builtin_option_default(k)
if c and not b:
kwargs['choices'] = c
- parser.add_argument('--' + name, default=coredata.get_builtin_option_default(k), help=h, **kwargs)
+ default = coredata.get_builtin_option_default(k, noneIfSuppress=True)
+ if default is not None:
+ kwargs['default'] = default
+ else:
+ kwargs['default'] = argparse.SUPPRESS
+ parser.add_argument('--' + name, help=h, **kwargs)
add_builtin_argument('prefix')
add_builtin_argument('libdir')
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
index 5800e5c..285169b 100644
--- a/mesonbuild/modules/qt.py
+++ b/mesonbuild/modules/qt.py
@@ -101,17 +101,25 @@ class QtBaseModule:
qrc_deps = []
for i in rcc_files:
qrc_deps += self.parse_qrc(state, i)
+ # custom output name set? -> one output file, multiple otherwise
if len(args) > 0:
name = args[0]
+ rcc_kwargs = {'input': rcc_files,
+ 'output': name + '.cpp',
+ 'command': [self.rcc, '-name', name, '-o', '@OUTPUT@', '@INPUT@'],
+ 'depend_files': qrc_deps}
+ res_target = build.CustomTarget(name, state.subdir, state.subproject, rcc_kwargs)
+ sources.append(res_target)
else:
- basename = os.path.split(rcc_files[0])[1]
- name = 'qt' + str(self.qt_version) + '-' + basename.replace('.', '_')
- rcc_kwargs = {'input': rcc_files,
- 'output': name + '.cpp',
- 'command': [self.rcc, '-o', '@OUTPUT@', '@INPUT@'],
- 'depend_files': qrc_deps}
- res_target = build.CustomTarget(name, state.subdir, state.subproject, rcc_kwargs)
- sources.append(res_target)
+ for rcc_file in rcc_files:
+ basename = os.path.split(rcc_file)[1]
+ name = 'qt' + str(self.qt_version) + '-' + basename.replace('.', '_')
+ rcc_kwargs = {'input': rcc_file,
+ 'output': name + '.cpp',
+ 'command': [self.rcc, '-name', '@BASENAME@', '-o', '@OUTPUT@', '@INPUT@'],
+ 'depend_files': qrc_deps}
+ res_target = build.CustomTarget(name, state.subdir, state.subproject, rcc_kwargs)
+ sources.append(res_target)
if len(ui_files) > 0:
if not self.uic.found():
raise MesonException(err_msg.format('UIC', 'uic-qt' + self.qt_version))
diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py
index 985b0e9..9485967 100644
--- a/mesonbuild/scripts/meson_install.py
+++ b/mesonbuild/scripts/meson_install.py
@@ -20,7 +20,7 @@ from . import destdir_join
from ..mesonlib import is_windows, Popen_safe
install_log_file = None
-use_selinux = True
+selinux_updates = []
class DirMaker:
def __init__(self):
@@ -84,27 +84,24 @@ def set_mode(path, mode):
msg = '{!r}: Unable to set permissions {!r}: {}, ignoring...'
print(msg.format(path, mode.perms_s, e.strerror))
-def restore_selinux_context(to_file):
+def restore_selinux_contexts():
'''
- Restores the SELinux context for @to_file
+ Restores the SELinux context for files in @selinux_updates
'''
- global use_selinux
-
- if not use_selinux:
- return
-
try:
subprocess.check_call(['selinuxenabled'])
- try:
- subprocess.check_call(['restorecon', '-F', to_file], stderr=subprocess.DEVNULL)
- except subprocess.CalledProcessError as e:
- use_selinux = False
- msg = "{!r}: Failed to restore SELinux context, ignoring SELinux context for all remaining files..."
- print(msg.format(to_file, e.returncode))
except (FileNotFoundError, PermissionError, subprocess.CalledProcessError) as e:
# If we don't have selinux or selinuxenabled returned 1, failure
# is ignored quietly.
- use_selinux = False
+ return
+
+ with subprocess.Popen(['restorecon', '-F', '-f-', '-0'],
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc:
+ out, err = proc.communicate(input=b'\0'.join(os.fsencode(f) for f in selinux_updates) + b'\0')
+ if proc.returncode != 0:
+ print('Failed to restore SELinux context of installed files...',
+ 'Standard output:', out.decode(),
+ 'Standard error:', err.decode(), sep='\n')
def append_to_log(line):
install_log_file.write(line)
@@ -126,7 +123,7 @@ def do_copyfile(from_file, to_file):
os.unlink(to_file)
shutil.copyfile(from_file, to_file)
shutil.copystat(from_file, to_file)
- restore_selinux_context(to_file)
+ selinux_updates.append(to_file)
append_to_log(to_file)
def do_copydir(data, src_prefix, src_dir, dst_dir, exclude):
@@ -192,6 +189,7 @@ def do_install(datafilename):
install_headers(d)
install_man(d)
install_data(d)
+ restore_selinux_contexts()
run_install_script(d)
def install_subdirs(d):
diff --git a/run_unittests.py b/run_unittests.py
index a31b942..80c58ea 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1,3 +1,4 @@
+
#!/usr/bin/env python3
# Copyright 2016-2017 The Meson development team
@@ -490,7 +491,10 @@ class BasePlatformTests(unittest.TestCase):
print(f.read())
def tearDown(self):
- windows_proof_rmtree(self.builddir)
+ try:
+ windows_proof_rmtree(self.builddir)
+ except FileNotFoundError:
+ pass
os.environ = self.orig_env
super().tearDown()
@@ -739,6 +743,49 @@ class AllPlatformTests(BasePlatformTests):
self.init(testdir)
self.assertRaises(subprocess.CalledProcessError, self.setconf, '-Dlibdir=/opt', False)
+ def test_prefix_dependent_defaults(self):
+ '''
+ Tests that configured directory paths are set to prefix dependent
+ defaults.
+ '''
+ testdir = os.path.join(self.common_test_dir, '1 trivial')
+ expected = {
+ '/opt': {'prefix': '/opt',
+ 'bindir': 'bin', 'datadir': 'share', 'includedir': 'include',
+ 'infodir': 'share/info',
+ 'libexecdir': 'libexec', 'localedir': 'share/locale',
+ 'localstatedir': 'var', 'mandir': 'share/man',
+ 'sbindir': 'sbin', 'sharedstatedir': 'com',
+ 'sysconfdir': 'etc'},
+ '/usr': {'prefix': '/usr',
+ 'bindir': 'bin', 'datadir': 'share', 'includedir': 'include',
+ 'infodir': 'share/info',
+ 'libexecdir': 'libexec', 'localedir': 'share/locale',
+ 'localstatedir': '/var', 'mandir': 'share/man',
+ 'sbindir': 'sbin', 'sharedstatedir': '/var/lib',
+ 'sysconfdir': '/etc'},
+ '/usr/local': {'prefix': '/usr/local',
+ 'bindir': 'bin', 'datadir': 'share',
+ 'includedir': 'include', 'infodir': 'share/info',
+ 'libexecdir': 'libexec',
+ 'localedir': 'share/locale',
+ 'localstatedir': '/var/local', 'mandir': 'share/man',
+ 'sbindir': 'sbin', 'sharedstatedir': '/var/local/lib',
+ 'sysconfdir': 'etc'},
+ # N.B. We don't check 'libdir' as it's platform dependent, see
+ # default_libdir():
+ }
+ for prefix in expected:
+ args = ['--prefix', prefix]
+ self.init(testdir, args, default_args=False)
+ opts = self.introspect('--buildoptions')
+ for opt in opts:
+ name = opt['name']
+ value = opt['value']
+ if name in expected[prefix]:
+ self.assertEqual(value, expected[prefix][name])
+ self.wipe()
+
def test_static_library_overwrite(self):
'''
Tests that static libraries are never appended to, always overwritten.
diff --git a/test cases/common/16 configure file/dumpprog.c b/test cases/common/16 configure file/dumpprog.c
index 685240c..39a215e 100644
--- a/test cases/common/16 configure file/dumpprog.c
+++ b/test cases/common/16 configure file/dumpprog.c
@@ -12,7 +12,14 @@
#error Token did not get defined
#endif
+#define stringify(s) str(s)
+#define str(s) #s
+
int main(int argc, char **argv) {
+#if !(SHOULD_BE_UNQUOTED_STRING == string)
+ printf("String token (unquoted) defined wrong.\n");
+ return 1;
+#endif
if(strcmp(SHOULD_BE_STRING, "string") != 0) {
printf("String token defined wrong.\n");
return 1;
diff --git a/test cases/common/16 configure file/meson.build b/test cases/common/16 configure file/meson.build
index 9dc5fb5..1e5a819 100644
--- a/test cases/common/16 configure file/meson.build
+++ b/test cases/common/16 configure file/meson.build
@@ -70,6 +70,12 @@ dump.set('SHOULD_BE_UNDEFINED', false)
dump.set('SHOULD_BE_ONE', 1)
dump.set('SHOULD_BE_ZERO', 0, description : 'Absolutely zero')
dump.set('SHOULD_BE_QUOTED_ONE', '"1"')
+
+dump.set_quoted('INTEGER_AS_STRING', '12')
+if dump.get_unquoted('INTEGER_AS_STRING').to_int() == 12
+ dump.set('SHOULD_BE_UNQUOTED_STRING', dump.get_unquoted('SHOULD_BE_STRING'))
+endif
+
configure_file(output : 'config3.h',
configuration : dump)
diff --git a/test cases/frameworks/4 qt/main.cpp b/test cases/frameworks/4 qt/main.cpp
index 4c257a4..388467e 100644
--- a/test cases/frameworks/4 qt/main.cpp
+++ b/test cases/frameworks/4 qt/main.cpp
@@ -2,6 +2,10 @@
#include "mainWindow.h"
int main(int argc, char **argv) {
+ #ifndef UNITY_BUILD
+ Q_INIT_RESOURCE(stuff);
+ Q_INIT_RESOURCE(stuff2);
+ #endif
QApplication app(argc, argv);
MainWindow *win = new MainWindow();
QImage qi(":/thing.png");
@@ -13,7 +17,20 @@ int main(int argc, char **argv) {
return 1;
}
win->setWindowTitle("Meson Qt5 build test");
-
+ QLabel *label_stuff = win->findChild<QLabel *>("label_stuff");
+ if(label_stuff == nullptr) {
+ return 1;
+ }
+ int w = label_stuff->width();
+ int h = label_stuff->height();
+ label_stuff->setPixmap(QPixmap::fromImage(qi).scaled(w,h,Qt::KeepAspectRatio));
+ QLabel *label_stuff2 = win->findChild<QLabel *>("label_stuff2");
+ if(label_stuff2 == nullptr) {
+ return 1;
+ }
+ w = label_stuff2->width();
+ h = label_stuff2->height();
+ label_stuff2->setPixmap(QPixmap::fromImage(qi2).scaled(w,h,Qt::KeepAspectRatio));
win->show();
return app.exec();
return 0;
diff --git a/test cases/frameworks/4 qt/mainWindow.ui b/test cases/frameworks/4 qt/mainWindow.ui
index 2eb226a..c01b8bf 100644
--- a/test cases/frameworks/4 qt/mainWindow.ui
+++ b/test cases/frameworks/4 qt/mainWindow.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>270</width>
- <height>115</height>
+ <width>260</width>
+ <height>313</height>
</rect>
</property>
<property name="windowTitle">
@@ -27,6 +27,26 @@
<string>I am a button</string>
</property>
</widget>
+ <widget class="QLabel" name="label_stuff">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>112</y>
+ <width>241</width>
+ <height>91</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_stuff2">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>212</y>
+ <width>241</width>
+ <height>91</height>
+ </rect>
+ </property>
+ </widget>
</widget>
</widget>
<resources/>
diff --git a/test cases/frameworks/4 qt/meson.build b/test cases/frameworks/4 qt/meson.build
index b817228..374707a 100644
--- a/test cases/frameworks/4 qt/meson.build
+++ b/test cases/frameworks/4 qt/meson.build
@@ -35,17 +35,26 @@ foreach qt : ['qt4', 'qt5']
prep = qtmodule.preprocess(
moc_headers : ['mainWindow.h'], # These need to be fed through the moc tool before use.
ui_files : 'mainWindow.ui', # XML files that need to be compiled with the uic tol.
- qresources : ['stuff.qrc', 'stuff2.qrc'], # Resource file for rcc compiler.
method : get_option('method')
)
+ # Resource file(s) for rcc compiler
+ extra_cpp_args = []
+ if meson.is_unity()
+ extra_cpp_args += '-DUNITY_BUILD'
+ prep_rcc = qtmodule.preprocess(qt + '_unity_ressource', qresources : ['stuff.qrc', 'stuff2.qrc'], method : get_option('method'))
+ else
+ prep_rcc = qtmodule.preprocess(qresources : ['stuff.qrc', 'stuff2.qrc'], method : get_option('method'))
+ endif
+
# Test that setting a unique name with a positional argument works
- qtmodule.preprocess(qt + 'teststuff', qresources : ['stuff.qrc'], method : get_option('method'))
+ qtmodule.preprocess(qt + 'teststuff', qresources : ['stuff.qrc', 'stuff2.qrc'], method : get_option('method'))
qexe = executable(qt + 'app',
sources : ['main.cpp', 'mainWindow.cpp', # Sources that don't need preprocessing.
- prep],
- dependencies : qtdep)
+ prep, prep_rcc],
+ dependencies : qtdep,
+ cpp_args: extra_cpp_args)
# We need a console test application because some test environments
# do not have an X server.
diff --git a/test cases/python3/2 extmodule/meson.build b/test cases/python3/2 extmodule/meson.build
index 25e2c63..0ecc813 100644
--- a/test cases/python3/2 extmodule/meson.build
+++ b/test cases/python3/2 extmodule/meson.build
@@ -17,3 +17,8 @@ if py3_dep.found()
else
error('MESON_SKIP_TEST: Python3 libraries not found, skipping test.')
endif
+
+py3_pkg_dep = dependency('python3', method: 'pkg-config', required : false)
+if py3_pkg_dep.found()
+ python_lib_dir = py3_pkg_dep.get_pkgconfig_variable('libdir')
+endif