Commit Graph

275 Commits

Author SHA1 Message Date
Aleksey Filippov f4ea6ac454 Add '189 same target name flat layout' test 2018-04-16 22:51:34 +01:00
Aleksey Filippov cb761718f0 Generate target id based on subdirectory instead of subproject
Allows creation of targets with same name in different subdirectories.
Closes #2861 and closes #1867
2018-04-16 22:51:34 +01:00
Nirbheek Chauhan ef81a013a5 cross: Add compiler cross_args after normal args
This way they override all other arguments. This matches the order of
link arguments too.

Note that this means -I flags will come in afterwards and not override
anything else, but this is correct since that's how toolchain paths
work normally too -- they are searched last.

Closes https://github.com/mesonbuild/meson/issues/3089
2018-04-15 22:29:49 +03:00
Jussi Pakkanen 86f725c1e5
Merge pull request #3115 from makise-homura/e2k-lcc-support
Support lcc compiler for e2k (Elbrus) architecture
2018-04-15 17:18:44 +03:00
Martin Hostettler aff597fb99 ninjabackend: Try to guess library dependencies for linker invocation.
The linkers currently do not support ninja compatible output of
dependencies used while linking. Try to guess which files will be used
while linking in python code and generate conservative dependencies to
ensure changes in linked libraries are detected.

This generates dependencies on the best match for static and shared
linking, but this should not be a problem, except for spurious
rebuilding when only one of them changes, which should not be a problem.

Also makes sure to ignore any libraries generated inside the build, to
keep the optimisation working where changes in a shared library only
cause relink if the symbols have changed as well.
2018-04-15 07:29:21 +00:00
Martin Hostettler 3f7c6cf3d6 Improve generation of pkg-config files for static only libraries.
Previously pkg-config files generated by the pkgconfig modules for static libraries
with dependencies could only be used in a dependencies with `static: true`.

This was caused by the dependencies only appearing in Libs.private even
if they are needed in the default linking mode. But a user of a
dependency should not have to know if the default linking mode is static
or dynamic; A dependency('somelib') call should always pull in all
needed pieces into the build.

Now for meson build static libraries passed via `libraries` to the generate
method automatically promote dependencies to public.
2018-04-14 23:43:29 +03:00
textshell 0535f38af9 pkgconfig module: Fix regression that Requires.private is generated as 'Q, t, 5, C, o, r, e' instead of Qt5Core. (#3406) 2018-04-14 21:57:12 +03:00
Daniel Schulte 57654bf367 Deduplicate dependencies resolved to absolute paths
If paths are absolute the order of search directories is not relevant as the path is already resolved.
2018-04-13 01:05:25 +00:00
Mathieu Duponchelle 1105ba3afd [fixup]: rename test after rebase 2018-04-07 16:13:59 +02:00
Mathieu Duponchelle ae460f94ce [fixup]: Add test 2018-04-06 23:48:48 +02:00
Jussi Pakkanen 8eadc9d068
Merge pull request #3277 from chitranjali/shared-mod-link 2018-03-29 22:22:51 +03:00
Jussi Pakkanen be3387d937
Merge pull request #3322 from sarum9in/run_timeout 2018-03-29 21:48:09 +03:00
chitranjali cc6be2e43d Fixing flake8 2018-03-29 14:43:56 +05:30
chitranjali 34cb503c85 PR review changes closes #2865 2018-03-29 13:32:36 +05:30
chitranjali 83766313a7 fix2865 2018-03-29 13:26:32 +05:30
Aleksey Filippov 977acc94b8 Do not leave open file handlers, use context manager to clean them up 2018-03-26 23:47:51 +03:00
Aleksey Filippov fa39e1082c Timeout on test subprocesses instead of hanging and failing CI completely 2018-03-26 12:48:40 +00:00
Xavier Claessens 8efd940092 pkgconfig generator: Add required version 2018-03-25 23:20:09 +03:00
Aleksey Filippov af0b569ced Add unittests for b_ndebug=if-release and buildtype interactions 2018-03-21 16:42:35 +00:00
makise-homura e8dff792d6 Removed some confusing chars from 'spaces and fun'
For example, lcc does not understand !, ^, *, and <.
2018-03-21 19:16:02 +03:00
makise-homura 86fa9b133d test_reconfigure switched to b_coverage from b_lto
This is due to some compilers (e.g. lcc) don't support LTO,
and therefore no b_lto meson option is available.
2018-03-21 16:45:22 +03:00
Jussi Pakkanen 58156ef7cf Grab a file lock on the build dir during modifications. 2018-03-20 22:28:37 +02:00
Jussi Pakkanen e984e1072b
Merge pull request #3251 from mesonbuild/fixpkgconfigdeps
Fix pkg-config dependencies leaking out (debbug 892956)
2018-03-19 23:43:35 +02:00
Jussi Pakkanen cf5f1a83d5 Fix existing tests. 2018-03-19 23:21:56 +02:00
Jussi Pakkanen c385f79737 Do not leak out private dependencies for shared libraries. 2018-03-17 00:44:56 +02:00
Jussi Pakkanen d532650b0d Add test for pkgconfig generation and usage.
This builds a project with pkg-config file, installs it and then
builds a second project that uses that dependency and runs the result.
2018-03-16 23:52:45 +02:00
Aleksey Filippov 7f042b5fe2 Use target.get_id() instead of basename and type_suffix concatenation at call site
Fixes the bug with flat layout and identical target names in subprojects.
Without this change directories are not created with subproject prefix
and they can collide.

Remove dead makedirs code in Backend.__init__(), during initialization
of backend build.targets is empty. Create output directories in
Vs2010Backend.generate_projects() instead.

Also use double blank line in run_unittests.py according to
https://www.python.org/dev/peps/pep-0008/#blank-lines.
2018-03-15 21:14:58 +02:00
Jussi Pakkanen 9ecb75670f
Merge pull request #3127 from bluetech/method-permitted-kwargs 2018-03-13 21:16:30 +02:00
Jussi Pakkanen ae0e469b06
Merge pull request #3145 from thejk/gcovr
Support gcovr >= 3.1 and add gcovr html report as fallback
2018-03-13 21:12:16 +02:00
Joel Klinghed 4e1b229b37 fixup! Allow gcovr >= 3.1 to be used to generate html coverage report
Rename gcovr_3_1 to gcovr_new_rootdir
2018-03-12 22:19:53 +01:00
Jussi Pakkanen 6585427a7d
Merge pull request #3131 from sarum9in/pkgconfig
Pkgconfig accepts libraries and pkgconfig-dependencies in requires/requires_private parameters
2018-03-12 23:02:36 +02:00
Jon Turney 7bf29b8efd Fix typo preventing soname unit tests from running
Fix a typo in ac256cb6 preventing soname unit tests from running
2018-03-12 22:25:00 +02:00
Evgenii Shatokhin 19718a8d9c Allow passing a compiler object to run_command()
Sometimes it is needed to run the current compiler with specific options
not to compile a file but rather to obtain additional info. For example,
GCC has several -print-* options to query it about the paths to
different libraries and development files. One use case is to get the
location of development files for GCC plugins, which is not easily
obtainable by other means:

  gcc -print-file-name=plugin

For this purpose, it would be convenient if the compiler object returned
by meson.get_compiler(lang) could be used in run_command() directly.
This commit implements it.

Signed-off-by: Evgenii Shatokhin <eshatokhin@virtuozzo.com>
2018-03-06 21:07:16 +02:00
Jussi Pakkanen fa1401bec1 Verify that snippets conform to expected format. 2018-03-06 14:02:22 +02:00
Jussi Pakkanen 7842bc03dd
Merge pull request #3165 from jon-turney/run-unittests
Enable linux-like unit tests on all posix-like platforms
2018-03-06 00:05:33 +02:00
Jukka Laurila 8f340ffb8d Generate meson.build based on existing source files when meson init is run in a non-empty directory. 2018-03-06 00:05:17 +02:00
Jon Turney ac256cb665 Enable linux-like unit tests on all posix-like platforms
Enable linux-like unit tests on all posix-like platforms, not just linux,
skipping tests where appropriate.  This enables these tests for OSX and
Cygwin in CI.

* Allow in-process (as well as out of process) tests to be skipped by
returning MESON_SKIP_TEST

This is needed to allow test_old_gnome_module_codepaths to be skipped when
'test cases/frameworks/7 gnome' is missing it's pre-prequisites

* Skip PIC tests on platforms where it's irrelevant

* Apple Clang reports the XCode version number, not the LLVM version number,
so the check for stdc(|++)17 needs adjusting

* Skip tests that only pertain to ELF or RPATH mechanics when irrelevant

* Skip tests that require valac if missing

* Skip asan test on Cygwin
2018-03-05 13:14:13 +00:00
Jon Turney 610e5d4a71 Invoke 'qmake --version' correctly in test_qt5dependency_qmake_detection
subprocess.getoutput() takes a string, not a list.  I'm going to guess this
is the cause of the mysterious behaviour alluded to in the comment...
2018-03-04 22:28:47 +00:00
Jussi Pakkanen 0744601fda
Merge pull request #3171 from jon-turney/flake8
Fix flake8 issues
2018-03-05 00:03:34 +02:00
Jussi Pakkanen a8da0e25ea Skip test that requires mocking when using an external exe. Also logging. 2018-03-04 19:08:37 +02:00
Jon Turney 8958529a25 Fix flake8 'variable assigned value but unused' reports
$ flake8 | grep -E 'F841'
./run_unittests.py:1987:13: F841 local variable 'objc' is assigned to but never used
./run_unittests.py:1988:13: F841 local variable 'objcpp' is assigned to but never used
./mesonbuild/minit.py:272:5: F841 local variable 'uppercase_token' is assigned to but never used
./mesonbuild/minit.py:307:5: F841 local variable 'uppercase_token' is assigned to but never used
./mesonbuild/modules/unstable_icestorm.py:36:9: F841 local variable 'result' is assigned to but never used
./mesonbuild/modules/unstable_icestorm.py:78:9: F841 local variable 'up_target' is assigned to but never used
./mesonbuild/modules/unstable_icestorm.py:81:9: F841 local variable 'time_target' is assigned to but never used
./msi/createmsi.py:226:17: F841 local variable 'file_source' is assigned to but never used
2018-03-03 21:36:37 +00:00
Jon Turney 2f6ed47077 Fix various flake8 indentation reports
$ flake8 | grep -E '(E123|E127|E128)'
./run_unittests.py:1358:37: E127 continuation line over-indented for visual indent
./run_unittests.py:1360:37: E127 continuation line over-indented for visual indent
./mesonbuild/minit.py:311:66: E128 continuation line under-indented for visual indent
./mesonbuild/minit.py:312:66: E128 continuation line under-indented for visual indent
./mesonbuild/minit.py:313:66: E128 continuation line under-indented for visual indent
./mesonbuild/compilers/cpp.py:115:63: E127 continuation line over-indented for visual indent
./msi/createmsi.py:156:13: E123 closing bracket does not match indentation of opening bracket's line
./msi/createmsi.py:188:13: E123 closing bracket does not match indentation of opening bracket's line
2018-03-03 21:35:53 +00:00
Jon Turney b8b23f4c50 Fix various flake8 whitespace reports
$ flake8 | grep -E '(E203|E221|E226|E303|W291|W293)'
./run_unittests.py:1503:5: E303 too many blank lines (2)
./mesonbuild/interpreter.py:2342:64: E226 missing whitespace around arithmetic operator
./mesonbuild/minit.py:110:17: E221 multiple spaces before operator
./mesonbuild/minit.py:131:1: W293 blank line contains whitespace
./mesonbuild/minit.py:135:19: E221 multiple spaces before operator
./mesonbuild/minit.py:155:1: W293 blank line contains whitespace
./mesonbuild/minit.py:181:1: W293 blank line contains whitespace
./mesonbuild/minit.py:183:1: W293 blank line contains whitespace
./mesonbuild/minit.py:294:47: W291 trailing whitespace
./mesonbuild/minit.py:331:47: W291 trailing whitespace
./mesonbuild/modules/unstable_icestorm.py:49:1: W293 blank line contains whitespace
./mesonbuild/modules/unstable_icestorm.py:76:31: E203 whitespace before ':'
./mesonbuild/modules/unstable_icestorm.py:82:22: E203 whitespace before ':'
2018-03-03 21:06:45 +00:00
Jon Turney cd5dba5358 Fix flake8 'imported but unused' reports
$ flake8 | grep F401
./meson.py:17:1: F401 'mesonbuild.mesonlib' imported but unused
./meson.py:18:1: F401 'locale' imported but unused
./run_unittests.py:24:1: F401 'sys' imported but unused
./mesonbuild/minit.py:2:1: F401 'pyclbr.Function' imported but unused
./mesonbuild/minit.py:18:1: F401 'os' imported but unused
./mesonbuild/backend/vs2010backend.py:15:1: F401 'sys' imported but unused
./mesonbuild/backend/xcodebackend.py:19:1: F401 'sys' imported but unused
./mesonbuild/dependencies/ui.py:20:1: F401 'shutil' imported but unused
./mesonbuild/modules/python3.py:15:1: F401 'sys' imported but unused
./mesonbuild/modules/unstable_icestorm.py:15:1: F401 '..compilers' imported but unused
./mesonbuild/modules/unstable_icestorm.py:15:1: F401 '..mlog' imported but unused
./test cases/common/98 gen extra/srcgen3.py:3:1: F401 'os' imported but unused
2018-03-03 21:06:45 +00:00
Joel Klinghed 6266089866 Allow gcovr >= 3.1 to be used to generate html coverage report
Modern gcovr includes html generation support so if lcov and
genhtml are not available fallback to gcovr.

Kept lcov and genhtml as default so to not surprise existing
users of coverage-html with the different output of gcovr.

gcovr added html support in 3.0 but as there already is a test
for 3.1 because of the changes to -r/--rootdir I opted to only
allow html generation for >= 3.1 to keep things simple.
2018-02-27 21:58:05 +01:00
Hemmo Nieminen 473dc80701 Add some test setup selection tests. 2018-02-25 21:44:59 +02:00
Aleksey Filippov d6b5d7fe9f Add library with generated_pc and PkgConfigDependency support to pkgconfig.generate() 2018-02-24 23:41:08 +00:00
Ran Benita 4d8e4654cb Warn if non-permitted keyword arguments are given to compiler methods
This can help future generations avoid mistakes like this:
edb1c66239

To avoid breaking builds, this is currently just an error. After
sufficient time has passed this can hopefully become a hard error,
similarly to the already-existing `permittedKwargs` warnings.
2018-02-23 04:35:15 +02:00
Jon Turney cf98f5e370 Enable searching system crossfile locations on more platforms
There's no reason not to also look in these places on Cygwin or OSX.  Don't
do this on Windows, as these paths aren't meaningful there.

Move test_cross_file_system_paths from LinuxlikeTests to AllPlatformTests.
2018-02-21 23:58:14 +02:00
Nirbheek Chauhan 8842839bb4 pkgconfig deps: Warn when a static library isn't found
A hard error makes this feature useless in most cases since a static
library usually won't be found for every library, particularly system
libraries like -lm. Instead, warn so the user can provide the static
library if they wish.

This feature will be expanded and made more extensible and more usable
in the future.

Closes https://github.com/mesonbuild/meson/issues/2785
2018-02-20 19:26:51 +02:00