This fix the following common pattern, we don't want to implicitly
fallback on the first line:
foo_dep = dependency('foo', required: false)
if not foo_dep.found()
foo_dep = cc.find_library('foo', required : false)
if not foo_dep.found()
foo_dep = dependency('foo', fallback: 'foo')
endif
endif
The value for that key must be a coma separated list of dependecy names
provided by that subproject, when no variable name is needed because the
subproject uses override_dependency().
Machine files already supports `+` operator as an implementation detail,
since it's using eval(). Now make it an officially supported feature and
add a way to define constants that are used while evaluating an entry
value.
This lets servers know when they're being used by meson. It also avoids
issues where the Independent JPEG Group decided to ban the
"Python-urllib" default user agent.
Fixes https://github.com/mesonbuild/libjpeg/issues/9
If object is not built pic, trying to link it into libshr.so fails:
[6/8] Linking target libshr.so.
FAILED: libshr.so
gcc -o libshr.so 'shr@sha/source2.o' -Wl,--no-undefined -Wl,--as-needed -shared -fPIC -Wl,--start-group -Wl,-soname,libshr.so -Wl,--end-group
Text relocation remains referenced
against symbol offset in file
.text (section) 0x20 shr@sha/source2.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Since mesonbuild/environment.py doesn't recognize Studio compilers,
force use of gcc on Solaris for now.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Solaris linker added support for GNU-style --version-script in Solaris 11.4,
but requires adding the -z gnu-version-script-compat flag to enable it.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Accept Solaris linker in addition to GNU linker. Previously using the
system provided gcc (which calls the Solaris linker) caused it to fail with:
======================================================================
FAIL: test_compiler_detection (__main__.AllPlatformTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "run_unittests.py", line 2525, in test_compiler_detection
self.assertIsInstance(cc.linker, mesonbuild.linkers.GnuLikeDynamicLinkerMixin)
AssertionError: <SolarisDynamicLinker: v9.2.0 `gcc`> is not an instance of <class 'mesonbuild.linkers.GnuLikeDynamicLinkerMixin'>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Since the CompileArgs class already needs to know about the compiler,
and we really need at least per-lanaguage if not per-compiler
CompilerArgs classes, let's get the CompilerArgs instance from the
compiler using a method.