From e7d30d933f7018c8192285513e06144501c948df Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Tue, 24 Sep 2019 11:26:22 +0000 Subject: [PATCH] build: Simplified the calling of cargo.sh --- HACKING.md | 4 ++-- cargo.sh | 8 ++++---- src/meson.build | 4 ++-- tests/meson.build | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) mode change 100644 => 100755 cargo.sh diff --git a/HACKING.md b/HACKING.md index a285488a..0d736fde 100644 --- a/HACKING.md +++ b/HACKING.md @@ -42,7 +42,7 @@ Use the `cargo.sh` script for maintaining the Cargo part of the build. The scrip ``` cd build_dir -sh /source_path/cargo.sh /source_path '' test +sh /source_path/cargo.sh '' test ``` ### Cargo dependencies @@ -53,6 +53,6 @@ Dependencies must be specified in `Cargo.toml` with 2 numbers: "major.minor". Si ``` cd build_dir -sh /source_path/cargo.sh /source_path '' update +sh /source_path/cargo.sh '' update ninja test ``` diff --git a/cargo.sh b/cargo.sh old mode 100644 new mode 100755 index fc8d8971..adb5aca5 --- a/cargo.sh +++ b/cargo.sh @@ -6,16 +6,16 @@ set -e -SOURCE_DIR="$1" +SCRIPT_PATH=`realpath $0` +SOURCE_DIR=`dirname $0` export CARGO_TARGET_DIR=`pwd` -if [ ! -z ${2} ]; then - OUT_PATH=`realpath "${2}"` +if [ ! -z ${1} ]; then + OUT_PATH=`realpath "${1}"` fi cd $SOURCE_DIR shift -shift cargo $BUILD_ARG $@ if [ ! -z ${OUT_PATH} ]; then diff --git a/src/meson.build b/src/meson.build index a2daaabe..6a569109 100644 --- a/src/meson.build +++ b/src/meson.build @@ -60,13 +60,13 @@ rslibs = custom_target( output: ['librs.a'], install: false, console: true, - command: [cargo_script, '@CURRENT_SOURCE_DIR@', '@OUTPUT@', 'build'] + command: [cargo_script, '@OUTPUT@', 'build'] ) test( 'rstest', cargo_script, - args: [meson.source_root(), '', 'test'] + args: ['', 'test'] ) libsqueekboard = static_library('libsqueekboard', diff --git a/tests/meson.build b/tests/meson.build index c86c0f63..899808e3 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -51,7 +51,7 @@ foreach layout : ['us', 'nb', 'number'] test( 'test_layout_' + layout, cargo_script, - args: [meson.source_root(), '', 'run', '--example', 'test_layout', layout] + args: ['', 'run', '--example', 'test_layout', layout] ) endforeach