aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
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 Claessens1-9/+18
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() methodNomura1-5/+8
2023-09-09Add macro_name option to configure_fileNicholas Vinson3-6/+18
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 Liu1-3/+5
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 Chauhan2-1/+7
2023-09-07Fix include_directories test for relative pathCharles Brunet1-3/+3
- 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 Beguin2-13/+0
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-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 Claessens2-6/+8
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 Claessens1-1/+1
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 Scholz2-9/+40
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-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 Brunet1-2/+5
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 Claessens1-2/+12
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-01compilers: fix compiler detection when the "ccache" string is in the pathFilipe Laíns1-1/+1
Signed-off-by: Filipe Laíns <lains@riseup.net>
2023-08-31add json output format to configure fileCharles Brunet3-23/+33
2023-08-30Merge pull request #10332 from xclaesse/std-optJussi Pakkanen6-111/+168
c_std, cpp_std: Change to a list of desired versions in preference order
2023-08-29gnome: Fix crash in gtkdoc and generate_gir in C++ projectsXavier Claessens2-0/+8
gtkdoc() and generate_gir() methods assumes there is a C compiler, but pure C++ projects might not add it explicitly. Fixes: #12162
2023-08-28include_directories: Always add both source and build dirsXavier Claessens3-5/+4
Compiler checks were not adding build dir side, which prevents using headers generated with configure_file().
2023-08-25msetup: Update options when builddir is already configuredXavier Claessens2-22/+21
`meson setup -Dfoo=bar builddir` command was returning success ignoring new option values. This now also update options. It is useful because it means `meson setup -Dfoo=bar builddir && ninja -C builddir` works regardless whether builddir already exists or not, and when done in a script, changing options in the script will automatically trigger a reconfigure if needed. This was already possible by always passing --reconfigure argument, but that triggers a reconfigure even when options did not change.
2023-08-24minstall: move the "Installing foo to bar" message upPeter Hutterer1-6/+8
Move this message up before we attempt to change anything in the file system (in this case creating the directory structure). If an error occurs it will thus occur immediately after the message, allowing us to debug what failed to install.
2023-08-24Suggest using --reconfigure only when not already using itXavier Claessens3-15/+15
2023-08-24find_program: Fallback if version mismatchXavier Claessens2-29/+44
Fixes: #11797
2023-08-24build: Simplify import_filename handlingXavier Claessens1-39/+17
This removes deadcode, vs_import_filename and gcc_import_filename were not needed.
2023-08-23Use `cudart_static` by default in dependency('cuda')David Seifert1-1/+3
* Without this, using nvcc as the sole driver vs dependency('cuda') and host compiler driver yields differently linked binaries.
2023-08-23Fix completely broken support for `static: true` with dependency('cuda')David Seifert1-2/+10
2023-08-23machine file: Add @GLOBAL_SOURCE_ROOT@ and @DIRNAME@Xavier Claessens2-10/+15
2023-08-22compilers: fix checks handling of internal dependenciesBenoit Pierre1-0/+4
The include directories were not passed to the compiler.
2023-08-18consistently use Literal annotation from typing_extensionsEli Schwartz2-2/+4
This is our standard annotation policy, and makes mypy safe under python 3.7
2023-08-18ninja backend: fix the automatic restat of outputs when reconfiguringEli Schwartz1-3/+3
The most notable problem this causes is that when running `meson setup --reconfigure` the build.ninja file is erroneously seen as out of date, so ninja immediately tries to regenerate it again as it didn't see the file get updated. There are two problems. The first problem is that we looked for the wrong file. Ninja creates a few internal files, and one of them is the one we care about: `.ninja_log`, which contains stat'ed timestamps for build outputs to aid in checking when things are out of date. But the thing we actually checked for is `.ninja_deps`, a file that contains a compressed database of depfile outputs. If the latter exists, then the former surely exists too. Checking for the wrong file meant that we would restat outputs, but only when some build edges were previously built that had depfile outputs. The second problem is that we checked for this in os.getcwd() instead of the configured build directory. This very easily fails to be correct, except when reconfigure is triggered directly by ninja itself, in which case we didn't need the restat to begin with.
2023-08-18Revert "Revert "Add fs.relative_to()""Tristan Partin1-7/+22
This reverts commit 84c8905d527893bedc673e8a036b8b2ec89368b4. Fixed the cygwin failure...
2023-08-18Suggest fix in MesonVersionMismatchExceptionM Henning1-1/+2
Every time I update meson, I spend about 20 minutes on frustrated googling to figure out how to update my build directory to work with the new version. I'm forgetful, okay? Ease this pain point by suggesting a potential fix in the error message.
2023-08-18Add more descriptive description to CustomTargetCharles Brunet9-2/+24
Allow modules using CustomTarget to modify the command description used by ninja backend. This result in more precise logs when building a project.
2023-08-17Revert "Add fs.relative_to()"Eli Schwartz1-22/+7
This reverts commit f52bcaa27fc125ab9ae583af466ba99c164169f3. It did not pass CI, and was merged anyway because there were two CI errors in the same cygwin job. The other error was not the fault of this commit, and since cygwin errors were glossed over because they were "expected", the presence of a new error *added* by this commit was overlooked. Per the meson development policy, PRs which result in CI errors can/should be reverted at will, no questions asked.