aboutsummaryrefslogtreecommitdiff
path: root/test cases
AgeCommit message (Collapse)AuthorFilesLines
2023-09-25rust: apply global, project, and environment C args to bindgenDylan Baker5-1/+51
This means that arguments set via `add_global_arguments`, `add_project_arguments` and by either the `-Dc_args` or `CFLAGS` are applied to bindgen as well. This can be important when, among other things, #defines are set via these mechanisms. Fixes: #12065
2023-09-22Allow to fallback to cmake subprojectXavier Claessens14-0/+115
The method can be overridden by setting the `method` key in the wrap file and always defaults to 'meson'. cmake.subproject() is still needed in case specific cmake options need to be passed. This also makes it easier to extend to other methods in the future e.g. cargo.
2023-09-19Rust: Prevent linking Rust ABI with C library/executableXavier Claessens1-2/+3
2023-09-19Rust: Remove unit test already covered in "rust/4 polyglot"Xavier Claessens6-28/+0
2023-09-19Rust: Replace rust_crate_type with rust_abiXavier Claessens4-11/+143
Meson already knows if it's a shared or static library, user only need to specify the ABI (Rust or C).
2023-09-19Rust: Add a rust.proc_macro() methodDylan Baker1-0/+13
2023-09-18Remove get_configtool_variable()Xavier Claessens1-1/+0
This also makes it more consistent with get_pkgconfig_variable() which always return empty value instead of failing when the variable does not exist. Linking that to self.required makes no sense and was never documented any way.
2023-09-18Remove get_pkgconfig_variable()Xavier Claessens1-0/+1
Make sure that pkgconfig_define is a pair of strings and not a list with more than 2 strings.
2023-09-13install_{data,headers,subdir}: implement follow_symlinksArsen Arsenović5-0/+55
This permits users who rely on following symlinks to stay on the old default of following them.
2023-09-13Fix assertion raised with invalid option nameCharles Brunet1-0/+8
When option name contains more that one dot, it should be detected earlier to prevent an assert to be raised. Fixes #11904.
2023-09-12Merge pull request #12152 from bruchar1/ast-preserve-allJussi Pakkanen1-0/+189
Preserve whitespaces and comments in AST
2023-09-12fix bug with openssl when cmake is missingCharles Brunet2-0/+12
Fixes #12098 DependencyFactory was returning a lambda, but it has no log_tried() function
2023-09-11parser: allow whitespaces and comments in cont_eolCharles Brunet1-6/+6
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 Brunet1-0/+189
this printer preserves all whitespaces and comments in original meson.build file. It will be useful for rewrite and potential auto-formatter
2023-09-09gnome.mkenum_simple(): Fix include path when header is in subdirXavier Claessens4-0/+22
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-0/+9
2023-09-09Add macro_name option to configure_fileNicholas Vinson2-0/+32
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-08Override config-tool get_variable args for qmakeNirbheek Chauhan1-0/+3
2023-09-07Fix include_directories test for relative pathCharles Brunet2-0/+29
- 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-07Fix crash when installing a vala library and python sourcesXavier Claessens3-1/+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-0/+4
Fixes: #12202
2023-09-07Add compiler.has_defineMarvin Scholz1-40/+49
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-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-06qt module: add include_directories to moc compileCharles Brunet4-3/+15
Fixes #12182
2023-09-05wrap: Use MESON_PACKAGE_CACHE_DIR as default packagecache pathXavier Claessens5-0/+13
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-08-31add json output format to configure fileCharles Brunet5-0/+82
2023-08-30Re-enable "11 runpath rpath ldlibrarypath"Tristan Partin2-3/+1
The bug it was blocked on was fixed in a0514a7c4183a9e42d436865087d2f887d658d54.
2023-08-30Disable failing test on cygwin due to broken cmakeCharles Brunet1-1/+8
See https://gitlab.kitware.com/cmake/cmake/-/issues/25200.
2023-08-30ci: Skip gir test on cygwinXavier Claessens2-1/+7
2023-08-30Merge pull request #10332 from xclaesse/std-optJussi Pakkanen1-0/+6
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 Claessens9-0/+77
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 Claessens2-0/+13
Compiler checks were not adding build dir side, which prevents using headers generated with configure_file().
2023-08-24find_program: Fallback if version mismatchXavier Claessens5-0/+21
Fixes: #11797
2023-08-22compilers: fix checks handling of internal dependenciesBenoit Pierre2-0/+8
The include directories were not passed to the compiler.
2023-08-18Revert "Revert "Add fs.relative_to()""Tristan Partin3-1/+59
This reverts commit 84c8905d527893bedc673e8a036b8b2ec89368b4. Fixed the cygwin failure...
2023-08-17Revert "Add fs.relative_to()"Eli Schwartz3-63/+1
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.
2023-08-17skip test on pkgconf 2.0.1 that is broken there due to a reported bugEli Schwartz1-0/+4
2023-08-17Remove hacky setup for CustomTargetIndex tests in fs.relative_to()Tristan Partin1-21/+5
2023-08-17Remove XML filter from testlog.{json,txt} and std streamsTristan Partin1-1/+1
This was an unintended consequence of the original patch in #11977. Co-authored-by: Benoit Pierre <benoit.pierre@gmail.com>
2023-08-17Add fs.relative_to()Tristan Partin3-1/+79
Returns a relative path from arg 2 to arg 1 similar to os.path.relpath().
2023-08-16fs.read(): Catch FileNotFoundErrorXavier Claessens1-0/+4
2023-08-14Python: Add 'limited_api' kwarg to extension_moduleAndrew McNulty6-0/+129
This commit adds a new keyword arg to extension_module() that enables a user to target the Python Limited API, declaring the version of the limited API that they wish to target. Two new unittests have been added to test this functionality.
2023-08-08tests: fix "4 custom target depends extmodule" with Python 3.8+ on WindowsChristoph Reiter2-0/+6
Since CPython 3.8 .pyd files no longer look in PATH for loading libraries, but require the DLL directory to be explicitely added via os.add_dll_directory(). This resulted in those tests failing with 3.8+ on Windows. Add the DLL build directory with os.add_dll_directory() to fix them. This was never noticed in CI because it only uses Python 3.7 and the MSYS2 CPython still used the old behaviour until now.
2023-08-07Error when an installed static library links to internal custom targetXavier Claessens2-1/+52
When an installed static library A links to an internal static library B built using a custom_target(), raise an error instead of a warning. This is because to be usable, A needs to contain B which would require to extract the archive to get its objects files. This used to work, but was printing a warning and was installing a broken static library, because we used to overlink in many cases, and that got fixed in Meson 1.2.0. It now fails at link time with symbols from the custom target not being defined. It's better to turn the warning into a hard error at configure time. While at it, noticed this situation can happen for any internal custom or rust target we link to, recursively. get_internal_static_libraries_recurse() could be called on CustomTarget objects which do not implement it, and even if we did not call that method, it would still fail when trying to call extract_all_objects() on it. Fixes: #12006
2023-08-07c_std, cpp_std: Change to a list of desired versions in preference orderXavier Claessens1-0/+6
Projects that prefer GNU C but can fallback to ISO C can now set for example `default_options: 'c_std=gnu11,c11'` and it will use gnu11 when available, fallback to c11 otherwise. It is an error only if none of the values are supported by the current compiler. This allows to deprecate gnuXX values from MSVC compiler, that means that `default_options: 'c_std=gnu11'` will now print warning with MSVC but still fallback to 'c11' value. No warning is printed if at least one of the values is valid, i.e. `default_options: 'c_std=gnu11,c11'`. In the future that deprecation warning will become an hard error because `c_std=gnu11` should mean GNU is required, for projects that cannot be built with MSVC for example.
2023-08-07Compiler: Add werror kwarg to compiles(), links() and run() methodsXavier Claessens1-0/+23
Fixes: #5399
2023-08-05compiler: Add required keyword to has_* methodsXavier Claessens2-0/+68
add the "required" keyword to the functions has_function has_type has_member has_members has_argument has_multi_arguments has_link_argument has_multi_link_argument has_function_attribute Co-authored-by: Milan Hauth <milahu@gmail.com>
2023-08-04Add default_options argument to find_program()Nomura5-0/+20
2023-08-02Unify message(), format() and fstring formattingXavier Claessens3-0/+49
Share a common function to convert objects to display strings for consistency. While at it, also add support for formatting user options.
2023-08-02treewide: internally avoid deprecated machine file uses of "pkgconfig"Eli Schwartz3-3/+3
We support this in a machine file: ``` [binaries] pkgconfig = 'pkg-config' pkg-config = 'pkg-config' ``` and you can use either one, because internally we look up both. If you only set *one* of them, this plays awkwardly with setting $PKG_CONFIG, since we don't know which one you set in the machine file and the *other* one will be initialized from the environment instead. In commit 22df45a31981874310a78dde0df59a6a7c5ebb29 we changed program lookup of config-tool style dependencies to use the regular tool names and only fall back on the strange internal names. This affected the pkg-config class too. The result is that instead of preferring `pkgconfig =` followed by $PKG_CONFIG followed by `pkg-config =`, we inverted the lookup order. This is a good idea anyway, because now it behaves consistently with `find_program('pkg-config')`. Unfortunately, we documented the wrong name in a bunch of places, and also used the wrong name in various testsuite bits, which meant that if you set $PKG_CONFIG and then ran the testsuite, it would fail. Correct these references, because they are buggy. One test case expected to find_program() a native copy for convenience of testing against natively installed glib. Force it to resolve a native copy.