aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
AgeCommit message (Collapse)AuthorFilesLines
2023-06-14compilers: add logging for non c_or_cpp language detectionEli Schwartz1-11/+11
2023-06-14WIP: refactor loggable popen calls for consistencyEli Schwartz2-12/+4
2023-06-07rust: PIC is always enabledXavier Claessens1-2/+2
rustc enables PIC by default and Meson currently has no way to force disabling PIC, it can only force enable or use compiler's default.
2023-05-31mlog: remove direct calls to log_onceDylan Baker1-3/+3
This was never meant to be public API, log(once=True) is for that.
2023-05-20rust: Add system libs used by rust std to staticlib external depsXavier Claessens1-0/+14
2023-05-20rust: Use Popen_safe() for sanity checksXavier Claessens1-11/+2
2023-05-16rust compiler: use better sanity check logging comparable to the clike oneEli Schwartz1-7/+13
Don't spew debug-level info. Log the actual command line run.
2023-05-13During reconfigure, show that no compiler was found, if compiler fails ↵Volker Weißmann1-4/+8
sanity check.
2023-05-06Initial support for Metrowerks AssemblerNomura3-1/+125
2023-05-01extract_all_objects: Include PCH object with MSVCXavier Claessens1-1/+1
This changes the object file name with ninja backend to match the name used by vs backend and add it in outputs of the ninja rule.
2023-04-24yasm: Fix usage of incompatible optimization flagsL. E. Segovia1-0/+4
Fixes #11726
2023-04-24Initial support for Metrowerks C/C++ compilerNomura4-3/+388
2023-04-21rust: add support for b_ndebugDylan Baker1-1/+5
Rust has a `debug_assert!()` macro, which is designed to be toggled on the command line. It is on by default in debug builds, and off by default in release builds, in cargo. This matches what meson's b_ndebug option does in `if-release` mode.
2023-04-21compilers: split code for deciding if debug is needed into a helperDylan Baker1-4/+12
2023-04-21compilers: convert method to get assert control to a booleanDylan Baker4-15/+28
C like compilers only off `-DNDEBUG` to disable asserts. This is not a universal paradigm however. Rust, for example has an argument that takes a boolean. To better represent this, we allow passing a `disable` boolean. `disable` was chosen rather than `enable` because it allowed all existing logic to be left in place
2023-04-20intro: add more details to generated json filesCharles Brunet1-1/+1
This will help with the writing of tools to generate VisualStudio project and solution files, and possibly for other IDEs as well. - Used compilers a about `host`, `build` and `target` machines arere listed in `intro-compilers.json` - Informations lister in `intro-machines.json` - `intro-dependencies.json` now includes internal dependencies, and relations between dependencies. - `intro-targets.json` now includes dependencies, `vs_module_defs`, `win_subsystem`, and linker parameters.
2023-04-17Add c++23 to the list of C++ standards.Jussi Pakkanen1-1/+5
2023-04-14rust: Use the corresponding rustc version when clippy-driver is chosen as ↵Sebastian Dröge1-1/+12
Rust compiler By default clippy-driver will report its own version, which is not very useful to check the toolchain version. Instead make sure to extract the actual toolchain version here.
2023-04-14rust: Don't pass dependency compile arguments to the compilerSebastian Dröge1-0/+7
Rust doesn't have a concept of dependency compile arguments, i.e. something like headers. Dependencies are linked in and all required metadata is provided by the linker flags.
2023-04-11fix various spelling issuesJosh Soref4-10/+10
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-11Change "can not" to "cannot" throughout projectHiPhish9-9/+9
The word "cannot" expresses inability to do something whereas "can not" expresses the ability to refrain from doing something.
2023-03-23asm: Add sx extensionRenan Lavarec6-1/+7
docs: gcc https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html scons: https://scons.org/doc/3.0.5/HTML/scons-user/apb.html .S Windows: assembly language file ARM: CodeSourcery Sourcery Lite .sx assembly language file + C pre-processor POSIX: assembly language file + C pre-processor
2023-03-18Small fix on how cc.sizeof (and similar functions) use the 'prefix' kwargVolker Weißmann1-14/+14
2023-03-16prevent lib prefix warning from pkg-configCharles Brunet6-13/+13
2023-03-12Fix warning_level=everything with GCC 8David Robillard1-1/+3
This option was introduced with GCC 8.1.0 as in the original commit, but the value wasn't right initially and was volatile during the 8 series. To avoid this, this commit moves the warning to 9.1.0 (the next version we generally care about), since we don't want to get too deep into the weeds of point releases, and a warning not being used yet in some particular version of GCC isn't a big deal.
2023-03-09detect.py: Be more precise about detecting xtensa gcc toolchainsKhem Raj1-1/+1
clang --version can yield a string like below when its installed into such a directory clang version 14.0.0 (https://github.com/llvm/llvm-project 3f43d803382d57e3fc010ca19833077d1023e9c9) Target: aarch64-yoe-linux Thread model: posix InstalledDir: /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux/gnome-text-editor/42.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux as you can see InstallDir has 'xt-' subtring and this trips the check to guess gcc if 'Free Software Foundation' in out or 'xt-' in out: Therefore, check if compiler output starts with xt- then assume it to be gcc Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-27Use caching in Compiler.sizeof() and Compiler.alignment()Andres Freund3-23/+25
2023-02-27Add Compiler.cached_run()Andres Freund1-1/+29
Caching Compiler.run() seems likely to cause problems, but some users, like .sizeof(), we know enough about the program run to make it safe. This commit just adds the Compiler.cached_run(), a subsequent commit makes use of it.
2023-02-25Misleading comment mtribiere1-1/+1
Code moved to detect.py in recent version
2023-02-20nasm: Detect and use MSVC linker if presentL. E. Segovia1-0/+3
Fixes #11082
2023-02-20nasm: Link with windows CRT libs when nasm is used as linker languageXavier Claessens2-2/+51
2023-02-17compilers: -fprofile-correction is only a valid switch with gcc itself.Luke Elliott1-1/+4
clang++ main.cpp -fprofile-correction clang-15: warning: optimization flag '-fprofile-correction' is not supported [-Wignored-optimization-argument]
2023-02-14asm: Use more backward-compatible invocation syntax for nasmSimon McVittie1-1/+1
Before version 2.14.01, -MD required an output filename argument, with `-MD outfile` equivalent to later versions' `-MD -MF outfile`. The older syntax is still supported, and is still listed as the preferred syntax in documentation. Reference: https://github.com/netwide-assembler/nasm/commit/3475462e Resolves: https://github.com/mesonbuild/meson/issues/11395 Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-10cython: wire up support for emitting and using depfilesEli Schwartz1-1/+9
This solves rebuild issues when e.g. importing a .pxd header from a .pyx file, just like C/C++ source headers. The transpiler needs to run again in this case. This functionality is present in the 3.0.0 alphas of cython, and is also backported to 0.29.33. Fixes #9049
2023-02-08compilers: Optimize the /Zc:__cplusplus codeDylan Baker1-10/+6
This could also be handled once, in the initializer
2023-02-08compilers: Remove /utf-8 from Visual Studio command args onceDylan Baker1-3/+9
Instead of looking at it each time get_always_args() is called, do it once. Also avoid mutating global state.
2023-02-08compilers: Copy const always_args before returningDylan Baker1-1/+2
Eventually we would probably be better served (to avoid unnecessary copies) to use the ImmutableListProtocol here, but for the moment this is effective, it's also what we do in every other case.
2023-02-07Visual Studio: Drop /utf-8 if it is not supportedChun-wei Fan1-0/+10
We assume /utf-8 for all C builds unless /source-charset or /execution-charset is specified, but then this will cause trouble for Visual Studio 2013 or earler since the /utf-8 flag is only supported since Visual Studio 2015. Specifically, if we try to check whether compiler flags are supported, those checks will fail since /utf-8 is never supported on these older Visual Studio versions. Drop /utf-8 from get_always_args() if we are using Visual Studio 2013 or earlier.
2023-02-01pylint 2.16: join iterables without repeated appendEli Schwartz1-3/+1
We do += style joining in a loop, but we could just join with `''.join()` which is faster, neater, and simpler.
2023-02-01remove unneeded type commentEli Schwartz1-1/+1
2023-02-01treewide: add future annotations importEli Schwartz11-0/+11
2023-02-01add cc.has_function_attribute('vector_size')Dudemanguy1-0/+2
2023-02-01remove /utf-8 option when /validate-charset- is presentCharles Brunet1-1/+3
2023-01-31cuda: enable C++20 for CUDA 12David Seifert1-2/+15
https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#cuda-compilers
2023-01-18 Fix nasm when target has threads as added dependencyGijs Peskens1-0/+8
2023-01-04clang-cl: supports /std:c++20 now.Luke Elliott1-1/+1
See https://github.com/llvm/llvm-project/commit/a8f75d49
2023-01-03Add fatal=False to many mlog.warnings()Dylan Baker1-3/+4
There are lots of warnings that become fatal, that are simply unfixable by the end user. Things like using old versions of software (because they're using some kind of LTS release), warnings about compilers not supporting certain kinds of checks, or standards being upgraded due to skipped implementations (MSVC has c++98 and c++14, but not c++11). None of these should be fatal, they're informative, and too important to reduce to notices, but not important enough to stop meson if they're printed.
2023-01-03reformat some warnings for better code readabilityDylan Baker1-1/+1
2022-12-27emscripten: remove no longer relevant commentKleis Auke Wolthuizen1-2/+1
This was fixed in Emscripten 1.39.16, see: https://github.com/emscripten-core/emscripten/commit/d4fabf3da40e7f556700b16950739d5960a91559
2022-12-27emscripten: enforce version 1.39.19 or higherKleis Auke Wolthuizen2-0/+4