I can't use the llvm
downloaded from HomeBrew (Ubuntu-22.04) to build the project!
#2870
Replies: 3 comments
-
try |
Beta Was this translation helpful? Give feedback.
-
sorry I cant because this is a CPP project and it cannot be compiled by Clang15, but could be compiled by Clang++15, which is not contained in the xmake supported toolchains |
Beta Was this translation helpful? Give feedback.
-
No, clang can also compile c++ code, clang++ and clang are basically the same, the only difference is that when using clang++ as a linker, it will automatically add some built-in c++ library links, such as -lstdc++ xmake compiles c++ code with gcc/clang by default, and it always works fine with g++/clang++ as a c++ linker. BTW, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Xmake 版本
2.7.1
操作系统版本和架构
Ubuntu-22.04
描述问题
Hi there! The problem is, Xmake cannot detect the
llvm
toolchain even if I have already installedllvm-15
(which includesclang-15
,clang++-15
,lldb-15
) viaHomeBrew
And I've already exported the PATH (
Here's what I have done:
$ export PATH="$(brew --prefix llvm)/bin:${PATH}"
)
Hope you could solve this issus ASAP! Sincerely thanks! :-)
期待的结果
I hope that I could build the project in
llvm
toolchain (using the one I've downloaded from HomeBrew) correctly!工程配置
add_rules("mode.debug", "mode.release")
target("ModernCppLearning")
set_kind("binary")
add_files("src/*.cpp")
set_languages("clatest", "gnu++latest")
附加信息和错误日志
error: @programdir/core/main.lua:280: @programdir/core/tool/toolchain.lua:263: @programdir/toolchains/llvm/check.lua:90: llvm toolchain not found!
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:882]:
[@programdir/toolchains/llvm/check.lua:90]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:280]:
[@programdir/core/tool/toolchain.lua:259]: in function 'check'
[@programdir/core/platform/platform.lua:247]: in function 'check'
[@programdir/actions/config/main.lua:400]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:280]:
[@programdir/core/base/task.lua:501]: in function 'run'
[@programdir/core/main.lua:278]: in function 'cotask'
[@programdir/core/base/scheduler.lua:388]:
stack traceback:
[C]: in function 'error'
@programdir/core/base/os.lua:882: in function 'base/os.raiselevel'
(...tail calls...)
@programdir/core/main.lua:280: in upvalue 'cotask'
@programdir/core/base/scheduler.lua:388: in function <@programdir/core/base/scheduler.lua:385>
Beta Was this translation helpful? Give feedback.
All reactions