Commit Graph

14075 Commits

Author SHA1 Message Date
Nomura 2b4002e60f
Metrowerks assembler should not inherit opt args from mixin
The Metrowerks assembler does not support optimization flags.
However, it received the same opt args as the Metrowerks C and C++
compilers, because it inherits from the 'MetrowerksCompiler' mixin.
This broke builds with opt level higher than 0 that used the Metrowerks
Assembler, as the latter received unsupported args. This is now fixed.
2023-09-18 02:11:06 -04:00
Nomura 319b1505e8
Metrowerks: set optlevel 3 to max optimization args
According to the Meson documentation, optimization level 3 should
set the highest possible optimization for the compiler in use.
In Metrowerks, this is 'O4,p'. However, Meson's Metrowerks
implementation mapped opt level 3 to '-O3'. This has been fixed.
2023-09-18 02:11:01 -04:00
Nomura e7ed45396d
Metrowerks: remove duplicate optimization args
The args were in both buildtype and optimization. This broke buildtypes other
than plain or custom unless manually setting the optimization level to
0, because Metrowerks chokes on duplicate arguments.
2023-09-18 02:10:59 -04:00
Albert Tang 665275a785
xcode: Check for apple framework deps by name
If `dependencies.platform.AppleFrameworks` has not been imported by
this time, Meson crashes. Better to check by name instead.
2023-09-18 02:03:20 -04:00
L. E. Segovia ca60f71b2e reference tables: Document how to set compiler paths with spaces in environment variables
See #11128
2023-09-15 07:31:37 -04:00
L. E. Segovia 878d950887 environment, env2mfile: Don't shell split paths if they point to a valid executable
Fixes #11128
2023-09-15 07:31:37 -04:00
Christoph Reiter 1306d15616 Revert "tests: skip a test that fails with new Python 3.11 from MSYS2"
This reverts commit 68dce66bf9.

The upstream issues https://github.com/msys2-contrib/cpython-mingw/issues/141
has been fixed now.
2023-09-14 11:47:22 -04:00
Xavier Claessens 718c86a7d5 Wrap: Use git instead of patch by default
This solves problems with Strawberry Perl providing patch.exe on Windows
with an unconsistent line ending support.

Fixes: #12092
2023-09-14 06:58:23 -04:00
Nomura 22da2c3c2d
Use @DIRNAME@ in Metrowerks cross files to point to linker script 2023-09-13 22:10:59 -04:00
Arsen Arsenović 0af126fec7 install_{data,headers,subdir}: implement follow_symlinks
This permits users who rely on following symlinks to stay on the old
default of following them.
2023-09-13 21:44:40 -04:00
Arsen Arsenović 56ef698426 run_project_tests: support checking for symlinks 2023-09-13 21:44:40 -04:00
Charles Brunet ef5931f12d fix undefined StringNode from previous commit 2023-09-13 16:56:42 +05:30
Charles Brunet 923b95f3d1 Fix assertion raised with invalid option name
When option name contains more that one dot, it should be detected
earlier to prevent an assert to be raised.

Fixes #11904.
2023-09-13 16:55:38 +05:30
Charles Brunet 8caf40e5ae Allow unit test to parse testcase blocks
When a unittest introspect a meson.build file from a test case,
the file may contain a testcase block. We should ignore this block.
2023-09-13 16:55:38 +05:30
Jussi Pakkanen d2dfef5205
Merge pull request #12152 from bruchar1/ast-preserve-all
Preserve whitespaces and comments in AST
2023-09-12 17:50:13 +03:00
Xavier Claessens 1b6c9ad02a msubprojects: Speedup subproject_dir extraction
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-12 17:32:17 +05:30
Charles Brunet 57178e8ae7 fix bug with openssl when cmake is missing
Fixes #12098

DependencyFactory was returning a lambda, but it has no log_tried() function
2023-09-12 17:31:32 +05:30
Charles Brunet 14e35b63c0 parser: allow whitespaces and comments in cont_eol
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-11 07:51:19 -04:00
Charles Brunet d3a26d158e raw printer
this printer preserves all whitespaces and comments in original meson.build file. It will be useful for rewrite and potential auto-formatter
2023-09-11 07:51:19 -04:00
Charles Brunet 6a18ae48b3 ast: fully resolve nodes for add operation
Otherwise, string + stringmethod results in a list of two strings instead of the concatenation of the strings
2023-09-11 07:51:19 -04:00
Charles Brunet 11ef2a536c parser: preserve whitespaces and comments 2023-09-11 07:51:19 -04:00
Charles Brunet 5b29eff8ad parser: simplify other node constructors 2023-09-11 07:51:18 -04:00
Charles Brunet 13ddf8bd02 parser: simplify by using Unary and Binary Operator Node 2023-09-11 07:51:18 -04:00
Charles Brunet 0f4891cdf4 parser: simplify Assignment and PlusAssignment nodes 2023-09-11 07:51:18 -04:00
Charles Brunet 02ff9553db parser: add SymbolNode to preserve operators 2023-09-11 07:51:18 -04:00
Charles Brunet f13260dd43 parser: add ElseNode 2023-09-11 07:51:18 -04:00
Charles Brunet 4b7a56caa2 parser: remember previous Token 2023-09-11 07:51:18 -04:00
Charles Brunet b94167ef50 parser: preserve value of all tokens 2023-09-11 07:51:18 -04:00
Charles Brunet 8d357ba62c parser: use IdNode for foreach varnames 2023-09-11 07:51:18 -04:00
Charles Brunet 306562b466 parser: use IdNode for function name and assignment name 2023-09-11 07:51:18 -04:00
Charles Brunet 35936283d2 parser: preserve escape chars in strings
use separate Node for multiline strings
2023-09-11 07:51:18 -04:00
Charles Brunet a730a2fe21 parser: remove useless __str__ methods on nodes 2023-09-11 07:51:17 -04:00
Charles Brunet 5707d39017 parser: preserve number base 2023-09-11 07:51:17 -04:00
Charles Brunet 3ff3b8abf6 parser: more specific error for float numbers 2023-09-11 07:51:17 -04:00
JCWasmx86 79ed2415e9 Add ParenthesizedNode 2023-09-11 07:51:17 -04:00
Dan Hawson bd3341f808 Recognise more include search path opts when populating '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-10 20:37:59 +03:00
Xavier Claessens 10708676ad gnome.mkenum_simple(): Fix include path when header is in subdir
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-09 21:28:22 -04:00
Nomura 5f46ea116c Add support for padding zeroes in int.to_string() method 2023-09-09 19:03:22 -04:00
Nicholas Vinson b51bce070e Add macro_name option to configure_file
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-09 07:30:56 -04:00
Moody Liu 3c47216fe9 clike compilers: fix cross_* functions' include
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-09 07:25:27 -04:00
Eli Schwartz 306efbd5b7 dependencies: fix crash in Qt if private_headers dir not found
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-08 11:27:15 -04:00
Nirbheek Chauhan 6cfd2b4d5b Override config-tool get_variable args for qmake 2023-09-08 13:08:05 +05:30
Charles Brunet 204fe3c577 Fix include_directories test for relative path
- 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-07 23:38:33 -04:00
Liam Beguin 983562c66e
syntax-highlighting: vim: update builtin function list
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-07 19:14:03 -04:00
Liam Beguin ba1ba1f5b0
docs: refman: add vim syntax file generator
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
2023-09-07 19:14:03 -04:00
Xavier Claessens c663476075 gnome: Fix glib tool lookup consistency
It was not always using the pkg-config file.
2023-09-07 18:16:59 -04:00
Xavier Claessens b2654b2d43 Fix crash when installing a vala library and python sources
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-07 10:56:37 -04:00
Xavier Claessens 025aea1dab Compiler checks must use per-subproject options
Fixes: #12202
2023-09-07 06:55:07 -04:00
Xavier Claessens d5f17bc9ff Rename OptionOverrideProxy to OptionsView and move to coredata
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-07 06:55:07 -04:00
Marvin Scholz 3fc16f05b5 Add compiler.has_define
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-07 00:45:38 +03:00