From 708aaaafb9a581141dd081ef1f1cf625c738ea34 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Wed, 4 Sep 2024 06:49:55 -1000 Subject: [PATCH] meson: Update rust/meson.build Targeted build is now available for libraries too. --- rust/meson.build | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/rust/meson.build b/rust/meson.build index 8fc11c1f9..fb4033ac0 100644 --- a/rust/meson.build +++ b/rust/meson.build @@ -1,20 +1,27 @@ cargo_cmd = [cargo, 'build', '--manifest-path=@INPUT@', '--target-dir=@OUTDIR@', cargo_build_args] -# the target to compile all rust binaries -custom_target('rust_binaries', +rust_libs = ['scx_utils', 'scx_stats', 'scx_rustland_core'] +rust_bins = ['scx_loader'] + +cargo_bins_args = [] + +foreach bin : rust_bins + cargo_bins_args += ['-p', bin] +endforeach + +# the default target to compile all rust binaries (but no libraries) +custom_target('rust_bins', output: '@PLAINNAME@.__PHONY__', input: 'Cargo.toml', - command: cargo_cmd, + command: cargo_cmd + cargo_bins_args, env: cargo_env, depends: sched_deps, build_by_default: true, build_always_stale: true) -# the target to compile loader binary -rust_binaries = ['scx_loader'] - -foreach binary: rust_binaries +# the target to compile individual packages +foreach binary: rust_libs + rust_bins custom_target(binary, output: binary + '@PLAINNAME@.__PHONY__', input: 'Cargo.toml',