diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-11-10 09:48:21 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-11-10 12:09:04 -0800 |
commit | a28b430b681f790122415a371382565d19ea947b (patch) | |
tree | 6a1ff375285b9bea239c1f21508e0cb74b6bc965 /mesonbuild/backend/ninjabackend.py | |
parent | e430c01ef51f0fabba8bd6170287c42f718e7854 (diff) | |
download | meson-a28b430b681f790122415a371382565d19ea947b.zip meson-a28b430b681f790122415a371382565d19ea947b.tar.gz meson-a28b430b681f790122415a371382565d19ea947b.tar.bz2 |
ninjabackend: apply base compile_args to rust targets
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 09f06da..daada12 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1494,6 +1494,10 @@ int dummy; # Rust compiler takes only the main file as input and # figures out what other files are needed via import # statements and magic. + base_proxy = self.get_base_options_for_target(target) + args = rustc.compiler_args() + # Compiler args for compiling this target + args += compilers.get_base_compile_args(base_proxy, rustc) main_rust_file = None for i in target.get_sources(): if not rustc.can_compile(i): @@ -1503,7 +1507,6 @@ int dummy; if main_rust_file is None: raise RuntimeError('A Rust target has no Rust sources. This is weird. Also a bug. Please report') target_name = os.path.join(target.subdir, target.get_filename()) - args = ['--crate-type'] if isinstance(target, build.Executable): cratetype = 'bin' elif hasattr(target, 'rust_crate_type'): @@ -1514,7 +1517,7 @@ int dummy; cratetype = 'rlib' else: raise InvalidArguments('Unknown target type for rustc.') - args.append(cratetype) + args.extend(['--crate-type', cratetype]) # If we're dynamically linking, add those arguments # |