diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-02-08 10:25:36 +0000 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-02-10 15:05:37 -0800 |
commit | 3596b6b19a0e5bf6ce65a640448d459c85180184 (patch) | |
tree | 678e67f9d8c5c375465549e5e24293cffaa2a294 /mesonbuild/backend | |
parent | 755b2ab6dae0b4ea5addeac70008d58b1900e9aa (diff) | |
download | meson-3596b6b19a0e5bf6ce65a640448d459c85180184.zip meson-3596b6b19a0e5bf6ce65a640448d459c85180184.tar.gz meson-3596b6b19a0e5bf6ce65a640448d459c85180184.tar.bz2 |
ninjabackend: fix rust program names with dashes
This substitution matches the behaviour of rustc[1] when inferring
crate name based on file name.
[1]: https://github.com/rust-lang/rust/tree/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/compiler/rustc_session/src/output.rs#L88
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 080d009..f4df789 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1709,7 +1709,8 @@ class NinjaBackend(backends.Backend): args.extend(rustc.get_linker_always_args()) args += self.generate_basic_compiler_args(target, rustc, False) - args += ['--crate-name', target.name] + # This matches rustc's default behavior. + args += ['--crate-name', target.name.replace('-', '_')] depfile = os.path.join(target.subdir, target.name + '.d') args += ['--emit', f'dep-info={depfile}', '--emit', 'link'] args += target.get_extra_args('rust') |