Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions xmake/plugins/project/clang/compile_commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions xmake/plugins/project/clang/compile_flags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions xmake/rules/c++/precompiled_header/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ rule("c.build.pcheader")
import("private.action.build.pcheader").config(target, "c", opt)
end)
before_prepare(function (target, jobgraph, opt)
import("private.action.build.pcheader").build(target, jobgraph, "c", opt)
if not os.getenv("XMAKE_IN_COMPILE_COMMANDS_PROJECT_GENERATOR") then
import("private.action.build.pcheader").build(target, jobgraph, "c", opt)
end
end, {jobgraph = true})

rule("c++.build.pcheader")
Expand All @@ -32,6 +34,8 @@ rule("c++.build.pcheader")
import("private.action.build.pcheader").config(target, "cxx", opt)
end)
before_prepare(function (target, jobgraph, opt)
import("private.action.build.pcheader").build(target, jobgraph, "cxx", opt)
if not os.getenv("XMAKE_IN_COMPILE_COMMANDS_PROJECT_GENERATOR") then
import("private.action.build.pcheader").build(target, jobgraph, "cxx", opt)
end
end, {jobgraph = true})

Loading