-
Notifications
You must be signed in to change notification settings - Fork 146
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
Does not build on Linux #336
Comments
$ grep add_library /usr/lib/llvm/*/lib64/cmake/clang/ClangTargets.cmake
/usr/lib/llvm/13/lib64/cmake/clang/ClangTargets.cmake:add_library(clang-cpp SHARED IMPORTED)
/usr/lib/llvm/13/lib64/cmake/clang/ClangTargets.cmake:add_library(libclang SHARED IMPORTED)
/usr/lib/llvm/14/lib64/cmake/clang/ClangTargets.cmake:add_library(clang-cpp SHARED IMPORTED)
/usr/lib/llvm/14/lib64/cmake/clang/ClangTargets.cmake:add_library(libclang SHARED IMPORTED) |
Please revert fe454e0 |
See #244. |
You'll need to build https://github.com/llvm/llvm-project/tree/llvmorg-14.0.0 locally to get access to the required lib packages given they are not distributed by default in all distros or Operating Systems. While linking against |
No, I don't. There was a test in #244, which prefers clang-cpp library, so linking was conditional thus making no problems for other platforms or clang builds with other options enabled. If you want to prefer the other library set, let's invert the test: |
Dealing with Referencing The simpler thing is to simply require devs to compile |
I'm afraid you are mistaken about the packaging process for Linux distributions: we strongly prefer dynamic libraries over static ones. I doubt you can find any distro without the clang-cpp .so library. Neither can I understand the mentioned problems. Referencing the clang-cpp library was under conditional test (if (TARGET clang-cpp)), thus the library has to be available to the linker when the test passes. Could you elaborate on the problems, please?
clangAST and clangFrontend are static libs, clang-cpp is the dynamic one. |
Available when the linker runs and not available at runtime for people wanting to just install a .NET tool (ClangSharpPInvokeGenerator) and then run it.
Yes. The point is that It should be sufficient to merely distribute Having |
Ah, so that's what you want! Statically linked binaries! Thank you, now I understand. Then I figure we can replace the test for clang-cpp target with the opposite one for clangAST and clangFrontend and prefer them when they are available. I can submit a PR with the required changes to the CMake build script and I would appreciate if you share with me with the ClangTargets.cmake file from the Windows build of clang with the clangAST & clangFrontend static libraries, please. |
Pardon, found one online. |
Linux distributions prefer dynamic libraries but we'd like to link to Clang statically. Therefore we return the test for clang targets but extend it to prefer static Clang libraries and fall back to the clang-cpp library when the static ones are unavailable. Fixes dotnet#336.
Add build option to control which type of clang libraries (shared or static) link to. Fixes dotnet#336.
On Gentoo the build fails with:
Both libraries do not exist in my system.
The text was updated successfully, but these errors were encountered: