Commit Graph

277 Commits

Author SHA1 Message Date
Bálint Aradi 809a5938ff Fix case sensitivity in Fortran module names 2017-05-26 23:21:27 +03:00
Rob Doolittle 56b41d1c79 mesontest: use unbuffered IO
This helps when running mesontest as part of CI.
2017-05-24 20:00:47 +03:00
Ole André Vadla Ravnås b595cda4ed Fix cross environment pollution.
Environment variables like CFLAGS and LDFLAGS should not affect the
cross environment.

Fixes #1772
2017-05-21 23:04:19 +03:00
Elliott Sales de Andrade ea636fcd51 Remove unused variables. 2017-05-17 04:41:54 -04:00
Elliott Sales de Andrade 65b1d33931 Remove unused imports. 2017-05-17 03:42:16 -04:00
Jussi Pakkanen 18b11489cf Merge pull request #1775 from mesonbuild/covupdate
Better coverage report
2017-05-14 11:55:02 +03:00
Ole André Vadla Ravnås 9b5df6e442 ninja: Deduplicate dependent vapis
The Vala compiler does not like being fed the same .vapi multiple times.
2017-05-14 11:54:42 +03:00
Jussi Pakkanen 08bd92a6ae Merge pull request #1788 from aradi/fix-fortran-scan
Fix scanning of Fortran sources created during configuration
2017-05-13 23:24:14 +03:00
Ole André Vadla Ravnås 97339d3be4 ninja: Also include Vala headers in generated headers 2017-05-13 22:59:06 +03:00
Jon Turney 61a145fcb5 Implement executable(gui_app:) for gcc on Windows
Note that gui_app: is currently ignored when using the ninja backend with VS
compilers, so I guess you get the default linker behaviour, which the
documentation says is guessing the subsystem depending on if a main or
WinMain symbol exists...
2017-05-13 22:58:06 +03:00
Jussi Pakkanen 111e3df45d Moved coverage commands to a standalone script. 2017-05-13 22:54:08 +03:00
Jussi Pakkanen c2282f9382 Merged rust_args branch. 2017-05-13 22:51:43 +03:00
Jussi Pakkanen 84012a5099 Merge pull request #1669 from mesonbuild/dist
Create a dist target
2017-05-12 19:37:31 +03:00
Jon Turney e99cfdfbc7 Make vs_module_defs: do something for gcc on Windows as well
Module definition files may be useful when building with gcc on Windows also
(e.g. if the existing build uses them, if exports are aliased, if we were
retro enough to export by ordinal, etc.)

Add the .def file to the link command line when using gcc on Windows

Run the appropriate windows tests irrespective of compiler.
2017-05-12 18:56:43 +03:00
Bálint Aradi 540fd2f0e0 Fix scanning of Fortran sources created during configuration 2017-05-12 14:34:19 +02:00
Jussi Pakkanen a91aed8854 Test created tarball by doing a full build + test + install cycle. 2017-05-11 19:34:16 +03:00
Jussi Pakkanen 255be79e22 Created a dist target. Closes #877. 2017-05-11 19:34:16 +03:00
Jussi Pakkanen 1aa68cf6e3 Merge pull request #1610 from valum-framework/vala-use-generate-basic-compiler-args
Use 'generate_basic_compiler_args' for Vala targets
2017-05-09 18:45:06 +03:00
Patrick Griffis b520a4f030 rust: Support rust_args 2017-05-08 15:25:52 -04:00
Dylan Baker 7053d9abfd Allow link_depends to take strings, Files or generated objects. Closes #1172
Currently only strings can be passed to the link_depends argument of
executable and *library, which solves many cases, but not every one.
This patch allows generated sources and Files to be passed as well.

On the implementation side, it uses a helper method to keep the more
complex logic separated from the __init__ method. This also requires
that Targets set their link_depends paths as Files, and the backend is
responsible for converting to strings when it wants them.

This adds tests for the following cases:
- Using a file in a subdir
- Using a configure_file as an input
- Using a custom_target as an input

It does not support using a generator as an input, since currently that
would require calling the generator twice, once for the -Wl argument,
and once for the link_depends.

Also updates the docs.
2017-05-08 20:59:46 +02:00
Guillaume Poirier-Morency 904ed5a599 Use 'generate_basic_compiler_args' for Vala targets
Move '-C' option into 'get_always_args' as we always generate C sources.

Add a branch in the dependency management to perform Vala-specific work
of adding '--pkg' and '--target-glib'.
2017-05-08 14:58:52 -04:00
Alberto Aguirre ccab7d64f4 Add support for @CURRENT_SOURCE_DIR@ in generator arguments
Allow users to specify @CURRENT_SOURCE_DIR@ in generator arguments
to specify the current target source directory.
This is useful when creating protobuf generator objects in sub-directories
because protoc will then generate files in the expected location.

Fixes #1622.

Remove stray semicolon

Update documentation
2017-05-08 20:53:57 +02:00
Elliott Sales de Andrade bbcf0c0550 Serialize CustomTargets with newlines in command. 2017-05-05 17:23:36 -04:00
Elliott Sales de Andrade 7d6c6fe166 Remove extra quoting in swiftc invocation. 2017-05-05 16:27:01 -04:00
Patrick Griffis 60d560b5a7 ninja: Fix quoting newlines and $ 2017-05-05 16:27:01 -04:00
Peter Hutterer a576791064 Use American English - 'ise' -> 'ize' where applicable 2017-05-04 22:09:27 +03:00
Peter Hutterer ca924451ac Use American English: behaviour -> behavior 2017-05-04 22:09:27 +03:00
Jussi Pakkanen 8f49764896 Merge pull request #1717 from valum-framework/fix-descriptions-for-ninja-backend
ninjabackend: Use more consistent descriptions
2017-05-03 18:52:46 +03:00
Jussi Pakkanen 33b79dcf25 Kill RawFile dead! 2017-05-03 18:27:04 +03:00
Elliott Sales de Andrade a96d79cc00 ninjabackend: Don't pluralize twice custom target cleaning description 2017-05-02 18:45:56 -04:00
Guillaume Poirier-Morency 820fc8ee24 ninjabackend: Fix implicit comment for 'C#' rule description 2017-05-02 18:40:00 -04:00
Guillaume Poirier-Morency 253201d9bf ninjabackend: Add a set of raw names 2017-05-02 16:54:13 -04:00
Dylan Baker a8173630ea Don't use len() to test emptiness vs not emptiness
Meson has a common pattern of using 'if len(foo) == 0:' or
'if len(foo) != 0:', however, this is a common anti-pattern in python.
Instead tests for emptiness/non-emptiness should be done with a simple
'if foo:' or 'if not foo:'

Consider the following:
>>> import timeit
>>> timeit.timeit('if len([]) == 0: pass')
0.10730923599840025
>>> timeit.timeit('if not []: pass')
0.030033907998586074
>>> timeit.timeit('if len(['a', 'b', 'c', 'd']) == 0: pass')
0.1154778649979562
>>> timeit.timeit("if not ['a', 'b', 'c', 'd']: pass")
0.08259823200205574
>>> timeit.timeit('if len("") == 0: pass')
0.089759664999292
>>> timeit.timeit('if not "": pass')
0.02340641999762738
>>> timeit.timeit('if len("foo") == 0: pass')
0.08848102600313723
>>> timeit.timeit('if not "foo": pass')
0.04032287199879647

And for the one additional case of 'if len(foo.strip()) == 0', which can
be replaced with 'if not foo.isspace()'
>>> timeit.timeit('if len("   ".strip()) == 0: pass')
0.15294511600222904
>>> timeit.timeit('if "   ".isspace(): pass')
0.09413968399894657
>>> timeit.timeit('if len("   abc".strip()) == 0: pass')
0.2023209120015963
>>> timeit.timeit('if "   abc".isspace(): pass')
0.09571301700270851

