summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/cl.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-11-26 22:43:51 +0800
committerruki <[email protected]>2020-11-26 22:43:51 +0800
commit6426a1e2f0dea74ee3d82abe9f8b7aa46ed9ef9f (patch)
tree93343f3997f689c048f2af4d8d373c33dfb0e86c /xmake/modules/core/tools/cl.lua
parentc9c4a0046f6ec2f0f2f4699e49d8809629a055f2 (diff)
improve to check sourceDependencies for cl
Diffstat (limited to 'xmake/modules/core/tools/cl.lua')
-rw-r--r--xmake/modules/core/tools/cl.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index 0db8df367..e38dd158a 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -367,7 +367,14 @@ function _has_source_dependencies(self)
local has_source_dependencies = _g._HAS_SOURCE_DEPENDENCIES
if has_source_dependencies == nil then
local source_dependencies_jsonfile = os.tmpfile() .. ".json"
- if self:has_flags("/sourceDependencies " .. source_dependencies_jsonfile, "cxflags", {flagskey = "cl_sourceDependencies"}) and os.isfile(source_dependencies_jsonfile) then
+ if self:has_flags("/sourceDependencies " .. source_dependencies_jsonfile, "cxflags", {flagskey = "cl_sourceDependencies",
+ on_check = function (ok, errors)
+ -- even if cl does not support /sourceDependencies, it will not interrupt compilation
+ if ok and not os.isfile(source_dependencies_jsonfile) then
+ ok = false
+ end
+ return ok, errors
+ end}) then
has_source_dependencies = true
end
has_source_dependencies = has_source_dependencies or false