aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-09-12Merge pull request #12152 from bruchar1/ast-preserve-allJussi Pakkanen18-272/+920
Preserve whitespaces and comments in AST
2023-09-12msubprojects: Speedup subproject_dir extractionXavier Claessens2-5/+22
The interpreter takes significant amount of time to initialize everything in project() function. We only need to extract a string from AST, just like we do in handle_meson_version_from_ast().
2023-09-12fix bug with openssl when cmake is missingCharles Brunet5-4/+39
Fixes #12098 DependencyFactory was returning a lambda, but it has no log_tried() function
2023-09-11parser: allow whitespaces and comments in cont_eolCharles Brunet2-7/+7
FIXME: another approach would be to consider cont_eol as comment (i.e. add backslash and whitespaces to the comment regex). In both cases it works until we want to parse comments separately. TODO?: handle eol_cont inside a string (to split long string without breaking lines). Probably a bad idea and better to simply join a multiline string.
2023-09-11raw printerCharles Brunet5-1/+432
this printer preserves all whitespaces and comments in original meson.build file. It will be useful for rewrite and potential auto-formatter
2023-09-11ast: fully resolve nodes for add operationCharles Brunet1-2/+2
Otherwise, string + stringmethod results in a list of two strings instead of the concatenation of the strings
2023-09-11parser: preserve whitespaces and commentsCharles Brunet1-7/+60
2023-09-11parser: simplify other node constructorsCharles Brunet4-31/+26
2023-09-11parser: simplify by using Unary and Binary Operator NodeCharles Brunet1-42/+17
2023-09-11parser: simplify Assignment and PlusAssignment nodesCharles Brunet5-27/+12
2023-09-11parser: add SymbolNode to preserve operatorsCharles Brunet5-86/+239
2023-09-11parser: add ElseNodeCharles Brunet4-6/+19
2023-09-11parser: remember previous TokenCharles Brunet1-13/+10
2023-09-11parser: preserve value of all tokensCharles Brunet1-16/+10
2023-09-11parser: use IdNode for foreach varnamesCharles Brunet4-8/+10
2023-09-11parser: use IdNode for function name and assignment nameCharles Brunet12-56/+57
2023-09-11parser: preserve escape chars in stringsCharles Brunet13-49/+74
use separate Node for multiline strings
2023-09-11parser: remove useless __str__ methods on nodesCharles Brunet1-8/+4
2023-09-11parser: preserve number baseCharles Brunet3-4/+12
2023-09-11parser: more specific error for float numbersCharles Brunet1-0/+3
2023-09-11Add ParenthesizedNodeJCWasmx864-1/+18
2023-09-10Recognise more include search path opts when populating ↵Dan Hawson1-40/+33
'NMakeIncludeSearchPath' to help intellisense Added to existing '/I' and '-I' extraction with '-isystem', '/clang:-isystem', '/imsvc', '/external:I', which are forms of 'system' header include search path options for gcc, clang, clang-cl, and cl (msvc). Factored 3 separate 'extract_...(...)' functions into one since they were always called together on the same args; a new combined '_extract_nmake_fields(...)' func avoids repeated iterations and checks.
2023-09-09gnome.mkenum_simple(): Fix include path when header is in subdirXavier Claessens6-9/+47
It was generating #include with the basename of every header file. That assumes that every directory where there are headers are also included into search path when compiling the .c file. Change to use path relative to current subdir, which can be both in build or source directory. That means that we assume that when the .c file is compiled, the target has a include_directories pointing to the directory where gnome.mkenum_simple() has been called, which is generally '.' and added automatically. Also fix type annotation to only allow str and File sources, other types have never been working, it would require to iterate over custom target outputs, etc. Fixes: #7582
2023-09-09Add support for padding zeroes in int.to_string() methodNomura4-5/+49
2023-09-09Add macro_name option to configure_fileNicholas Vinson7-6/+63
Allow macro_name to be speficied as a parameter to configure_file(). This allows C macro-style include guards to be added to configure_file()'s output when a template file is not given. This change simplifies the creation of configure files that define macros with dynamic names and want the C-style include guards.
2023-09-09clike compilers: fix cross_* functions' includeMoody Liu3-5/+31
A standard C library may not exist for cross-compile environments, thus the existence of <stdio.h> cannot be guaranteed. Use <stddef.h> instead, this header contains compiler-specific defines thus it usually comes from the compiler.
2023-09-08dependencies: fix crash in Qt if private_headers dir not foundEli Schwartz1-1/+1
You cannot listdir() a directory that doesn't exist. This header directory may not exist if suitable devel packages in distros with split devel packages, aren't installed. In theory we could raise a suitable error here. But it would be inconsistent -- we don't otherwise validate that the Qt include directories exist, usually just assuming they do because the dependency was found. And this is niche code inside a non-default special kwarg. At least for pkg-config, it's probably a bug in the distro if pkg-config files exist but the headers don't. The qmake status is less clear. Avoiding a crash means that at the very least, if those headers are in fact directly used by the project, an obvious compiler error occurs instead of a noisy meson traceback. Fixes #12214
2023-09-08Override config-tool get_variable args for qmakeNirbheek Chauhan3-1/+10
2023-09-07Fix include_directories test for relative pathCharles Brunet4-3/+34
- On Windows, it was not detected if include directory was an absolute path to source directory, because of the mis of path separators. - In the edgecase the include directory begins with the exact same string as the source directory, but is a different directory, it was falsely reported as an error. Fixes #12217.
2023-09-07syntax-highlighting: vim: update builtin function listLiam Beguin3-24/+9
Update builtin function list using the refman python docs/genrefman.py \ -g vim \ -o data/syntax-highlighting/vim/syntax/ This also drops gettext() and find_library() from the list of builtin functions that have been deprecated since 2016. Changes are squashed here because test_vim_syntax_highlighting() would validate the file against the list of builtin functions that no longer matches the yaml documentation. Signed-off-by: Liam Beguin <liambeguin@gmail.com>
2023-09-07docs: refman: add vim syntax file generatorLiam Beguin3-1/+143
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
2023-09-07gnome: Fix glib tool lookup consistencyXavier Claessens1-13/+31
It was not always using the pkg-config file.
2023-09-07Fix crash when installing a vala library and python sourcesXavier Claessens7-8/+21
Installing python sources causes the python module to call create_install_data() before Ninja backends adds extra outputs to Vala targets. Target objects are supposed to be immutable, adding outputs that late is totally wrong. Add extra vala outputs immediately, but be careful because the main output is only added later in post_init(). Luckily the base class already puts a placeholder item in self.outputs for the main filename so we can just replace self.outputs[0] instead of replacing the whole list which would contain vala outputs at that stage. This is surprisingly what SharedLibrary was already doing.
2023-09-07Compiler checks must use per-subproject optionsXavier Claessens2-1/+5
Fixes: #12202
2023-09-07Rename OptionOverrideProxy to OptionsView and move to coredataXavier Claessens4-58/+48
Coredata is where all option handling is done so it makes sense there. It is a view on a list of options for a given subproject and with optional overrides. This change prepare for using that view in a more generic way in the future.
2023-09-07Add compiler.has_defineMarvin Scholz5-49/+110
Adds a new method to the compiler object, has_define. This makes it possible to check if a preprocessor macro/define is set or not. This is especially helpful if the define in question is empty, for example: #define MESON_EMPTY_DEFINE This would yield the same results as a missing define with the existing get_define method, as it would return an empty string for both cases. Therefore this additional method is needed.
2023-09-06Merge pull request #11422 from lukester1975/bash-completionJussi Pakkanen1-99/+269
Bash completion additions and fixes (fixes #9077)
2023-09-06completions: bash: don't show json errors when completing "meson test".Luke Elliott1-7/+24
E.g. "meson test<tab>" json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2023-09-06completions: bash: added "compile" (and "help") completion.Luke Elliott1-2/+63
2023-09-06completions: bash: fix -x<tab>.Luke Elliott1-48/+45
If x was a known short option, would complete to "-". If unknown, "--".
2023-09-06completions: bash: added a bunch of missing completion options.Luke Elliott1-42/+137
2023-09-06tests: Test extern'd globals on MacOS with the Apple ArchiverAilin Nemui5-0/+31
This forces the use of the Apple archiver, since that archiver doesn't add extern'd variables to the symbol table automatically, and instead requires that ranlib be used. A native file is used to ensure that Apple's ar is used even in the presence of llvm or gcc in the path with their superior archivers. Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2023-09-06backends/ninja: run `ranlib -c $out` when using the apple arDylan Baker2-1/+16
Apple's AR is old, and doesn't add externed symbols to the symbol table, instead relying on the user calling ranlib with -c. We need to do that for the user
2023-09-06qt module: add include_directories to moc compileCharles Brunet5-5/+20
Fixes #12182
2023-09-06qt module: fix substitution for depfile in mocCharles Brunet1-1/+1
2023-09-05wrap: Use MESON_PACKAGE_CACHE_DIR as default packagecache pathXavier Claessens9-2/+48
Allow packagecache to contain already extracted directory to match what some distro does with Cargo source packages in /usr/share/cargo/registry. Note that there is no need to lock the cache directory because we download into a temporary name and atomically rename afterward. It means we could be downloading the same file twice, but at least integrity is guaranteed. Fixes: #12211
2023-09-05wrap: Remove duplicated codeXavier Claessens1-12/+6
2023-09-04Adding Meson-UI back on IDE-integration.mdMichael Gene Brockus (Dreamer)1-0/+1
2023-09-04Add trilo xtest to usersMichael Gene Brockus (Dreamer)1-0/+1
2023-09-01tests: repeat the failure reason in the detailed logsEli Schwartz1-0/+3