In other words, it's always a win to not use len(), when you don't
actually want to check the length.
2017-05-02 21:57:26 +03:00
Guillaume Poirier-Morency ce2e36fd6e ninjabackend: Fix typography for JAR and C# in descriptions 2017-05-02 10:44:35 -04:00
Guillaume Poirier-Morency f16232856e ninjabackend: Use 'custom targets' instead of 'CustomTarget' in description
The build definition is basically cleaning all the directories of all
custom targets.
2017-05-02 10:29:58 -04:00
Guillaume Poirier-Morency 91dc6a60df ninjabackend: Don't quote descriptions 2017-05-02 10:27:05 -04:00
Guillaume Poirier-Morency 3afc44973d ninjabackend: Use more consistent descriptions
Use a titlecase for arbitrary language, this was we don't have 'C' in
lowercase.

Rename 'Static linking library $out' for 'Linking static target $out.'.

Add missing punctuation.
2017-05-02 10:16:09 -04:00
Paolo Borelli 83c5c738dd Try to be locale-independent when we match VS output
Different locales have a different number of ':' in the string
we want to match. Closes #1639.
2017-04-29 12:35:47 +03:00
Jussi Pakkanen b6a3d34bd6 Replace cmd line arguments on install scripts. Closes #1681. 2017-04-28 17:26:37 +03:00
Guillaume Poirier-Morency aa486f5bb2 vala: Add 'VALAFLAGS' to considered environment variables
Fix precedence of arguments for Vala tasks and include those considered
external (i.e. '-Dvala_args' and 'VALAFLAGS').
2017-04-22 21:56:43 +03:00
Nirbheek Chauhan 61ed2702bf ninja: Don't use @file.rsp with ArLinker on Windows
We can't use @file.rsp on Windows with ArLinker because llvm-ar and
gcc-ar blindly pass the --plugin argument to `ar` and you cannot pass
options as arguments while using the @file.rsp syntax.

[5/7] cc @mylib@sta/libfile4.c.obj.rsp
[6/7] gcc-ar @libmylib.a.rsp
FAILED: libmylib.a
gcc-ar @libmylib.a.rsp
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ar.exe: invalid option -- @

https://github.com/mesonbuild/meson/pull/1649
https://ci.appveyor.com/project/jpakkane/meson/build/1.0.2330/job/w3hj9jfdasefsqi9
2017-04-21 17:21:57 +05:30
Elliott Sales de Andrade 5b917a6e17 Skip all whole archive args if there aren't any.
No need to turn it on and off again if there's nothing requiring it.
2017-04-16 12:32:35 +03:00
Jussi Pakkanen b48daeda1a Make it possible to only do unity builds on subprojects. 2017-04-15 18:28:36 +03:00
Jussi Pakkanen 4e1249c920 Merge pull request #1549 from mesonbuild/linkwhole
Add option to link the entire contents of a static library to a target.
2017-04-15 18:16:35 +03:00
Jussi Pakkanen b951e60f06 Merge pull request #1548 from ssssam/sam/stable-ordering
Stable ordering of some commandlines generated by 'gnome' module
2017-04-13 23:59:48 +03:00
Jussi Pakkanen 630d7a5175 Process VS dependency string as raw bytes. 2017-04-13 23:50:31 +03:00
Sam Thursfield 2db11f1383 Sort user commandline options when generating 'scan-build' target
We receive these options from the 'argparse' module in a random
order. To ensure the build.ninja file doesn't include random variations
we should sort them before writing them back out.
2017-04-12 21:37:25 +01:00
Nirbheek Chauhan c52963cd16 vala: Allow installation into default directories
For generated headers, vapis, and GIRs.

https://github.com/mesonbuild/meson/pull/1469#issuecomment-292814000
2017-04-12 23:33:02 +03:00
Nirbheek Chauhan 711c0cbd67 vs: Fix depend_files support in custom targets
This was totally broken and we didn't notice because we had no tests
for it at all.
2017-04-10 22:32:41 +05:30
Nirbheek Chauhan 878b0f1401 Fix shared module installation directory on Windows 2017-04-10 03:38:04 +05:30