Skip to content
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

Made FindLibClang.cmake resiliant to homebrew llvm updates. #160

Closed
wants to merge 1 commit into from
Closed

Made FindLibClang.cmake resiliant to homebrew llvm updates. #160

wants to merge 1 commit into from

Conversation

DavidTruby
Copy link

A recent homebrew llvm update broke the building of the server (since the llvm version changed to 3.5.0_2). However, I noticed that homebrew provides version independent paths to the llvm includes and libraries, so switching to these should fix not only this update but remove the need to update FindLibClang for similar homebrew llvm updates in the future.

@Sarcasm
Copy link
Owner

Sarcasm commented Jan 14, 2015

I actually would like to use llvm-config[-VERSION] instead of the default Homebrew prefixes, see #138 (comment)

Also I'm curious whether or not homebrew provides the CMake packages for LLVM, do you have LLVMConfig.cmake (not LLVM-Config.cmake) in /usr/local/Cellar/llvm35/3.5.0/lib/llvm-3.5?

What I have in mind is to look for llvm-config by default and potentially the user could specify the version to CMake (e.g: cmake -DLLVM_CONFIG=llvm-config-3.5 <args...>).

@DavidTruby
Copy link
Author

LLVMConfig.cmake is there, it's in the path /usr/local/Cellar/llvm/3.5.0_2/share/llvm/cmake/LLVMConfig.cmake.

I think the issue with looking at llvm-config --version is that that reports 3.5.0, but the current package is actually unpacked in 3.5.0_2, so it wouldn't be possible to use that to look for the path it's unpacked at.

Homebrew also doesn't put llvm-config in the user's path so you still have the issue of having to look for that. I guess it might be possible to look at the paths returned by brew list llvm? I have no idea how complicated that will be.

@Sarcasm
Copy link
Owner

Sarcasm commented Jan 14, 2015

Yeah the homebrew package is installed in 3.5.0_2, that's maybe what llvm-config --prefix returns. But what is the version of the clang directory present in the llvm install prefix lib/clang/<VERSION>.
What's the output of ls -Rd $(llvm-config --prefix)?

@DavidTruby
Copy link
Author

Yeah llvm-config --prefix does return the correct path. The only issue is llvm-config not being put in the path by homebrew, but I guess you can look it up in /usr/local/opt/llvm/bin/llvm-config?

ls -Rd $(/usr/local/opt/llvm/bin/llvm-config --prefix) does return the correct path to llvm though. The clang path is lib/clang/3.5.0 so it's not the same as the llvm one annoyingly.

@DavidTruby DavidTruby closed this Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants