[llvm-dev] llvm-config output on MacOS

S. Bharadwaj Yadavalli via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 15 16:26:35 PST 2017


Thanks, Matthias. That is indeed a good suggestion.

I've been favoring Xcode on macros simply because of the code
cross-referencing and completion I get out of the box for llvm sources,
shortening the time I spend for dev and digging into llvm internals.

On Linux,  I plow through with a less than seemless dev environment that is
a combination of Eclipse (couldn't get it to work well with llvm sources),
emacs, grep, find, [crt]tags etc :-(

Happy to hear any suggestions on this slightly divergent topic.

Thanks,

Bharadwaj


On Dec 15, 2017 2:49 PM, "Matthias Braun" <mbraun at apple.com> wrote:

I'm not saying there isn't a bug here.

But I think most llvm developers use
$ cmake -GNinja ...
$ ninja
even on macos. So unless you need an xcode project I would recomment that.

- Matthias

On Dec 15, 2017, at 2:28 PM, S. Bharadwaj Yadavalli via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

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


_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171215/6df6d988/attachment.html>


More information about the llvm-dev mailing list