aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
AgeCommit message (Collapse)AuthorFilesLines
2020-09-06backends: check external rpaths for all languages using ldflagsJames Hilliard1-0/+1
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2020-08-30D: fix include orderPierrick Bouvier1-0/+7
Commit 93c3ec7e introduced a new way to handle deduplication with compiler args. This resulted in D includes to be reversed.
2020-08-27Fix typo when fetching buildtype option for compiler checksNirbheek Chauhan1-1/+1
This type happened in https://github.com/mesonbuild/meson/pull/7432 and wasn't noticed because I didn't add a test for it. Rectified now. If we don't specify the CRT, MSVC will pick /MT by default (!?) and link to `libcmt.lib`. This actually *breaks* UWP because `libcmt.lib` is not available by default when building for UWP. Was noticed here: https://github.com/cisco/libsrtp/pull/505
2020-08-25Merge pull request #7581 from peterh/aixJussi Pakkanen1-1/+1
Add AIX support
2020-08-23Merge pull request #7600 from alexrp/masterJussi Pakkanen1-2/+13
Add C2x option support.
2020-08-22Merge pull request #7609 from dcbaker/submit/2020-08/cmake-fix-apple-clangJussi Pakkanen3-0/+15
Fix mapping of apple compilers in cmake
2020-08-22compilers: Add Apple subclasses for ObjC and ObjC++Dylan Baker3-0/+15
These are needed because in some cases we need to be able to know if we're using vanilla clang or Apple's clang.
2020-08-22Add C2x option support.Alex Rønne Petersen1-2/+13
2020-08-22Merge pull request #7607 from bonzini/speedupJussi Pakkanen1-4/+8
Various speedups from profiling QEMU's meson.build
2020-08-22Merge pull request #7447 from scivision/nvcJussi Pakkanen4-4/+45
Add support for NVidia HPC SDK compilers
2020-08-20Correctly determine C++ stds for Elbrus compilermakise-homura1-5/+13
2020-08-18clike: optimize to_nativePaolo Bonzini1-4/+8
Look for group-able flags with a single regex match, since we are already using regexes for .so files. Also weed out flags other than -isystem very quickly with a single startswith call. On a QEMU build, the time spent in to_native goes from 2.279s to 1.322s.
2020-08-17find_library: include get_linker_always_args in link argsPeter Harris1-1/+1
The linker always args, as the name implies, should always be included. For example, the AIX get_allow_undefined_link_args are a syntax error unless the AIX get_linker_always_args are also used.
2020-08-09msvc: enable /std:c11 flagMichael Hirsch1-0/+20
2020-08-02Make meson recognize the Qualcomm LLVM toolchainAntony Chan1-0/+5
Meson calls `path/to/clang++ --version` to guess which build toolchain the user has picked to build the source code. For the Qualcomm LLVM toolchain, the output have an unusual output as shown below: ``` clang version 8.0.12 Snapdragon LLVM ARM Compiler 8.0.12 (based on llvm.org 7.0+) Target: arm-unknown-linux-gnueabi Thread model: posix Repository: (ssh://git-hexagon-aus.qualcomm.com:...) InstalledDir: /pkg/qct/software/llvm/release/arm/8.0.12/bin ``` Another unusual pattern is the output of `path/to/ld.qcld --version`: ``` ARM Linker from Snapdragon LLVM ARM Compiler Version 8.0.12 ARM Linker based on LLVM version: 8.0 ``` The Meson logic is modified accordingly so that Meson can correctly determine toolchain as "LLVM aarch64 cross-compiler on GNU/Linux64 OS". This is the expected output of `meson --native-file native_file.ini --cross-file cross_file.ini build/aarch64-debug/`: ``` ... C++ compiler for the host machine: ... (clang 8.0.12 "clang version 8.0.12") C++ linker for the host machine: ... ld.lld 8.0.12 ... ```
2020-07-23compilers: Cache gnu-mixins has_arguments() checksNirbheek Chauhan1-1/+1
want_output gives us the output file. We don't need the file. We just need the compiler stderr, which is always stored.
2020-07-22visualstudio: warning_level 0 should not map to /W1Xavier Claessens1-1/+1
In every other compilers level 0 maps to no argument at all.
2020-07-19fix msvc not recognising b_ndebugElliot Haisley1-1/+1
fixes #7404
2020-07-13Fix native builds on Windows ARM64 machinesNirbheek Chauhan4-11/+10
I made the mistake of always selecting the debug CRT for compiler checks on Windows 4 years ago: https://github.com/mesonbuild/meson/pull/543 https://github.com/mesonbuild/meson/pull/614 The idea was to always build the tests with debugging enabled so that the compiler doesn't optimize the tests away. But we stopped doing that a while ago, and also the debug CRT has no relation to that. We should select the CRT in the same way that we do for building targets: based on the options. On Windows ARM64, the debug CRT for ARM64 isn't always available, and the release CRT is available only after installing the runtime package. Without this, we will always try to pick the debug CRT even when --buildtype=debugoptimized or release.
2020-07-13add Nvidia HPC SDK compilersMichael Hirsch, Ph.D4-4/+45
2020-06-22arglist: Split the C/C++ specifics parts into a subclass for CLikeDylan Baker1-3/+53
This means that we don't need work arounds for D-like compilers, as the special c-like hanlding wont be used for D compilers.
2020-06-22compilers: Return CompilerArgs from compiler instanceDylan Baker3-5/+25
Since the CompileArgs class already needs to know about the compiler, and we really need at least per-lanaguage if not per-compiler CompilerArgs classes, let's get the CompilerArgs instance from the compiler using a method.
2020-06-22compilers: Split CompilerArgs into a separate moduleDylan Baker4-376/+7
I've also moved this out of the compilers pacakge because we're soon going to need it in linkers, and that creates some serious spagetti
2020-06-22compilers: Add missing annotations to CompilerArgs classDylan Baker1-16/+14
2020-06-22compilers: Use enum for for deupdlication returns in CompilerArgsDylan Baker1-27/+36
2020-06-21compiler: add 'force_align_arg_pointer' function attributeTim-Philipp Müller1-0/+2
2020-06-11apple: -headerpad args are ignored when bitcode is enabledNirbheek Chauhan1-2/+6
Causes spammy warnings from the linker: ld: warning: -headerpad_max_install_names is ignored when used with -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES)
2020-06-11compilers: corretify deduplication directionMarcel Hollerbach1-2/+2
so: when building compile args, meson is deduplicating flags. When a compiler argument is appended, a later appearance of a dedup'ed is going to remove a earlier one. If the argument is prepended, the element *before* the new one is going to be removed. And that is where the problem reported in https://github.com/mesonbuild/meson/pull/7119 is coming in. In the revision linked there, the order of replacement in the prepend case was revesered. With this patch, we restore this behaviour again.
2020-06-09compilers: Add UNIX large file support for MinGWSeungha Yang1-3/+3
MinGW gcc supports _FILE_OFFSET_BITS=64 and we need to set it for MinGW as well
2020-06-07Merge pull request #7119 from marcelhollerbach/masterJussi Pakkanen1-37/+68
Performance optimize ninja backend
2020-06-07Merge pull request #7256 from peterh/openmpJussi Pakkanen2-0/+6
Fix OpenMP on Visual Studio
2020-06-07Remove warnings from sample code. Closes #7248.Jussi Pakkanen1-1/+1
2020-06-07End test code with a newline. Closes #7247.Jussi Pakkanen1-2/+2
2020-06-06msvc: Avoid spurious openmp link warningsPeter Harris2-0/+6
The linker that comes with MSVC does not understand the /openmp flag. This results in a string of LINK : warning LNK4044: unrecognized option '/openmp'; ignored warnings, one for each static_library linked with an executable. Avoid this by only setting the linker openmp flag when the compiler is not MSVC.
2020-06-05CompilerArgs: refactor __iadd__Marcel Hollerbach1-18/+64
the previous optimizations from 4524088d386d2e2315d8fef6ffedc11d8e9a394a were not relaly good, and not really scaleable, since only the lookup was improved. However, the really heavy calls to remove have not been improved. With this commit we are refactoring CompilerArgs into a data structure which does not use remove at all. This works that we are building a pre and post list, which gets flushed into __container at some point. However, we build pre and post by deduplicating forward. Later on, when we are flushing pre and post into __container, we are deduplicating backwards the list, so we are not changing behaviour here. This overall cuts off 10s of the efl configuration time. Further more this improves configure times on arm devices a lot more, since remove does seem to be a lot slower there. In general this results in the fact that __iadd__ is not within the top 5 of costly functions in generate_single_complie.
2020-06-05Revert "CompilerArgs: make lookup faster"Marcel Hollerbach1-26/+7
This was a not so nice solution, and should be replaced with something better. This reverts commit 4524088d386d2e2315d8fef6ffedc11d8e9a394a.
2020-06-05cache up regex mathingsMarcel Hollerbach1-2/+6
the names passed in here are often the same. We should ensure that we cache the regex match, as this will speed up our runtime a lot.
2020-06-02Ignore file access errors when scanning .so files in system libdirsMike Gilbert1-9/+18
Bug: https://bugs.gentoo.org/726524
2020-05-27add type anno: compilers/clikeMichael Hirsch, Ph.D2-18/+18
2020-05-27Recognize Arduino .ino files as C++Phillip Johnston1-1/+1
Renaming .ino files is not an option when working with the IDE. Meson should recognize it as C++ however.
2020-05-22Modifed buildtypes and armclang compiler flags to match documented resultsDrew Reed1-6/+6
2020-05-22Allow building with b_coverage set to true when clang is being used ↵georgev931-0/+3
regardless of linker selection.
2020-05-22compilers: add fetching of define list for clangYevhenii Kolesnikov6-8/+17
Simmilar to gcc, the list of pre-processor defines can be fetched with `-dM -E` option. The way cpu_family is determined on linux relies on this list. Fixes incorrect value of cpu_family on linux, when crosscompiling: ``` CC="clang -m32" meson ./build ``` Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com> Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2020-05-20compilers/d: Add b_ndebug supportDylan Baker2-6/+15
D lang compilers have an option -release (or similar) which turns off asserts, contracts, and other runtime type checking. This patch wires that up to the b_ndebug flag. Fixes #7082
2020-05-20compilers: Move b_ndebug into the compiler classesDylan Baker2-1/+7
Right now we hardcode -DNDEBUG as the value to be added for b_ndebug. Which is a not the correct behavior for non C/C++ languages. By pushing this back into the compiler classes we can change this for other languages.
2020-05-18Merge pull request #7103 from dankegel/bug4027-rpath-rememberJussi Pakkanen4-10/+12
Let .pc files and LDFLAGS provide rpaths.
2020-05-18compilers/d: Enable pgo for GDCDylan Baker1-1/+2
2020-05-16Let .pc files specify rpath.Dan Kegel4-10/+12
Fixes #4027
2020-05-16Add flags to support generation of dependency files with armclangDrew Reed1-1/+1
2020-05-16Modifed buildtypes and armcc compiler flags to match documented resultsDrew Reed1-7/+7