Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
4540474
ci: Skip test_generate_gir_with_address_sanitizer
xclaesse Jul 18, 2023
ccea7af
tests: mark gpgme test skippable on Ubuntu rolling
eli-schwartz May 8, 2023
0f6d630
tests: bump the C++ std for protobuf tests
eli-schwartz Jul 18, 2023
3270855
mtest: avoid meddling with stdout by default
eli-schwartz Jul 18, 2023
46bc59f
CI: change ubuntu cross exe_wrapper to un-suffixed wine
eli-schwartz Jul 18, 2023
57d0b7e
do better sanity check for vs_module_defs input
eli-schwartz Jul 21, 2023
2bba476
fix lint errors revealed by pycodestyle 2.11
eli-schwartz Jul 31, 2023
e3a2af0
CI image builder: log commands a bit
eli-schwartz Jul 18, 2023
65ecc80
tests: skip a test that fails with new Python 3.11 from MSYS2
lazka Jul 28, 2023
f7b9f5b
Revert "CI: add potential workaround for python crashes in MSYS2"
lazka Jul 29, 2023
5a37895
modules/pkgconfig: Don't insert None into devenv list
dcbaker Jul 25, 2023
42723f1
packaging: fix regression that prevented pyinstaller from getting cus…
eli-schwartz Jul 25, 2023
97a3317
Upgrade MSI builder from WiX3 to WiX 4.
jpakkane Jul 31, 2023
fe25c99
treewide: internally avoid deprecated machine file uses of "pkgconfig"
eli-schwartz Aug 1, 2023
0163622
tests: Pass a mock C compiler to detect_cpu(), detect_cpu_family()
smcv Aug 5, 2023
fe59f71
environment: Assume that mips64 can run 32-bit mips binaries
smcv Aug 5, 2023
9030209
environment: Don't override mips64 to mips if no compilers are available
smcv Aug 5, 2023
37e6e4d
tests: Assert that mips64 kernel is detected as mips64 with no compilers
smcv Aug 5, 2023
2ad7fe5
build: remove BuildTarget.need_install
dcbaker Jul 21, 2023
7f73fc6
build: remove useless method call
dcbaker Jul 21, 2023
10ab9dc
interpreter: stop setting member out of initializer that isn't even used
dcbaker Jul 24, 2023
8f6fdb7
Error when an installed static library links to internal custom target
xclaesse Jul 19, 2023
a3d5ec0
machine file: Fix crash on empty value
xclaesse Aug 6, 2023
da78b96
Bump versions to 1.2.1 for release
nirbheek Aug 7, 2023
f4bd4c3
fs.read(): Catch FileNotFoundError
xclaesse Aug 16, 2023
cc08e36
README: Document python requirement history
xclaesse Aug 17, 2023
2be9342
Remove XML filter from testlog.{json,txt} and std streams
tristan957 Aug 14, 2023
0c5652b
tests: fix assertion rewriting when pytest is used
benoit-pierre Aug 14, 2023
453c6df
ninja backend: fix the automatic restat of outputs when reconfiguring
eli-schwartz Aug 15, 2023
05919c7
Fix completely broken support for `static: true` with dependency('cuda')
SoapGentoo Aug 22, 2023
d58ceeb
Use `cudart_static` by default in dependency('cuda')
SoapGentoo Aug 22, 2023
f34d227
Suggest fix in MesonVersionMismatchException
drawoc Aug 8, 2023
f381764
Suggest using --reconfigure only when not already using it
xclaesse Aug 23, 2023
698a0ca
gnome: Fix crash in gtkdoc and generate_gir in C++ projects
xclaesse Aug 27, 2023
2fe793a
Disable failing test on cygwin due to broken cmake
bruchar1 Aug 30, 2023
2c80162
compilers: fix compiler detection when the "ccache" string is in the …
FFY00 Sep 1, 2023
6dba828
tests: make run_project_tests finish off the verbose logs with a summary
eli-schwartz Aug 30, 2023
f054624
tests: make summary section for project tests more like pytest
eli-schwartz Aug 30, 2023
fa91413
tests: sync ninja stdout/stderr instead of listing them separately
eli-schwartz Aug 30, 2023
36e2069
tests: move the newline to the right place in ci includes
eli-schwartz Aug 30, 2023
10e67b2
tests: move a couple log files into collapsed github groups where pos…
eli-schwartz Aug 30, 2023
74766c8
tests: repeat the failure reason in the detailed logs
eli-schwartz Aug 31, 2023
167f524
qt module: fix substitution for depfile in moc
bruchar1 Sep 5, 2023
5ec9162
qt module: add include_directories to moc compile
bruchar1 Sep 5, 2023
6048775
backends/ninja: run `ranlib -c $out` when using the apple ar
dcbaker Jul 25, 2022
1209da6
tests: Test extern'd globals on MacOS with the Apple Archiver
Jul 25, 2022
197bf08
Fix crash when installing a vala library and python sources
xclaesse Sep 5, 2023
f0b2ab8
gnome: Fix glib tool lookup consistency
xclaesse Nov 3, 2022
5ac498e
dependencies: fix crash in Qt if private_headers dir not found
eli-schwartz Sep 4, 2023
de1ba4e
fix bug with openssl when cmake is missing
bruchar1 Sep 6, 2023
ca42c70
msubprojects: Speedup subproject_dir extraction
xclaesse Aug 31, 2023
c30df90
Allow unit test to parse testcase blocks
bruchar1 Sep 8, 2023
dd1535f
Fix assertion raised with invalid option name
bruchar1 Sep 7, 2023
d6d210c
rust: properly rematerialize static dependencies as well as dynamic ones
dcbaker Sep 22, 2023
c10e31d
ZlibSystemDependency: pass libtype to clib_compiler.find_library
alanc Mar 22, 2023
4ce3e63
get_llvm_tool_names: add llvm 17
lazka Sep 23, 2023
faa3d90
openmp: add 5.1/5.2, fixes openmp with llvm v17
lazka Sep 23, 2023
58be8bc
fix bug where all java builds & tests fail to run SanityCheck on JDK11
lannybroo Sep 16, 2023
36210f6
rust: apply global, project, and environment C args to bindgen
dcbaker Sep 22, 2023
f12a43a
Adjust kernel detection to support Solaris 5.10 or earlier
CorrodedCoder Sep 18, 2023
3f874d5
compilers: use correct version comparison for openbsd libraries
eli-schwartz Sep 1, 2023
48c03f9
CPU family support 'sw_64'
KunWuChan Sep 20, 2023
4c8cd24
Update Reference-tables.md
KunWuChan Sep 20, 2023
fd1f36a
docs/markdown: update Reference-tables.md to keep 'CPU families' in a…
KunWuChan Sep 22, 2023
e77edf4
tests: fix test_vsenv_option with Python 3.11+ on Windows
lazka Aug 8, 2023
8b09ab2
tests: fix "4 custom target depends extmodule" with Python 3.8+ on Wi…
lazka Aug 8, 2023
5aeacb7
tests: Skip "withIncludeFile" for PCH on Xcode backend
tangalbert919 Aug 21, 2023
3328f38
tests: fix broken promises with linker scripts
eli-schwartz Sep 26, 2023
a37a20a
Wrap: Use git instead of patch by default
xclaesse Sep 12, 2023
47d456a
ci: Skip gir test on cygwin
xclaesse Aug 30, 2023
b9cbf3a
Bump versions to 1.2.2 for release
nirbheek Sep 27, 2023
65cb017
Allow share/cmake/ as cmake_prefix_path
zasdfgbnm Sep 27, 2023
ab3d020
find_tool: don't assume the pkgconfig variable is a valid command
lazka Sep 30, 2023
5498f56
Mangle dashes as needed by WiX.
jpakkane Sep 29, 2023
030d0fc
nasm tests: skip asm language test on Solaris & illumos
alanc Oct 2, 2023
f8b2ee1
python dependency: ensure that setuptools doesn't inject itself into …
eli-schwartz Sep 8, 2023
d573c8f
python module: stop using distutils schemes on sufficiently new Debian
eli-schwartz Nov 22, 2022
3c3caf5
python module: stop using distutils "link to libpython" probe on rece…
eli-schwartz Nov 23, 2022
618c6cc
tests: fix test case to not import distutils on python 3.12
eli-schwartz Oct 3, 2023
195ba1c
mark the PyPI metadata as supporting python 3.12
eli-schwartz Oct 3, 2023
707f284
temp disable pylint falsepositive on dub.py
bruchar1 Oct 3, 2023
404ed7b
CI: install an older java on opensuse
eli-schwartz Oct 3, 2023
e03bcf7
CI: fix broken ciimage builder script failing to correctly copy meson
eli-schwartz Oct 3, 2023
2d01821
CI: fix the fix for python actually being mildly useful
eli-schwartz Oct 3, 2023
361812c
Add support for lcov 2.0
nkukard Oct 9, 2023
15fd6ec
wrap: catch failure to extract tarball and raise WrapException
eli-schwartz Oct 9, 2023
6454360
c++: add fallback mappings for C++23
tycho Jun 20, 2023
5c1b0ef
tests: add support for c++23 detection
tycho Jun 20, 2023
002982b
c++: add support for c++23 standard and aliases
tycho Jun 20, 2023
33f0df4
Allow c++23 in gcc-11.
bredelings Oct 7, 2023
11e5cac
msubprojects: Abort the rebase if there's conflicts
nirbheek Oct 6, 2023
428c89a
msubprojects: Checkout if the branch is tracking upstream
nirbheek Oct 6, 2023
5f86d62
Fix MSVC linker error LNK1170 with long rspfiles
neptuwunium Oct 10, 2023
639ed00
ninjabackend: Use the right ranlib for static linker rules
nirbheek Oct 12, 2023
6496038
msubprojects: Fix crash if wrapdb_version is in bad format
xclaesse Oct 16, 2023
0958291
msubprojects: Fix typo 'any way' -> 'anyway'
nirbheek Oct 17, 2023
63b5a02
Revert "rust: apply global, project, and environment C args to bindgen"
nirbheek Oct 18, 2023
49d98cf
test cases/15 llvm: Skip cmake when llvm == 17.0
nirbheek Oct 18, 2023
84e4371
Bump versions to 1.2.3 for release
nirbheek Oct 17, 2023
65dcb80
Merge tag '1.2.3' into unvendor
rgommers Oct 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ jobs:
TOOLCHAIN: clang
env:
MESON_CI_JOBNAME: msys2-${{ matrix.NAME }}
# XXX: For some reason enabling jit debugging "fixes" random python crashes
# see https://github.com/msys2/MINGW-packages/issues/11864
MSYS: "winjitdebug"

