-
-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LLVM库无法引入 #6445
Comments
Title: LLVM library cannot be imported |
如果使用系统包管理的 llvm,可以直接 |
If you use llvm managed by the system package, you can directly use |
这样确实可以暂时解决引入llvm的问题,但是还是没解决 |
This can indeed temporarily solve the problem of introducing llvm, but it still does not solve the problem of |
cmake::xxx 是 hack 实现,大部分情况下不推荐使用。
llvm 每次 ci 全量构建都会浪费很多时间,而且还需要懂打包的人来处理才行,暂时没这么多精力。 |
cmake::xxx is a hack implementation and is not recommended in most cases.
llvm every time you build ci full amount, it will waste a lot of time, and it also requires people who know how to pack it to handle it. I don’t have so much energy for the time being. |
Xmake 版本
xmake v2.9.8+20250225
操作系统版本和架构
Linux 5.15.167.4-microsoft-standard-WSL2 ArchWSL2
描述问题
无法引入LLVM库。尝试了多种方法均无法实现,或者有其他bug,比如找不到系统头文件等。
使用
xrepo
时此时会报错:
删除
xmake.lua
中的add_packages
后就恢复正常了。此外,如果改为
components = 'clang'
就不会有这个warning,但是依然无法编译。使用
cmake
时此时运行
xmake build -vD
后会报错:然而,如果直接使用CMake:
cmake_minimum_required(VERSION 3.31.5) project(find_package) find_package(LLVM REQUIRED ) if(LLVM_FOUND) add_executable(test_LLVM test.cpp) message(STATUS "LLVM_INCLUDE_DIR: ${LLVM_INCLUDE_DIR}") target_include_directories(test_LLVM PRIVATE LLVM_INCLUDE_DIR LLVM_INCLUDE_DIRS LLVM_INCLUDE_DIR LLVM_INCLUDE_DIRS) target_include_directories(test_LLVM PRIVATE LLVM_CXX_INCLUDE_DIRS) target_link_libraries(test_LLVM PRIVATE LLVM_LIBRARY LLVM_LIBRARIES LLVM_LIBS LLVM_LIBRARY LLVM_LIBRARIES LLVM_LIBS) endif(LLVM_FOUND)
此时可以正常输出:
期待的结果
至少一项引入llvm的方式可用
工程配置
如上
附加信息和错误日志
如上
The text was updated successfully, but these errors were encountered: