summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-12-12 13:00:01 +0800
committerGitHub <[email protected]>2021-12-12 13:00:01 +0800
commitcece2f0114454da39d785ada3c7e1566e65a2018 (patch)
tree668dc7885a95432ffc6919f1c417124de832988d
parent4592135696009bd89d2ed50a29cbcc82bcc6efae (diff)
parentae349f87af3ceb312b3506e80e8c6a4ce9ecb91f (diff)
Merge pull request #1905 from SirLynix/patch-8
msvc: add support of external headers without experimental
-rw-r--r--xmake/modules/core/tools/cl.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index a519d1618..b76061cd7 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -270,13 +270,17 @@ end
function nf_sysincludedir(self, dir)
local has_external_includedir = _g._HAS_EXTERNAL_INCLUDEDIR
if has_external_includedir == nil then
- if self:has_flags({"-experimental:external", "-external:W0", "-external:I" .. os.args(path.translate(dir))}, "cxflags", {flagskey = "cl_external_includedir"}) then
- has_external_includedir = true
+ if self:has_flags({"-external:W0", "-external:I" .. os.args(path.translate(dir))}, "cxflags", {flagskey = "cl_external_includedir"}) then
+ has_external_includedir = 2 -- full support
+ elseif self:has_flags({"-experimental:external", "-external:W0", "-external:I" .. os.args(path.translate(dir))}, "cxflags", {flagskey = "cl_external_includedir_experimental"}) then
+ has_external_includedir = 1 -- experimental support
end
- has_external_includedir = has_external_includedir or false
+ has_external_includedir = has_external_includedir or 0
_g._HAS_EXTERNAL_INCLUDEDIR = has_external_includedir
end
- if has_external_includedir then
+ if has_external_includedir >= 2 then
+ return {"-external:W0", "-external:I" .. path.translate(dir)}
+ elseif has_external_includedir >= 1 then
return {"-experimental:external", "-external:W0", "-external:I" .. path.translate(dir)}
else
return nf_includedir(self, dir)