summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/srcenv.profile28
1 files changed, 25 insertions, 3 deletions
diff --git a/scripts/srcenv.profile b/scripts/srcenv.profile
index f2f4e5a26..13f4da112 100755
--- a/scripts/srcenv.profile
+++ b/scripts/srcenv.profile
@@ -1,8 +1,30 @@
# cd projectdir
+xmake_binaries=(
+ "build/xmake"
+ "build/xmake.exe"
+ "core/build/xmake"
+ "core/build/xmake.exe"
+)
+
export XMAKE_PROGRAM_DIR=`pwd`/xmake
-alias xmake=`pwd`/build/xmake
-export XMAKE_PROGRAM_FILE=`pwd`/build/xmake
+xmake_found=0
+for xmake_binary in "${xmake_binaries[@]}"; do
+ if [[ -x "$xmake_binary" ]] && ("$xmake_binary" --version); then
+ xmake_found=1
+ break
+ fi
+done
+
+if [ $xmake_found -eq 0 ]; then
+ unset xmake_binaries xmake_binary xmake_found
+ echo "Error: Cannot find a working xmake executable"
+ return 1
+fi
+
+alias xmake=`pwd`/$xmake_binary
+export XMAKE_PROGRAM_FILE=`pwd`/$xmake_binary
alias xrepo=`pwd`/scripts/xrepo.sh
-xmake --version
+
+unset xmake_binaries xmake_binary xmake_found
xmake l xmake.programdir
xmake l xmake.programfile