Skip to content

Commit d0b58de

Browse files
authored
Merge pull request #6801 from bugsnotabunny/bugsnotabunny/fix-compilers-priority
Change compilers priority for gcc and clang
2 parents a4b5e56 + 64102cc commit d0b58de

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

xmake/modules/core/tools/gcc.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ function nf_pcheader(self, pcheaderfile, opt)
841841
if self:kind() == "cc" then
842842
local target = opt.target
843843
local pcoutputfile = target:pcoutputfile("c")
844-
if self:name() == "clang" then
844+
if self:name():startswith("clang") then
845845
return {"-include", pcheaderfile, "-include-pch", pcoutputfile}
846846
else
847847
return {"-I", path.directory(pcoutputfile), "-include", path.filename(pcheaderfile)}
@@ -854,7 +854,7 @@ function nf_pcxxheader(self, pcheaderfile, opt)
854854
if self:kind() == "cxx" then
855855
local target = opt.target
856856
local pcoutputfile = target:pcoutputfile("cxx")
857-
if self:name() == "clang" then
857+
if self:name():startswith("clang") then
858858
return {"-include", pcheaderfile, "-include-pch", pcoutputfile}
859859
else
860860
return {"-I", path.directory(pcoutputfile), "-include", path.filename(pcheaderfile)}

xmake/toolchains/clang/xmake.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ toolchain("clang" .. suffix)
3131
set_runtimes("c++_static", "c++_shared", "stdc++_static", "stdc++_shared")
3232

3333
set_toolset("cc", "clang" .. suffix)
34-
set_toolset("cxx", "clang" .. suffix, "clang++" .. suffix)
34+
set_toolset("cxx", "clang++" .. suffix, "clang" .. suffix)
3535
set_toolset("ld", "clang++" .. suffix, "clang" .. suffix)
3636
set_toolset("sh", "clang++" .. suffix, "clang" .. suffix)
3737
set_toolset("ar", "ar", "llvm-ar" .. suffix)
3838
set_toolset("strip", "strip", "llvm-strip" .. suffix)
3939
set_toolset("ranlib", "ranlib", "llvm-ranlib" .. suffix)
4040
set_toolset("objcopy", "objcopy", "llvm-objcopy" .. suffix)
4141
set_toolset("mm", "clang" .. suffix)
42-
set_toolset("mxx", "clang" .. suffix, "clang++" .. suffix)
42+
set_toolset("mxx", "clang++" .. suffix, "clang" .. suffix)
4343
set_toolset("as", "clang" .. suffix)
4444
set_toolset("mrc", "llvm-rc" .. suffix)
4545
set_toolset("dlltool", "llvm-dlltool" .. suffix)

xmake/toolchains/gcc/xmake.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ toolchain("gcc" .. suffix)
3131
set_runtimes("stdc++_static", "stdc++_shared")
3232

3333
set_toolset("cc", "gcc" .. suffix)
34-
set_toolset("cxx", "gcc" .. suffix, "g++" .. suffix)
34+
set_toolset("cxx", "g++" .. suffix, "gcc" .. suffix)
3535
set_toolset("ld", "g++" .. suffix, "gcc" .. suffix)
3636
set_toolset("sh", "g++" .. suffix, "gcc" .. suffix)
3737
set_toolset("ar", "ar")
3838
set_toolset("strip", "strip")
3939
set_toolset("objcopy", "objcopy")
4040
set_toolset("ranlib", "ranlib")
4141
set_toolset("mm", "gcc" .. suffix)
42-
set_toolset("mxx", "gcc" .. suffix, "g++" .. suffix)
42+
set_toolset("mxx", "g++" .. suffix, "gcc" .. suffix)
4343
set_toolset("as", "gcc" .. suffix)
4444

4545
on_check(function (toolchain)

xmake/toolchains/llvm/xmake.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ toolchain("llvm")
2525
set_runtimes("c++_static", "c++_shared", "stdc++_static", "stdc++_shared")
2626

2727
set_toolset("cc", "clang")
28-
set_toolset("cxx", "clang", "clang++")
29-
set_toolset("mxx", "clang", "clang++")
28+
set_toolset("cxx", "clang++", "clang")
29+
set_toolset("mxx", "clang++", "clang")
3030
set_toolset("mm", "clang")
3131
set_toolset("cpp", "clang -E")
3232
set_toolset("as", "clang")

0 commit comments

Comments
 (0)