meson stuff
This commit is contained in:
parent
2f70f61547
commit
2bba51b97b
2 changed files with 12 additions and 3 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
target/
|
14
meson.build
14
meson.build
|
@ -43,8 +43,15 @@ subdir('po')
|
|||
subdir('resources')
|
||||
subdir('src')
|
||||
|
||||
if get_option('buildtype') == 'debug'
|
||||
rust_args = []
|
||||
rust_target = 'debug'
|
||||
else
|
||||
rust_args = ['--release']
|
||||
rust_target = 'release'
|
||||
endif
|
||||
|
||||
cargo = find_program('cargo')
|
||||
# TODO: cargo release build
|
||||
custom_target(
|
||||
'cargo-build',
|
||||
build_by_default: true,
|
||||
|
@ -53,19 +60,20 @@ custom_target(
|
|||
audrey_c,
|
||||
blueprints,
|
||||
],
|
||||
console: true,
|
||||
output: meson.project_name(),
|
||||
command: [
|
||||
'env',
|
||||
'CARGO_HOME=' + meson.project_build_root() / 'cargo-home',
|
||||
'RUSTFLAGS=-L ' + fs.parent(audrey_c.full_path()),
|
||||
'MESON_BUILD_ROOT=' + meson.project_build_root(),
|
||||
cargo,
|
||||
'build',
|
||||
rust_args,
|
||||
'--manifest-path', meson.project_source_root() / 'Cargo.toml',
|
||||
'--target-dir', meson.project_build_root() / 'cargo-target',
|
||||
'&&',
|
||||
'cp',
|
||||
'cargo-target' / 'debug' / meson.project_name(),
|
||||
'cargo-target' / rust_target / meson.project_name(),
|
||||
'@OUTPUT@',
|
||||
],
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue