summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-04-23 00:58:48 +0800
committerruki <[email protected]>2022-04-23 00:58:48 +0800
commitfaef14c93d6ba55f65eed03d560282715eedacca (patch)
tree30d165fac46b47255a6ff5087d40b2ee62e93a6f
parent567d04c515cb241e8ca0caff53dcb4e31f4688b9 (diff)
we use cl languages instead of clang-cl
-rw-r--r--xmake/modules/core/tools/cl.lua1
-rw-r--r--xmake/modules/core/tools/clang_cl.lua60
2 files changed, 1 insertions, 60 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index 2526536c4..b09a8ebd8 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -189,6 +189,7 @@ function nf_vectorext(self, extension)
end
-- make the language flag
+-- clang-cl should also use it, @see https://github.com/xmake-io/xmake/issues/2211#issuecomment-1083322178
function nf_language(self, stdname)
-- the stdc maps
diff --git a/xmake/modules/core/tools/clang_cl.lua b/xmake/modules/core/tools/clang_cl.lua
index 1602b0ac8..be4f6d947 100644
--- a/xmake/modules/core/tools/clang_cl.lua
+++ b/xmake/modules/core/tools/clang_cl.lua
@@ -102,66 +102,6 @@ function nf_optimize(self, level)
return maps[level]
end
--- make the language flag
-function nf_language(self, stdname)
-
- -- the stdc maps
- if _g.cmaps == nil then
- _g.cmaps =
- {
- -- stdc
- ansi = "-Xclang -ansi"
- , c89 = "-Xclang -std=c89"
- , gnu89 = "-Xclang -std=gnu89"
- , c99 = "-Xclang -std=c99"
- , gnu99 = "-Xclang -std=gnu99"
- , c11 = "-Xclang -std=c11"
- , gnu11 = "-Xclang -std=gnu11"
- , c17 = "-Xclang -std=c17"
- , gnu17 = "-Xclang -std=gnu17"
- , clatest = "-Xclang -std=c17"
- , gnulatest = "-Xclang -std=gnu17"
- }
- end
-
- -- the stdc++ maps
- if _g.cxxmaps == nil then
- _g.cxxmaps =
- {
- cxx98 = "-Xclang -std=c++98"
- , gnuxx98 = "-Xclang -std=gnu++98"
- , cxx11 = "-Xclang -std=c++11"
- , gnuxx11 = "-Xclang -std=gnu++11"
- , cxx14 = "-Xclang -std=c++14"
- , gnuxx14 = "-Xclang -std=gnu++14"
- , cxx17 = "-Xclang -std=c++17"
- , gnuxx17 = "-Xclang -std=gnu++17"
- , cxx1z = "-Xclang -std=c++1z"
- , gnuxx1z = "-Xclang -std=gnu++1z"
- , cxx20 = "-Xclang -std=c++20"
- , gnuxx20 = "-Xclang -std=gnu++20"
- , cxx2a = "-Xclang -std=c++2a"
- , gnuxx2a = "-Xclang -std=gnu++2a"
- , cxxlatest = "-Xclang -std=c++latest"
- , gnuxxlatest = "-Xclang -std=gnu++latest"
- }
- local cxxmaps2 = {}
- for k, v in pairs(_g.cxxmaps) do
- cxxmaps2[k:gsub("xx", "++")] = v
- end
- table.join2(_g.cxxmaps, cxxmaps2)
- end
-
- -- select maps
- local maps = _g.cmaps
- if self:kind() == "cxx" or self:kind() == "mxx" then
- maps = _g.cxxmaps
- end
-
- -- make it
- return maps[stdname]
-end
-
-- compile the source file
function compile(self, sourcefile, objectfile, dependinfo, flags)