aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2020-06-09Made --help options sortedTheQwertiest2-2/+2
2020-06-09cmake_traceparser: ignore parse errorMichael Hirsch1-1/+1
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-08Merge pull request #7245 from dankegel/response-files-when-needed-tidiedJussi Pakkanen3-109/+284
Make ninja backend only use response files when needed, on linux too
2020-06-07Merge pull request #7119 from marcelhollerbach/masterJussi Pakkanen2-38/+73
Performance optimize ninja backend
2020-06-07Merge pull request #7256 from peterh/openmpJussi Pakkanen4-18/+25
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-06backend/vs: Fix OpenMP supportPeter Harris1-17/+17
Use the IDE's OpenMP flag instead of adding /openmp to additional arguments. The IDE appears to override /openmp in additional arguments with the IDE setting, which defaults to false, leading to binaries built without OpenMP.
2020-06-06msvc: Avoid spurious openmp link warningsPeter Harris3-1/+8
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-05ninja: response file threshold now more accurate, overridable, portable.Dan Kegel1-2/+20
2020-06-05gnulike linkers (and ar) accept rsp files.Dan Kegel1-0/+7
2020-06-05ninja: Add ninja variable DEPFILE_UNQUOTED with unquoted DEPFILE valueJon Turney1-1/+7
It's assumed that where we use DEPFILE in command or rspfile_content, it can be quoted by quoting the ninja variable (e.g. $DEPFILE -> '$DEPFILE') This is nearly always true, but not for gcc response files, where backslash is always an escape, even inside single quotes. So this fails if the value of DEPFILE contains backslashes (e.g. a Windows path) Do some special casing, adding DEPFILE_UNQUOTED, so that the value of depfile is not shell quoted (so ninja can use it to locate the depfile to read), but the value of DEPFILE used in command or rspfile_content is shell/response file quoted) (It would seem this also exists as a more general problem with built-in ninja variables: '$out' appearing in command is fine, unless one of the output filenames contains a single quote. Although forbidding shell metacharacters in filenames seems a reasonable way to solve that.) (How does this even work, currently? Backslashes in the value of all ninja variables, including DEPFILE were escaped, which protected them against being treated as escapes in the gcc response file. And fortunately, the empty path elements indicated by a double backslash in the value of depfile are ignored when ninja opens that file to read it.)
2020-06-05ninja: Specifically implement gcc rspfile style quotingJon Turney1-8/+18
This differs from sh-quoting in that a backslash *always* escapes the following character, even inside single quotes. Yes, really. https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libiberty/argv.c#l176
2020-06-05backend: There is no need for 'compiler-specific escaping' anymoreJon Turney2-24/+7
Now that all command-line escaping for ninja is dealt with in the ninja backend, escape_extra_args() shouldn't need to do anything. But tests of existing behaviour rely on all backslashes in defines being C escaped: This means that Windows-style paths including backslashes can be safely used, but makes it impossible to have a define containing a C escape.
2020-06-05ninja: Implement Windows-style command line quotingJon Turney1-4/+11
We avoided having to get this right previously, as we'd always use a response file if possible. But this is so insane, I can't imagine it's right. See also: subprocess.list2cmdline() internal method
2020-06-05ninja: Quoting in rspfile depends on the compiler, not the shellJon Turney1-17/+48
In certain exotic configurations, the style of quoting expected in the response file may not match that expected by the shell. e.g. under MSYS2, ninja invokes commands via CreateProcess (which results in cmd-style quoting processed by parse_cmdline or CommandLineToArgvW), but gcc will use sh-style quoting in any response file it reads. Future work: The rspfile quoting style should be a method of the compiler or linker object, rather than hardcoded in ninjabackend. (In fact, can_linker_accept_rsp() should be extended to do this, since if we can accept rsp, we should know the quoting style)
2020-06-05ninja: Push ninja and shell quoting down into NinjaRuleJon Turney1-50/+91
Rather than ad-hoc avoiding quoting where harmful, identify arguments which contain shell constructs and ninja variables, and don't apply quoting to those arguments. This is made more complex by some arguments which might contain ninja variables anywhere, not just at start, e.g. '/Fo$out' (This implementation would fall down if there was an argument which contained both a literal $ or shell metacharacter and a ninja variable, but there are no instances of such a thing and it seems unlikely) $DEPFILE needs special treatment. It's used in the special variable depfile, so it's value can't be shell quoted (as it used as a filename to read by ninja). So instead that variable needs to be shell quoted when it appears in a command. (Test common/129, which uses a depfile with a space in it's name, exercises that) If 'targetdep' is not in raw_names, test cases/rust all fail.
2020-06-05ninja: Refcount rsp and non-rsp rule usage separatelyJon Turney1-10/+26
We need to count rsp and non-rsp references separately, which we need to do after build statement variables have been set so we can tell the difference, which introduces a bit of complexity.
2020-06-05ninja: Expose response file rules in compdbJon Turney1-2/+6
Possibly this should now be done by marking rules as being wanted in compdb, rather than listing the rule names...
2020-06-05ninja: Only use response files when neededJon Turney1-20/+72
Writing rsp files on Windows is moderately expensive, so only use them when the command line is long enough to need them. This also makes the output of 'ninja -v' useful more often (something like 'cl @exec@exe/main.c.obj.rsp' is not very useful if you don't have the response file to look at) For a rule where using a rspfile is possible, write rspfile and non-rspfile versions of that rule. Choose which one to use for each build statement, depending on the anticpated length of the command line.
2020-06-05ninja: Rename 'rule' -> 'rulename' in NinjaBuildElementJon Turney1-6/+6
Rename 'rule' to 'rulename' in the NinjaBuildElement class, we're going to want a reference to the NinjaRule object as well.
2020-06-05cmake: Add more advanced subproject configuration optionsDaniel Mensinger5-20/+223
This is done with the new cmake subprojects options object that is similar to the already exisiting configuration data object. It is consumed by the new `options` kwarg of the cmake.subproject function.
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-05ninjabackend: cache calls to normpathsMarcel Hollerbach1-1/+5
calls to normpaths are expansive. We should cache the results. This safes 2s in the configure time of efl.
2020-06-04mesonlib.py: refactored detect_vcs() to use pathlib.Path (#7230)Joshua Gawley1-7/+11
2020-06-02Ignore file access errors when scanning .so files in system libdirsMike Gilbert1-9/+18
Bug: https://bugs.gentoo.org/726524
2020-06-02cmake: always split property lists (fixes #7228)Daniel Mensinger2-3/+4
2020-06-02dependencies/cuda: Add support for ARM linuxjonathanmist1-6/+10
2020-05-27Merge pull request #6818 from mensinda/localPatchJussi Pakkanen2-12/+28
Wrap: add local files support via *_filename
2020-05-27add type anno: compilers/clikeMichael Hirsch, Ph.D2-18/+18
2020-05-27ninja: Always use to_native on CompilerArgs (fixes #7167)Daniel Mensinger1-9/+4
2020-05-27Fix lack of space after 'Cflags:' in pkgconfig filesSoapux1-1/+1
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-26opts: Add FeatureNew for '-' and 'not' introduced in 0.54.1Daniel Mensinger1-0/+2
2020-05-26opts: Allow string concatenation (fixes #7199)Daniel Mensinger1-0/+7
2020-05-26mcompile: removed unneeded importsTheQwertiest1-2/+0
2020-05-26mcompile: detect_ninjaTheQwertiest1-8/+3
2020-05-26mcompile: replaced intro with cdata + extracted code to funcsTheQwertiest1-60/+63
2020-05-26mcompile: replaced backend divination code + cleanupTheQwertiest1-11/+24
2020-05-26Use --internal script call to call delwithsuffix when cleaning up the gcno ↵georgev931-6/+2
and gcda files in a coverage enabled build. Otherwise, meson will crash when running from an MSI installation.
2020-05-24fix cmake target configuration selection.Alexander Neumann2-5/+19
2020-05-23ast: Handle NotNodeDaniel Mensinger1-0/+5
2020-05-23ast: Add AST JSON printerDaniel Mensinger5-12/+174
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-22Merge pull request #7123 from dcbaker/use-feature-deprecatedJussi Pakkanen7-54/+67
Use FeatureDeprecated (and other cleanups)
2020-05-22boost: Try extracting BOOST_ROOT from boost.pcDaniel Mensinger1-1/+12
This is especially useful for Conan, where only the boost.pc file is provided and manually setting BOOST_ROOT is not a good solution since it is in a private cache directory. See #5438