Skip to content

Commit

Permalink
meson: Update rust/meson.build
Browse files Browse the repository at this point in the history
Targeted build is now available for libraries too.
  • Loading branch information
htejun committed Sep 4, 2024
1 parent f010eda commit 708aaaa
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions rust/meson.build
Original file line number Diff line number Diff line change
@@ -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',
Expand Down

0 comments on commit 708aaaa

Please sign in to comment.