summaryrefslogtreecommitdiff
path: root/xmake/plugins/project
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/plugins/project')
-rw-r--r--xmake/plugins/project/clang/compile_commands.lua1
-rw-r--r--xmake/plugins/project/clang/compile_flags.lua1
2 files changed, 2 insertions, 0 deletions
diff --git a/xmake/plugins/project/clang/compile_commands.lua b/xmake/plugins/project/clang/compile_commands.lua
index 9435819df..a017b4a32 100644
--- a/xmake/plugins/project/clang/compile_commands.lua
+++ b/xmake/plugins/project/clang/compile_commands.lua
@@ -308,6 +308,7 @@ function make(outputdir)
local oldir = os.cd(os.projectdir())
local jsonfile = io.open(path.join(outputdir, "compile_commands.json"), "w")
os.setenv("XMAKE_IN_COMPILE_COMMANDS_PROJECT_GENERATOR", "true")
+ target_cmds.prepare_targets()
_add_targets(jsonfile)
jsonfile:close()
os.setenv("XMAKE_IN_COMPILE_COMMANDS_PROJECT_GENERATOR", nil)
diff --git a/xmake/plugins/project/clang/compile_flags.lua b/xmake/plugins/project/clang/compile_flags.lua
index e4b07ec34..07f9de38c 100644
--- a/xmake/plugins/project/clang/compile_flags.lua
+++ b/xmake/plugins/project/clang/compile_flags.lua
@@ -23,6 +23,7 @@ import("core.tool.compiler")
import("core.project.project")
import("core.language.language")
import("private.utils.target", {alias = "target_utils"})
+import("plugins.project.utils.target_cmds", {rootdir = os.programdir()})
-- make the object
function _make_object(target, flags, sourcefile, objectfile)