Skip to content

Commit e65101c

Browse files
author
Dmitry Malakhov
committed
Change compilers priority for gcc and clang
Before this change xmake preferred to use clang and gcc for c++ code which caused build to fail with clang in my current setup
1 parent e6c0922 commit e65101c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

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)