summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-20 22:48:59 +0800
committerruki <[email protected]>2023-02-20 22:48:59 +0800
commit0975a3fd60b71a31806a51f3556201f107a33d2e (patch)
treec050da02439e177d1dd18a3fe65b8b2f814b788e
parent2e04812cae7e38d9b097b40cce90b34ec6fb8fca (diff)
add more timely checkers
-rw-r--r--xmake/core/project/target.lua4
-rw-r--r--xmake/plugins/check/checker.lua24
-rw-r--r--xmake/rules/utils/check_targets/check_targets.lua17
3 files changed, 18 insertions, 27 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 7e07503c8..79c5f0546 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -1381,7 +1381,7 @@ function _instance:fileconfig(sourcefile)
local results = os.match(filepath)
if #results == 0 and not fileconfig.always_added then
local sourceinfo = self:sourceinfo("files", filepath) or {}
- utils.warning("%s:%d: cannot match add_files(\"%s\") in %s(%s)", sourceinfo.file or "", sourceinfo.line or -1, filepath, self:type(), self:name())
+ utils.warning("%s:%d${clear}: cannot match add_files(\"%s\") in %s(%s)", sourceinfo.file or "", sourceinfo.line or -1, filepath, self:type(), self:name())
end
-- process source files
@@ -1505,7 +1505,7 @@ function _instance:sourcefiles()
end
if #results == 0 then
local sourceinfo = self:sourceinfo("files", file) or {}
- utils.warning("%s:%d: cannot match %s_files(\"%s\") in %s(%s)", sourceinfo.file or "", sourceinfo.line or -1, (removed and "remove" or "add"), file, self:type(), self:name())
+ utils.warning("%s:%d${clear}: cannot match %s_files(\"%s\") in %s(%s)", sourceinfo.file or "", sourceinfo.line or -1, (removed and "remove" or "add"), file, self:type(), self:name())
end
-- process source files
diff --git a/xmake/plugins/check/checker.lua b/xmake/plugins/check/checker.lua
index a6b8bb995..e80050849 100644
--- a/xmake/plugins/check/checker.lua
+++ b/xmake/plugins/check/checker.lua
@@ -28,23 +28,23 @@ function checkers()
checkers = {
-- target api checkers
["api.target.version"] = {description = "Check version configuration in target."},
- ["api.target.kind"] = {description = "Check kind configuration in target."},
- ["api.target.strip"] = {description = "Check strip configuration in target."},
- ["api.target.optimize"] = {description = "Check optimize configuration in target."},
- ["api.target.symbols"] = {description = "Check symbols configuration in target."},
- ["api.target.fpmodels"] = {description = "Check fpmodels configuration in target."},
- ["api.target.warnings"] = {description = "Check warnings configuration in target."},
- ["api.target.languages"] = {description = "Check languages configuration in target."},
- ["api.target.vectorexts"] = {description = "Check vectorexts configuration in target."},
- ["api.target.exceptions"] = {description = "Check exceptions configuration in target."},
+ ["api.target.kind"] = {description = "Check kind configuration in target.", timely = true},
+ ["api.target.strip"] = {description = "Check strip configuration in target.", timely = true},
+ ["api.target.optimize"] = {description = "Check optimize configuration in target.", timely = true},
+ ["api.target.symbols"] = {description = "Check symbols configuration in target.", timely = true},
+ ["api.target.fpmodels"] = {description = "Check fpmodels configuration in target.", timely = true},
+ ["api.target.warnings"] = {description = "Check warnings configuration in target.", timely = true},
+ ["api.target.languages"] = {description = "Check languages configuration in target.", timely = true},
+ ["api.target.vectorexts"] = {description = "Check vectorexts configuration in target.", timely = true},
+ ["api.target.exceptions"] = {description = "Check exceptions configuration in target.", timely = true},
["api.target.packages"] = {description = "Check packages configuration in target."},
["api.target.files"] = {description = "Check files configuration in target."},
["api.target.headerfiles"] = {description = "Check header files configuration in target."},
["api.target.installfiles"] = {description = "Check install files configuration in target."},
["api.target.configfiles"] = {description = "Check config files configuration in target."},
- ["api.target.linkdirs"] = {description = "Check linkdirs configuration in target."},
- ["api.target.includedirs"] = {description = "Check includedirs configuration in target."},
- ["api.target.frameworkdirs"] = {description = "Check frameworkdirs configuration in target."},
+ ["api.target.linkdirs"] = {description = "Check linkdirs configuration in target.", timely = true},
+ ["api.target.includedirs"] = {description = "Check includedirs configuration in target.", timely = true},
+ ["api.target.frameworkdirs"] = {description = "Check frameworkdirs configuration in target.", timely = true},
["api.target.cflags"] = {description = "Check c compiler flags configuration in target."},
["api.target.cxflags"] = {description = "Check c/c++ compiler flags configuration in target."},
["api.target.cxxflags"] = {description = "Check c++ compiler flags configuration in target."},
diff --git a/xmake/rules/utils/check_targets/check_targets.lua b/xmake/rules/utils/check_targets/check_targets.lua
index 803466dfa..a32f757ea 100644
--- a/xmake/rules/utils/check_targets/check_targets.lua
+++ b/xmake/rules/utils/check_targets/check_targets.lua
@@ -39,20 +39,11 @@ function _show(str, opt)
end
function main(target)
-
- -- get checkers
- local checked_checkers = {}
local checkers = checker.checkers()
- for name, _ in table.orderpairs(checkers) do
- if name:startswith("api.target.") then
- table.insert(checked_checkers, name)
+ for name, info in table.orderpairs(checkers) do
+ if name:startswith("api.target.") and info.timely then
+ import("plugins.check.checkers." .. name, {anonymous = true, rootdir = os.programdir()})({
+ target = target, show = _show})
end
end
-
- -- do checkers
- for _, name in ipairs(checked_checkers) do
- local info = checkers[name]
- import("plugins.check.checkers." .. name, {anonymous = true, rootdir = os.programdir()})({
- target = target, show = _show})
- end
end