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('resources')
|
||||||
subdir('src')
|
subdir('src')
|
||||||
|
|
||||||
|
if get_option('buildtype') == 'debug'
|
||||||
|
rust_args = []
|
||||||
|
rust_target = 'debug'
|
||||||
|
else
|
||||||
|
rust_args = ['--release']
|
||||||
|
rust_target = 'release'
|
||||||
|
endif
|
||||||
|
|
||||||
cargo = find_program('cargo')
|
cargo = find_program('cargo')
|
||||||
# TODO: cargo release build
|
|
||||||
custom_target(
|
custom_target(
|
||||||
'cargo-build',
|
'cargo-build',
|
||||||
build_by_default: true,
|
build_by_default: true,
|
||||||
|
@ -53,19 +60,20 @@ custom_target(
|
||||||
audrey_c,
|
audrey_c,
|
||||||
blueprints,
|
blueprints,
|
||||||
],
|
],
|
||||||
|
console: true,
|
||||||
output: meson.project_name(),
|
output: meson.project_name(),
|
||||||
command: [
|
command: [
|
||||||
'env',
|
'env',
|
||||||
'CARGO_HOME=' + meson.project_build_root() / 'cargo-home',
|
|
||||||
'RUSTFLAGS=-L ' + fs.parent(audrey_c.full_path()),
|
'RUSTFLAGS=-L ' + fs.parent(audrey_c.full_path()),
|
||||||
'MESON_BUILD_ROOT=' + meson.project_build_root(),
|
'MESON_BUILD_ROOT=' + meson.project_build_root(),
|
||||||
cargo,
|
cargo,
|
||||||
'build',
|
'build',
|
||||||
|
rust_args,
|
||||||
'--manifest-path', meson.project_source_root() / 'Cargo.toml',
|
'--manifest-path', meson.project_source_root() / 'Cargo.toml',
|
||||||
'--target-dir', meson.project_build_root() / 'cargo-target',
|
'--target-dir', meson.project_build_root() / 'cargo-target',
|
||||||
'&&',
|
'&&',
|
||||||
'cp',
|
'cp',
|
||||||
'cargo-target' / 'debug' / meson.project_name(),
|
'cargo-target' / rust_target / meson.project_name(),
|
||||||
'@OUTPUT@',
|
'@OUTPUT@',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue