summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-07 19:27:10 +0800
committerGitHub <[email protected]>2022-05-07 19:27:10 +0800
commitbbcd0a0ecce2f57295de995c4c84984f6ed1a572 (patch)
treec297f8faee602a8c7379c054bb7054082e19b96c
parent166c21c46cfc79104bab7a5b6646ee43ebad45db (diff)
parent252013a37a7d8c5b1b5b9bed74c29b1ead968046 (diff)
Merge pull request #2340 from SirLynix/project_kind
Add some plugin.project.kind for project generators
-rw-r--r--xmake/plugins/project/clang/compile_commands.lua3
-rw-r--r--xmake/plugins/project/cmake/cmakelists.lua4
-rw-r--r--xmake/plugins/project/make/makefile.lua3
-rw-r--r--xmake/plugins/project/ninja/build_ninja.lua3
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua4
5 files changed, 17 insertions, 0 deletions
diff --git a/xmake/plugins/project/clang/compile_commands.lua b/xmake/plugins/project/clang/compile_commands.lua
index a3f893d90..ae1043d12 100644
--- a/xmake/plugins/project/clang/compile_commands.lua
+++ b/xmake/plugins/project/clang/compile_commands.lua
@@ -188,6 +188,9 @@ end
-- make target
function _make_target(jsonfile, target)
+ -- https://github.com/xmake-io/xmake/issues/2337
+ target:data_set("plugin.project.kind", "compile_commands")
+
-- enter package environments
local oldenvs = os.addenvs(target:pkgenvs())
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua
index 6f771130c..fed2f7e42 100644
--- a/xmake/plugins/project/cmake/cmakelists.lua
+++ b/xmake/plugins/project/cmake/cmakelists.lua
@@ -131,6 +131,10 @@ end
-- add target: phony
function _add_target_phony(cmakelists, target)
+
+ -- https://github.com/xmake-io/xmake/issues/2337
+ target:data_set("plugin.project.kind", "cmakelist")
+
cmakelists:printf("add_custom_target(%s", target:name())
local deps = target:get("deps")
if deps then
diff --git a/xmake/plugins/project/make/makefile.lua b/xmake/plugins/project/make/makefile.lua
index 601f920c9..7b0ec8f60 100644
--- a/xmake/plugins/project/make/makefile.lua
+++ b/xmake/plugins/project/make/makefile.lua
@@ -213,6 +213,9 @@ end
-- make target
function _make_target(makefile, target, targetflags)
+ -- https://github.com/xmake-io/xmake/issues/2337
+ target:data_set("plugin.project.kind", "makefile")
+
-- is phony target?
if target:is_phony() then
return _make_phony(makefile, target)
diff --git a/xmake/plugins/project/ninja/build_ninja.lua b/xmake/plugins/project/ninja/build_ninja.lua
index 72bb44a1d..8089bc9ce 100644
--- a/xmake/plugins/project/ninja/build_ninja.lua
+++ b/xmake/plugins/project/ninja/build_ninja.lua
@@ -227,6 +227,9 @@ end
-- add build rule for target
function _add_build_for_target(ninjafile, target)
+ -- https://github.com/xmake-io/xmake/issues/2337
+ target:data_set("plugin.project.kind", "ninja")
+
-- is phony target?
if target:is_phony() then
return _add_build_for_phony(ninjafile, target)
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index 4c06dadfa..d07757d19 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -485,6 +485,10 @@ function main(outputdir, vsinfo)
-- save targets
for targetname, target in pairs(project.targets()) do
+
+ -- https://github.com/xmake-io/xmake/issues/2337
+ target:data_set("plugin.project.kind", "vsxmake")
+
-- make target with the given mode and arch
targets[targetname] = targets[targetname] or {}
local _target = targets[targetname]