[llvm-dev] llvm-config output on MacOS

S. Bharadwaj Yadavalli via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 15 14:28:24 PST 2017


Thanks for your reply, Paul.

That seems to be a plausible explanation.

I ended up adding code in my project to massage the output of llvm-config
to the right paths based of the values of CMAKE_GENERATOR and build-mode.

Bharadwaj


On Dec 15, 2017 9:46 AM, "Robinson, Paul" <paul.robinson at sony.com> wrote:

It may be that llvm-config simply doesn't understand a multi-configuration
build tree.  Ninja and make use single-configuration trees, XCode and
Visual Studio use multi-configuration.

--paulr



*From:* llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] *On Behalf Of *S.
Bharadwaj Yadavalli via llvm-dev
*Sent:* Thursday, December 14, 2017 10:24 PM
*To:* llvm-dev
*Subject:* [llvm-dev] llvm-config output on MacOS



Hi,



I configured and built LLVM as follows on Mac OS 10.13.2:



$ pwd

<llvm-build-dir>

$ cmake -G "Xcode" -DCMAKE_INSTALL_PREFIX=<llvm-install-dir>
-DLLVM_ENABLE_PIC=0 <llvm-src-dir>/llvm

$ xcodebuild -project LLVM.xcodeproj



All binaries are in <llvm-build-dir>/Debug/bin. I am interested in using
the output of llvm-config. Now, when I run



$ <llvm-build-dir>/Debug/bin/llvm-config --cmakedir

<llvm-build-dir>/Debug/lib/cmake/llvm



But,

$ ls -d `<llvm-build-dir>/Debug/bin/llvm-config --cmakedir`

ls: <llvm-build-dir>/Debug/lib/cmake/llvm: No such file or directory



instead I have



$ ls -d <llvm-build-dir>/lib/cmake

<llvm-build-dir>/lib/cmake



As seen above, the output of llvm-config --cmakedir returns a non-existent
directory. Took a quick look at the sources of llvm-config. Comment says
the tool is designed to support being run from both dev tree and install
path. Looks like the test to identify if the tool is being run from within
dev tree is not recognizing that the tool is indeed being run from dev tree.



Would anyone know what I am missing?



I do not see this behavior on Linux - probably since build binaries are
placed in <llvm-build-dir>/bin on Linux as opposed to
<llvm-build-dir>/<build-type>/bin on MacOS.



Thanks,



Bharadwaj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171215/a6b5d292/attachment.html>


More information about the llvm-dev mailing list