mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
Fix binary installation for cross compilation
This commit is contained in:
parent
3bdc08e408
commit
c2c811e321
2 changed files with 17 additions and 6 deletions
|
|
@ -8,17 +8,21 @@ export OUTPUT="$3"
|
|||
export BUILDTYPE="$4"
|
||||
export APP_BIN="$5"
|
||||
|
||||
if [ -z ${CARGO_BUILD_TARGET+defined} ]; then
|
||||
CARGO_OUTPUT_PATH="${CARGO_TARGET_DIR}"
|
||||
else
|
||||
CARGO_OUTPUT_PATH="${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}"
|
||||
fi
|
||||
|
||||
if [ $BUILDTYPE = "release" ]
|
||||
then
|
||||
if [ $BUILDTYPE = "release" ]; then
|
||||
echo "RELEASE MODE"
|
||||
cargo build --manifest-path \
|
||||
"$MESON_SOURCE_ROOT"/Cargo.toml --release && \
|
||||
cp "$CARGO_TARGET_DIR"/release/"$APP_BIN" "$OUTPUT"
|
||||
cp "$CARGO_OUTPUT_PATH"/release/"$APP_BIN" "$OUTPUT"
|
||||
else
|
||||
echo "DEBUG MODE"
|
||||
cargo build --manifest-path \
|
||||
"$MESON_SOURCE_ROOT"/Cargo.toml --verbose && \
|
||||
cp "$CARGO_TARGET_DIR"/debug/"$APP_BIN" "$OUTPUT"
|
||||
cp "$CARGO_OUTPUT_PATH"/debug/"$APP_BIN" "$OUTPUT"
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,13 @@ sources = files(
|
|||
'resources.rs',
|
||||
)
|
||||
|
||||
system = host_machine.system()
|
||||
if system == 'windows'
|
||||
output = meson.project_name() + '.exe'
|
||||
else
|
||||
output = meson.project_name()
|
||||
endif
|
||||
|
||||
cargo_script = find_program(join_paths(meson.source_root(), 'build-aux/cargo.sh'))
|
||||
cargo_release = custom_target(
|
||||
'cargo-build',
|
||||
|
|
@ -44,7 +51,7 @@ cargo_release = custom_target(
|
|||
input: sources,
|
||||
build_always_stale: true,
|
||||
depends: resources,
|
||||
output: meson.project_name(),
|
||||
output: output,
|
||||
console: true,
|
||||
install: true,
|
||||
install_dir: get_option('bindir'),
|
||||
|
|
@ -54,6 +61,6 @@ cargo_release = custom_target(
|
|||
meson.source_root(),
|
||||
'@OUTPUT@',
|
||||
get_option('buildtype'),
|
||||
meson.project_name(),
|
||||
output,
|
||||
]
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue