Commit Graph

383 Commits

Author SHA1 Message Date
Matthias Klumpp 2dc1e87cae Ensure D feature flags get applied to all D files
This resolves issue #3337
2018-03-31 20:53:27 +02:00
Jussi Pakkanen f6f0784038
Merge pull request #2976 from dzabraev/fix-reversed-order
Fix bug include_directories(['p1','p2']) add -Ip2 -Ip1 (reversed order)
2018-03-25 20:26:02 +03:00
Aleksey Filippov 2febb99eee Fix b_ndebug=if-release option
Provide get_{type}_options_for_target() methods that unite {type} and builtin options.
2018-03-21 17:30:06 +00:00
Jussi Pakkanen 657836b555
Merge pull request #3223 from sarum9in/rename
Add install_data() rename parameter
2018-03-20 00:15:01 +02:00
Nirbheek Chauhan d012b5b997 Create a helper for checking if a string has a path component
This is used in a number of places, and in some places it is incomplete.
Use a helper to ensure it's used properly.
2018-03-19 23:45:43 +02:00
Aleksey Filippov f720efa2f4 Add rename parameter to install_data() 2018-03-17 20:40:50 +00: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 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
Joel Klinghed ed8197207e fixup! Fix coverage-xml and coverage-text targets for gcovr >= 3.1
Rename gcovr_3_1 to gcovr_new_rootdir
2018-03-12 22:18:26 +01:00
Aleksey Filippov d977b78f1b Use itertools.chain() instead of list concatenation 2018-03-11 23:36:04 +00:00
Niklas Claesson 7074bcb88a Exclude subprojects when doing coverage 2018-03-10 18:05:35 +02:00
Aleksey Filippov bf0e01d779 Get generated headers from link_whole_targets as meson does for link_targets 2018-03-07 12:48:35 +00:00
Hemmo Nieminen 7fb8e518b2 Harmonize data pickling.
Try to be more consistent on using save() and load() methods to pickle
data.
2018-03-01 01:06:51 +02:00
Hemmo Nieminen b0446075ec Remove some unused variables. 2018-03-01 01:06:51 +02: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
Joel Klinghed da01770261 Fix coverage-xml and coverage-text targets for gcovr >= 3.1
In gcovr 3.1 the -r/--rootdir argument changed meaning causing
reports generated with gcovr 3.1 to not find the source files
and look for *.gcda in the whole source tree rather than the
build dir.

So, detect gcovr version and if 3.1 give build_root to -r instead
of source_root.
2018-02-27 21:48:42 +01:00
Jussi Pakkanen ea3b54d402 Use include_directories for D impdirs.
Change the code to store D properties as plain data. Only convert them
to compiler flags in the backend. This also means we can fully parse D
arguments without needing to know the compiler being used.
2018-02-25 19:42:15 +02:00
Thibault Saunier c48b9594ff Add support for Visual Studio csc c# compiler 2018-02-25 01:10:52 +02:00
Adam C. Foltzer 3332f33649 Fix Rust compiler-private library ambiguity
When building a Rust target with Rust library dependencies, an
`--extern` argument is now specified to avoid ambiguity between the
dependency library, and any crates of the same name in `rustc`'s
private sysroot.

Includes an illustrative test case.
2018-02-22 22:16:58 +02:00
Peter Hutterer 6b550ae91f Allow for missing install_dir in install_data()
The documentation doesn't require it and the interpreter code works around the
possibility of it being None. The ninja backend code however fails with

File "/home/whot/code/meson/mesonbuild/backend/ninjabackend.py", line 796, in generate_data_install
    dstabs = os.path.join(subdir or None, plain_f)
File "/usr/lib64/python3.6/posixpath.py", line 78, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

If install_dir is missing, default to datadir/projectname
2018-02-22 20:26:16 +02:00
Nirbheek Chauhan b2007217e0 vala: Fix path of C file with generated Vala files
We missed one particular edge-case in #2413: when the generated vala
file is inside --basedir, the path is not just the basename.c

Since this case can never happen in a project test, this includes a unit
test for the same.

Closes https://github.com/mesonbuild/meson/issues/815
2018-02-20 00:19:11 +02:00
Maxim Dzabraev d10b7687ab Fix bug include_directories([p1,p2]) produces -Ip2 -Ip1 (reversed order) 2018-02-11 20:25:25 +03:00
Aleksey Filippov 549f9a41e5 Rename install_subdir() option elide_directory to strip_directory 2018-02-05 01:28:07 +00:00
Aleksey Filippov 8ca3cc0c3d Add elide_directory keyword for install_subdir() function
If elide_directory=true install_subdir() installs directory contents
instead of directory itself, eliding name of the source directory.

Closes #2869.
2018-02-05 01:28:07 +00:00
Jussi Pakkanen bfa6c8d074
Merge pull request #2938 from acfoltzer/rust-cross-merge
Add cross-compilation support for `rustc`
2018-02-04 00:44:09 +02:00
Aleksey Filippov 8fe8161014 Refactor and simplify install_subdir()
- Pass exclude_files and exclude_directories relative to src_dir,
  same as specified by user and documented in public install_subdir().
- Make do_copydir() interface similar to do_copyfile():
  install src_dir contents to dst_dir.
- Remove src_prefix/src_dir code, it adds confusion and duplicates arguments.
  Use single src_dir parameter instead.
- Make callers specify that src_dir contents should be installed
  under dst_dir/basename(src_dir) if necessary.
- Use os.path.relpath() instead of string manipulations on paths.
- Add documentation to do_copydir(): specify types and add usage example.
2018-02-04 00:43:00 +02:00
Jussi Pakkanen 20ae08eb1b Only quote colons on build lines. Closes #2961. 2018-02-02 10:37:32 +02:00
Adam C. Foltzer 1d81efb03d Add cross-compilation support for `rustc`
This patch is largely modeled on the relatively-straightforward code
for Fortran cross-compilation, so there might be some intricacies
missing.
2018-01-29 15:47:05 -08:00
Aleksey Filippov 2cf85ae16f Use os.path: basename() and dirname() instead of split()
According to Python documentation[1] dirname and basename
are defined as follows:
    os.path.dirname() = os.path.split()[0]
    os.path.basename() = os.path.split()[1]
For the purpose of better readability split() is replaced
by appropriate function if only one part of returned tuple
is used.

[1]: https://docs.python.org/3/library/os.path.html#os.path.split
2018-01-30 07:08:22 +11:00
Jussi Pakkanen d6bed2a77d
Merge pull request #2764 from mesonbuild/generatorpath
Generator outputs can have path segments
2018-01-13 19:00:38 +02:00
Nikita Churaev de8018a17d Add `export_dynamic` argument to `executable`. (#2662) 2018-01-09 21:36:13 +02:00
Jussi Pakkanen 4f948ccf45
Merge pull request #2885 from BeChris/fix_vs_pch
Fix MSVC backend crashes when `c_pch` or `cpp_pch` is not an array
2018-01-08 20:34:53 +02:00
Christophe Gouiran 412315f8ae Modify exception raised when msvc pch is badly specified 2018-01-07 19:09:53 +01:00
Jussi Pakkanen 17c435869c Print problem text in error message. Closes #2882. 2018-01-07 19:21:21 +02:00
Jussi Pakkanen 27d4a611a5 Fix Windows. 2017-12-21 23:06:14 +02:00
Jussi Pakkanen 658442bef4 Can declare file generation in one dir and use the output in another. 2017-12-18 20:58:43 +02:00
Jussi Pakkanen cbefb57ffe
Merge pull request #2745 from dcbaker/submit/haiku
small fixes for haiku
2017-12-10 14:42:53 +02:00
Dylan Baker fc547ad05e haiku: do not add pthread arguments
Haiku has pthreads, but they are part of the standard C library, and do
not need either special compiler or linker flags.
2017-12-07 09:35:12 -08:00
Nirbheek Chauhan 62ba5ca1ec custom target: Consider all build depends while serializing
Currently, we only consider the build depends of the Executable being
run when serializing custom targets. However, this is not always
sufficient, for example if the executable loads modules at runtime or if
the executable is actually a python script that loads a built module.

For these cases, we need to set PATH on Windows correctly or the custom
target will fail to run at build time complaining about missing DLLs.
2017-12-02 02:07:19 +05:30
Josh Soref 05f684b4fc spelling: overwrite 2017-11-26 05:56:25 +00:00
Josh Soref 49f8d28ef5 spelling: overridden 2017-11-26 05:55:40 +00:00
Josh Soref 791494e143 spelling: dependency 2017-11-26 05:23:23 +00:00
Jussi Pakkanen 5d51bc79c7 Replaced sys.executable use with the mesonlib equivalent. 2017-11-20 23:08:17 +02:00
Martin Kelly 02bea7d5bf namespace run_targets by subproject
Currently, run_target does not get namespaced for each subproject,
unlike executable and others. This means that two subprojects sharing
the same run_target name cause meson to crash.

Fix this by moving the subproject namespacing logic from the BuildTarget
class to the Target class.
2017-10-31 01:04:38 +02:00
Alistair Thomas d551dbff9a Use long form of valac options and make --basedir use relative path 2017-10-03 20:43:11 +02:00
Corentin Noël f13887b64a Reduce code complexity, fix nested array in files instruction 2017-10-03 18:25:07 +02:00
Corentin Noël ac8d5f2156 Allow different directories for Vala files 2017-10-02 01:59:41 +02:00
Niklas Claesson 68275b32e8 Implement capture for generators 2017-09-29 23:29:44 +03:00
Dylan Baker dda5e8cadb Allow CustomTarget's to be indexed
This allows a CustomTarget to be indexed, and the resulting indexed
value (a CustomTargetIndex type), to be used as a source in other
targets. This will confer a dependency on the original target, but only
inserts the source file returning by index the original target's
outputs. This can allow a CustomTarget that creates both a header and a
code file to have it's outputs split, for example.

Fixes #1470
2017-09-27 22:01:24 +03:00