Commit Graph

773 Commits

Author SHA1 Message Date
Dylan Baker f9b19e73a5 move OptionKey to mesonlib
There's starting to be a lot of things including coredata that coredata
needs to itself include. putting it in mesonlib makes more sense
2021-01-04 12:20:40 -08:00
Dylan Baker fe973d9fc4 use OptionKey for compiler_options 2021-01-04 12:20:39 -08:00
Dylan Baker bdca05e2e6 Add choices to OptionProxy
they're probably not strictly needed, but it makes mypy happy.
2021-01-04 12:15:41 -08:00
Remi Thebault 7a9a9e4a99
Implement support of dlang -makedeps switch (#8119)
* Implement support of dlang -makedeps switch

Fix #8118

* resolve code review comments
2020-12-29 09:56:35 -08:00
Laurin-Luis Lehning 4164efceca Propagate Windows target checks up 2020-12-14 11:23:53 -08:00
Laurin-Luis Lehning 919278e3e1 Give get_gui_app_args access to the Environment 2020-12-14 11:23:53 -08:00
Laurin-Luis Lehning 4053babf9c Slight consistency changes to get_gui_app_args 2020-12-14 11:23:53 -08:00
Laurin-Luis Lehning 9de09e9aa6 Give get_win_subsystem_args access to env 2020-12-14 11:23:53 -08:00
Laurin-Luis Lehning 2fb4d1f751 Make win_subsystem a linker property 2020-12-14 11:23:53 -08:00
Jussi Pakkanen 9f1ba40252
Merge pull request #8013 from mesonbuild/cppmodules
C++ module support
2020-12-14 15:00:04 +00:00
Laurin-Luis Lehning bab1087422
Add support for driving lld-link indirectly through clang on Windows 2020-12-13 16:34:50 +02:00
Jussi Pakkanen 5bd1276d20 Create unit test for C++ modules and accept ixx as C++ source extension. 2020-12-11 19:21:02 +00:00
Florian Schmaus a7aba905a0 compilers: add support for c++20/gnu++20
Fixes #8084.
2020-12-10 00:30:48 +02:00
Jussi Pakkanen c21b04ba08 Add prelinking support for static libraries. 2020-12-03 22:58:07 +02:00
Dylan Baker 8915538c31 compilers/fortran: Add "none" to intel compielrs for standards
Fixes #8023
2020-11-24 23:11:23 -05:00
Christoph Reiter abc7e6af01 Add a variant of TemporaryDirectory that uses windows_proof_rmtree()
Adds TemporaryDirectoryWinProof which calls windows_proof_rmtree() on
error.

Use instead of hacky error handling (which might shadow other OSError)
in Compiler.compile().
2020-11-23 09:26:41 -08:00
Dylan Baker f6672c7a19 use real pathlib module
We added the _pathlib module to work around defeciencies in python 3.5's
implementation, since we now rely on 3.6 lets drop this
2020-11-20 15:08:40 -08:00
Jussi Pakkanen c8af3c8d29 Revert "Add thinlto support. Closes #7493."
This reverts commit 3e6fbde94c.
2020-11-17 17:51:23 +02:00
Jussi Pakkanen 299a67781e
Merge pull request #7843 from dcbaker/submit/rustc-fixes
A few fixups for rust
2020-11-14 13:47:39 +02:00
jpark37 2748c9fb3d msvc: enable /std:c17 flag
Increase allowed c_std options, and check compiler version.

Also update mlog pattern to not crash.
2020-11-13 16:13:02 -08:00
Dylan Baker 5afd608a75 compilers/rust: add and use an implementation of use_linker_args 2020-11-13 09:00:35 -08:00
Jussi Pakkanen 91876b4031
Merge pull request #7866 from dcbaker/submit/compiler-std-in-base
Put the Compiler standard option in the Language mixin
2020-11-13 17:49:52 +02:00
Dylan Baker f31acbe2a4 clang-cl: Allow clang-cl (when compiling C) to pass std to underlying clang)
This allows a wider array of standard support than would be available
directly from clang-cl, emulating MSVC stds.
2020-11-12 12:52:27 -08:00
Dylan Baker 0217faf13f compilers/c: Log that MSVC doesn't support gnu stds
Since the current approach of demoting to the nearest C standard *might*
work, but might not. For projects like Glib that detect which standard
is used and fall back this is fine. For projects like libdrm that only
work with gnu standards, this wont. We're nog tusing a warning because
this shouldn't be fatal if --meson-fatal-warnings is used. Also demote a
similar message in IntelCl from warning to log.
2020-11-12 10:06:11 -08:00
Dylan Baker 2844afedde compilers: define standards in the base language compiler
And then update the choices in each leaf class. This way we don't end up
with another case where we implicitly allow an invalid standard to be
set on a compiler that doesn't have a 'std' setting currently.
2020-11-12 10:03:15 -08:00
Dylan Baker a28a34c684 compilers: Standardize the names of compiler options
Most options don't use language prefaced options (std vs c_std)
internally, as we don't need that due to namespacing. Let's do that
across the board
2020-11-12 10:03:14 -08:00
Dylan Baker 3e62307f3a compilers/c: Clang-cl also needs specific handling for standards 2020-11-12 10:03:14 -08:00
Jussi Pakkanen 333e0aeef4 Make MSVC accept gnu11 as a language standard version. Closes: #7611.
Fixes: #7611
2020-11-12 10:03:14 -08:00
Dylan Baker ce46070b4e compilers/rust: Add color output
Rust has color output, although it's help doesn't document it. It uses
the same values as cargo (and everything else), auto, never, always.
2020-11-10 12:09:21 -08:00
Dylan Baker e430c01ef5 compilers/rust: Add vs_crt support
As far as I can Tell, rust just handles this for us (it's always worked
with no special arguments from us). However, since we're going to add
support for base options for rust, we need to add the method.
2020-11-10 12:09:03 -08:00
Jussi Pakkanen dffd66e0ff Fix WASM thread count option. Closes #7921. 2020-11-09 23:06:52 +02:00
Christoph Reiter 5dd174c60b Fix "generator doesn't stop" on Windows
When TemporaryDirectory() cleans up on __exit__ it sometimes throws
OSError noting that the dir isn't empty. This happens after the
first yield in this generator and leads to the exception being handled
which leads to a second yield.

contextlib.contextmanager() fails then since the function it wraps is only
allowed to yield once.

Fix this by not yielding again in the error case.

Fixes #7947
2020-11-08 19:10:48 +02:00
Jussi Pakkanen 3e6fbde94c Add thinlto support. Closes #7493. 2020-11-08 16:00:05 +02:00
Dylan Baker 7860a6aeab rust: implement support for --edition
Using the std option, so now `rust_std=..` will work. I've chosen to use
"std" even though rust calls these "editions", as meson refers to
language versions as "standards", which makes meson feel more uniform,
and be less surprising.

Fixes: #5100
2020-11-05 21:24:20 +02:00
Xavier Claessens 7902d2032d Refactor handling of machine file options
It is much easier to not try to parse options into complicated
structures until we actually collected all options: machine files,
command line, project()'s default_options, environment.
2020-10-16 17:42:24 -04:00
Carlos Bederian c3b3dc598e compilers/cuda: Use format_map(mapping) instead of format(**mapping) 2020-10-16 18:18:46 +02:00
Carlos Bederian f09457a1e8 compilers/cuda: Fix has_header_symbol check 2020-10-16 18:18:46 +02:00
Peter Harris 8b8a610ea4 vs: add static_from_buildtype to b_vscrt 2020-10-14 19:35:28 +03:00
Jussi Pakkanen 1a0603835e Add win_subsystem kwarg. Closes #7765. 2020-10-07 18:55:25 +03:00
Vinson Lee 5d7069664b compilers: Enable C++20 for Intel C++ Compiler.
Intel C++ Compiler 19.1 has C++20 features.

https://software.intel.com/content/www/us/en/develop/articles/intel-c-compiler-191-for-linux-release-notes-for-intel-parallel-studio-xe-2020.html

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2020-10-06 22:11:34 +03:00
Daniel Mensinger 1dfaccfd91 pathlib: Fix resolve() by overriding it in Python 3.5 2020-10-04 10:45:48 +02:00
Dylan Baker 2fe400c350 compilers/icl fix IntelClCPP argument checking
Unlike MSVC and ClangCl it needs to call into it's own compiler check
args
2020-10-01 15:06:10 -07:00
Dylan Baker f9316fbb46 compilers/icl: Fix pch usage 2020-10-01 15:06:10 -07:00
Dylan Baker b309f4904b compilers/fortran: make ifort on windows signature match ICL's 2020-10-01 15:06:10 -07:00
Dylan Baker ff51e1c5aa compilers/clike: Store exe_wrapper as ExternalProgram
Which is what other languages do.
2020-10-01 15:06:10 -07:00
Dylan Baker 135f5d5838 compilers: make get_optimization_args abstract 2020-10-01 15:06:10 -07:00
Dylan Baker 577a2de7e8 compilers/fortran: fix has_multi_*_arguments
The implementation of the link variant was what should have been the
compiler variant, and there was no valid compiler variant, which meant
it was getting C code.
2020-10-01 15:06:10 -07:00
Dylan Baker 6a9761a2c0 compilers/d: add type annotations 2020-10-01 15:06:10 -07:00
Dylan Baker 6eb981e0c0 compilers/gnu: Don't pretend to inherit CLike
We don't need it anymore, and it would be problematic for the D
compilers.
2020-10-01 15:05:01 -07:00
Dylan Baker 738e343860 compilers: move _build_wrapper out of clike into Compiler
This abstraction is really useful, and most compilers could use it
(including D). It also will allow the Gnu mixins to work properly
without the CLikeCompiler in their mro.
2020-10-01 15:05:01 -07:00