From 3cb3727b67b20187d04be2270c493d4ce6c6924f Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 25 Dec 2022 17:01:42 +0800 Subject: fix compile_commands --- scripts/srcenv.profile | 9 ++------- xmake/plugins/project/clang/compile_commands.lua | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/srcenv.profile b/scripts/srcenv.profile index c673b2636..f2f4e5a26 100755 --- a/scripts/srcenv.profile +++ b/scripts/srcenv.profile @@ -1,12 +1,7 @@ # cd projectdir export XMAKE_PROGRAM_DIR=`pwd`/xmake -if [ -f `pwd`/core/build/xmake ]; then - alias xmake=`pwd`/core/build/xmake - export XMAKE_PROGRAM_FILE=`pwd`/core/build/xmake -else - alias xmake=`pwd`/core/src/demo/demo.b - export XMAKE_PROGRAM_FILE=`pwd`/core/src/demo/demo.b -fi +alias xmake=`pwd`/build/xmake +export XMAKE_PROGRAM_FILE=`pwd`/build/xmake alias xrepo=`pwd`/scripts/xrepo.sh xmake --version xmake l xmake.programdir diff --git a/xmake/plugins/project/clang/compile_commands.lua b/xmake/plugins/project/clang/compile_commands.lua index e7207d094..88c72e09a 100644 --- a/xmake/plugins/project/clang/compile_commands.lua +++ b/xmake/plugins/project/clang/compile_commands.lua @@ -90,7 +90,7 @@ function _translate_arguments(arguments) if arg then -- split "/usr/bin/xcrun -sdk macosx clang" -- @see https://github.com/xmake-io/xmake/issues/3159 - if idx == 1 and arg:find(" ", 1, true) then + if idx == 1 and not os.isfile(arg) and arg:find(" ", 1, true) then table.join2(args, os.argv(arg)) else table.insert(args, arg) -- cgit v1.3.1