defaults:
run:
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ build system.
- [Python](https://python.org) (version 3.7 or newer)
- [Ninja](https://ninja-build.org) (version 1.8.2 or newer)

Latest Meson version supporting previous Python versions:
- Python 3.6: **0.61.5**
- Python 3.5: **0.56.2**
- Python 3.4: **0.45.1**

#### Installing from source

Meson is available on [PyPi](https://pypi.python.org/pypi/meson), so
Expand Down
5 changes: 3 additions & 2 deletions ci/ciimage/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,14 @@ def copy_meson(self) -> None:
shutil.copytree(
self.meson_root,
self.temp_dir / 'meson',
symlinks=True,
ignore=shutil.ignore_patterns(
'.git',
'*_cache',
'__pycache__',
# 'work area',
self.temp_dir.name,
)
),
)

def do_test(self, tty: bool = False) -> None:
Expand Down Expand Up @@ -175,7 +176,7 @@ def do_test(self, tty: bool = False) -> None:
else:
test_cmd = [
self.docker, 'run', '--rm', '-t', 'meson_test_image',
'/bin/bash', '-c', 'source /ci/env_vars.sh; cd meson; ./run_tests.py $CI_ARGS'
'/bin/bash', '-xc', 'source /ci/env_vars.sh; cd meson; ./run_tests.py $CI_ARGS'
]

if subprocess.run(test_cmd).returncode != 0 and not tty:
Expand Down
4 changes: 2 additions & 2 deletions ci/ciimage/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ dub_fetch() {
}

install_minimal_python_packages() {
rm -f /usr/lib/python3.*/EXTERNALLY-MANAGED
rm -f /usr/lib*/python3.*/EXTERNALLY-MANAGED
python3 -m pip install "${base_python_pkgs[@]}" $*
}

install_python_packages() {
rm -f /usr/lib/python3.*/EXTERNALLY-MANAGED
rm -f /usr/lib*/python3.*/EXTERNALLY-MANAGED
python3 -m pip install "${base_python_pkgs[@]}" "${python_pkgs[@]}" $*
}
2 changes: 1 addition & 1 deletion ci/ciimage/opensuse/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pkgs=(
ninja make git autoconf automake patch libjpeg-devel
elfutils gcc gcc-c++ gcc-fortran gcc-objc gcc-obj-c++ vala rust bison flex curl lcov
mono-core gtkmm3-devel gtest gmock protobuf-devel wxGTK3-3_2-devel gobject-introspection-devel
itstool gtk3-devel java-15-openjdk-devel gtk-doc llvm-devel clang-devel libSDL2-devel graphviz-devel zlib-devel zlib-devel-static
itstool gtk3-devel java-17-openjdk-devel gtk-doc llvm-devel clang-devel libSDL2-devel graphviz-devel zlib-devel zlib-devel-static
#hdf5-devel netcdf-devel libscalapack2-openmpi3-devel libscalapack2-gnu-openmpi3-hpc-devel openmpi3-devel
doxygen vulkan-devel vulkan-validationlayers openssh mercurial gtk-sharp3-complete gtk-sharp2-complete libpcap-devel libgpgme-devel
libqt5-qtbase-devel libqt5-qttools-devel libqt5-linguist libqt5-qtbase-private-headers-devel
Expand Down
2 changes: 1 addition & 1 deletion cross/armclang-linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ c = ['/opt/arm/developmentstudio-2019.0/sw/ARMCompiler6.12/bin/armclang', '--tar
#cpp = '/usr/bin/arm-linux-gnueabihf-g++'
ar = '/opt/arm/developmentstudio-2019.0/sw/ARMCompiler6.12/bin/armar'
#strip = '/usr/arm-linux-gnueabihf/bin/strip'
#pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'
#pkg-config = '/usr/bin/arm-linux-gnueabihf-pkg-config'

[host_machine]
system = 'baremetal'
Expand Down
2 changes: 1 addition & 1 deletion cross/linux-mingw-w64-32bit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cpp = '/usr/bin/i686-w64-mingw32-g++'
objc = '/usr/bin/i686-w64-mingw32-gcc'
ar = '/usr/bin/i686-w64-mingw32-ar'
strip = '/usr/bin/i686-w64-mingw32-strip'
pkgconfig = '/usr/bin/i686-w64-mingw32-pkg-config'
pkg-config = '/usr/bin/i686-w64-mingw32-pkg-config'
windres = '/usr/bin/i686-w64-mingw32-windres'
exe_wrapper = 'wine'
ld = '/usr/bin/i686-w64-mingw32-ld'
Expand Down
4 changes: 2 additions & 2 deletions cross/linux-mingw-w64-64bit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ cpp = '/usr/bin/x86_64-w64-mingw32-g++'
objc = '/usr/bin/x86_64-w64-mingw32-gcc'
ar = '/usr/bin/x86_64-w64-mingw32-ar'
strip = '/usr/bin/x86_64-w64-mingw32-strip'
pkgconfig = '/usr/bin/x86_64-w64-mingw32-pkg-config'
pkg-config = '/usr/bin/x86_64-w64-mingw32-pkg-config'
windres = '/usr/bin/x86_64-w64-mingw32-windres'
exe_wrapper = 'wine64'
exe_wrapper = 'wine'
cmake = '/usr/bin/cmake'

[properties]
Expand Down
2 changes: 1 addition & 1 deletion cross/none.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ fc = ['false']
objc = ['false']
objcpp = ['false']
ar = ['false']
pkgconfig = ['false']
pkg-config = ['false']
cmake = ['false']
2 changes: 1 addition & 1 deletion cross/ubuntu-armhf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cpp = ['/usr/bin/arm-linux-gnueabihf-g++']
rust = ['rustc', '--target', 'arm-unknown-linux-gnueabihf', '-C', 'linker=/usr/bin/arm-linux-gnueabihf-gcc-7']
ar = '/usr/arm-linux-gnueabihf/bin/ar'
strip = '/usr/arm-linux-gnueabihf/bin/strip'
pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'
pkg-config = '/usr/bin/arm-linux-gnueabihf-pkg-config'
ld = '/usr/bin/arm-linux/gnueabihf-ld'

[built-in options]
Expand Down
1 change: 1 addition & 0 deletions data/test.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"exe",
"shared_lib",
"python_lib",
"python_bytecode",
"pdb",
"implib",
"py_implib",
Expand Down
6 changes: 3 additions & 3 deletions docs/markdown/Machine-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ arch = 'aarch64-linux-gnu'
c = arch + '-gcc'
cpp = arch + '-g++'
strip = arch + '-strip'
pkgconfig = arch + '-pkg-config'
pkg-config = arch + '-pkg-config'
...
```

Expand Down Expand Up @@ -165,7 +165,7 @@ c_ld = 'gold'
cpp_ld = 'gold'
ar = '/usr/i586-mingw32msvc/bin/ar'
strip = '/usr/i586-mingw32msvc/bin/strip'
pkgconfig = '/usr/bin/i586-mingw32msvc-pkg-config'
pkg-config = '/usr/bin/i586-mingw32msvc-pkg-config'
```

An incomplete list of internally used programs that can be overridden
Expand All @@ -179,7 +179,7 @@ here is:
- libwmf-config
- llvm-config
- pcap-config
- pkgconfig
- pkg-config
- sdl2-config
- wx-config (or wx-3.0-config or wx-config-gtk)

Expand Down
2 changes: 2 additions & 0 deletions docs/markdown/Reference-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ set in the cross file.
| sh4 | SuperH SH-4 |
| sparc | 32 bit SPARC |
| sparc64 | SPARC v9 processor |
| sw_64 | 64 bit sunway processor |
| wasm32 | 32 bit Webassembly |
| wasm64 | 64 bit Webassembly |
| x86 | 32 bit x86 processor |
| x86_64 | 64 bit x86 processor |


Any cpu family not listed in the above list is not guaranteed to
remain stable in future releases.

Expand Down
2 changes: 1 addition & 1 deletion man/meson.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH MESON "1" "July 2023" "meson 1.2.0" "User Commands"
.TH MESON "1" "October 2023" "meson 1.2.3" "User Commands"
.SH NAME
meson - a high productivity build system
.SH DESCRIPTION
Expand Down
5 changes: 5 additions & 0 deletions mesonbuild/ast/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
InvalidArguments,
BreakRequest,
ContinueRequest,
Disabler,
default_resolve_key,
)

Expand All @@ -53,6 +54,7 @@
NotNode,
PlusAssignmentNode,
TernaryNode,
TestCaseClauseNode,
)

if T.TYPE_CHECKING:
Expand Down Expand Up @@ -445,3 +447,6 @@ def flatten_kwargs(self, kwargs: T.Dict[str, TYPE_nvar], include_unknown_args: b
elif isinstance(val, (str, bool, int, float)) or include_unknown_args:
flattened_kwargs[key] = val
return flattened_kwargs

def evaluate_testcase(self, node: TestCaseClauseNode) -> Disabler | None:
return Disabler(subproject=self.subproject)
19 changes: 19 additions & 0 deletions mesonbuild/ast/introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,22 @@ def analyze(self) -> None:
self.sanity_check_ast()
self.parse_project()
self.run()

def extract_subproject_dir(self) -> T.Optional[str]:
'''Fast path to extract subproject_dir kwarg.
This is faster than self.parse_project() which also initialize options
and also calls parse_project() on every subproject.
'''
if not self.ast.lines:
return
project = self.ast.lines[0]
# first line is always project()
if not isinstance(project, FunctionNode):
return
for kw, val in project.args.kwargs.items():
assert isinstance(kw, IdNode), 'for mypy'
if kw.value == 'subproject_dir':
# mypy does not understand "and isinstance"
if isinstance(val, StringNode):
return val.value
return None
39 changes: 27 additions & 12 deletions mesonbuild/backend/ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ def _quoter(x, qf = quote_func):
return ninja_quote(qf(str(x)))

def write(self, outfile: T.TextIO) -> None:
rspfile_args = self.args
if self.rspfile_quote_style is RSPFileSyntax.MSVC:
rspfile_quote_func = cmd_quote
rspfile_args = [NinjaCommandArg('$in_newline', arg.quoting) if arg.s == '$in' else arg for arg in rspfile_args]
else:
rspfile_quote_func = gcc_rsp_quote

Expand All @@ -253,7 +255,7 @@ def rule_iter():
if rsp == '_RSP':
outfile.write(' command = {} @$out.rsp\n'.format(' '.join([self._quoter(x) for x in self.command])))
outfile.write(' rspfile = $out.rsp\n')
outfile.write(' rspfile_content = {}\n'.format(' '.join([self._quoter(x, rspfile_quote_func) for x in self.args])))
outfile.write(' rspfile_content = {}\n'.format(' '.join([self._quoter(x, rspfile_quote_func) for x in rspfile_args])))
else:
outfile.write(' command = {}\n'.format(' '.join([self._quoter(x) for x in self.command + self.args])))
if self.deps:
Expand Down Expand Up @@ -636,7 +638,7 @@ def generate(self, capture: bool = False, vslite_ctx: dict = None) -> T.Optional
key = OptionKey('b_coverage')
if (key in self.environment.coredata.options and
self.environment.coredata.options[key].value):
gcovr_exe, gcovr_version, lcov_exe, genhtml_exe, _ = environment.find_coverage_tools()
gcovr_exe, gcovr_version, lcov_exe, lcov_version, genhtml_exe, _ = environment.find_coverage_tools()
if gcovr_exe or (lcov_exe and genhtml_exe):
self.add_build_comment(NinjaComment('Coverage rules'))
self.generate_coverage_rules(gcovr_exe, gcovr_version)
Expand All @@ -658,9 +660,9 @@ def generate(self, capture: bool = False, vslite_ctx: dict = None) -> T.Optional
os.replace(tempfilename, outfilename)
mlog.cmd_ci_include(outfilename) # For CI debugging
# Refresh Ninja's caches. https://github.com/ninja-build/ninja/pull/1685
if mesonlib.version_compare(self.ninja_version, '>=1.10.0') and os.path.exists('.ninja_deps'):
subprocess.call(self.ninja_command + ['-t', 'restat'])
subprocess.call(self.ninja_command + ['-t', 'cleandead'])
if mesonlib.version_compare(self.ninja_version, '>=1.10.0') and os.path.exists(os.path.join(self.environment.build_dir, '.ninja_log')):
subprocess.call(self.ninja_command + ['-t', 'restat'], cwd=self.environment.build_dir)
subprocess.call(self.ninja_command + ['-t', 'cleandead'], cwd=self.environment.build_dir)
self.generate_compdb()
self.generate_rust_project_json()

Expand Down Expand Up @@ -1687,8 +1689,6 @@ def generate_vala_compile(self, target: build.BuildTarget) -> \
# Without this, it will write it inside c_out_dir
args += ['--vapi', os.path.join('..', target.vala_vapi)]
valac_outputs.append(vapiname)
target.outputs += [target.vala_header, target.vala_vapi]
target.install_tag += ['devel', 'devel']
# Install header and vapi to default locations if user requests this
if len(target.install_dir) > 1 and target.install_dir[1] is True:
target.install_dir[1] = self.environment.get_includedir()
Expand All @@ -1699,8 +1699,6 @@ def generate_vala_compile(self, target: build.BuildTarget) -> \
girname = os.path.join(self.get_target_dir(target), target.vala_gir)
args += ['--gir', os.path.join('..', target.vala_gir)]
valac_outputs.append(girname)
target.outputs.append(target.vala_gir)
target.install_tag.append('devel')
# Install GIR to default location if requested by user
if len(target.install_dir) > 3 and target.install_dir[3] is True:
target.install_dir[3] = os.path.join(self.environment.get_datadir(), 'gir-1.0')
Expand Down Expand Up @@ -2097,13 +2095,14 @@ def generate_rust_target(self, target: build.BuildTarget) -> None:
if a in rustc.native_static_libs:
# Exclude link args that rustc already add by default
continue
if a.endswith(('.dll', '.so', '.dylib')):
if a.endswith(('.dll', '.so', '.dylib', '.a', '.lib')):
dir_, lib = os.path.split(a)
linkdirs.add(dir_)
lib, ext = os.path.splitext(lib)
if lib.startswith('lib'):
lib = lib[3:]
args.extend(['-l', f'dylib={lib}'])
_type = 'static' if a.endswith(('.a', '.lib')) else 'dylib'
args.extend(['-l', f'{_type}={lib}'])
elif a.startswith('-L'):
args.append(a)
elif a.startswith('-l'):
Expand Down Expand Up @@ -2343,7 +2342,7 @@ def generate_static_link_rules(self):
if static_linker is None:
continue
rule = 'STATIC_LINKER{}'.format(self.get_rule_suffix(for_machine))
cmdlist = []
cmdlist: T.List[T.Union[str, NinjaCommandArg]] = []
args = ['$in']
# FIXME: Must normalize file names with pathlib.Path before writing
# them out to fix this properly on Windows. See:
Expand All @@ -2357,6 +2356,22 @@ def generate_static_link_rules(self):
cmdlist += static_linker.get_exelist()
cmdlist += ['$LINK_ARGS']
cmdlist += NinjaCommandArg.list(static_linker.get_output_args('$out'), Quoting.none)
# The default ar on MacOS (at least through version 12), does not
# add extern'd variables to the symbol table by default, and
# requires that apple's ranlib be called with a special flag
# instead after linking
if static_linker.id == 'applear':
# This is a bit of a hack, but we assume that that we won't need
# an rspfile on MacOS, otherwise the arguments are passed to
# ranlib, not to ar
cmdlist.extend(args)
args = []
# Ensure that we use the user-specified ranlib if any, and
# fallback to just picking up some ranlib otherwise
ranlib = self.environment.lookup_binary_entry(for_machine, 'ranlib')
if ranlib is None:
ranlib = ['ranlib']
cmdlist.extend(['&&'] + ranlib + ['-c', '$out'])
description = 'Linking static target $out'
if num_pools > 0:
pool = 'pool = link_pool'
Expand Down
Loading