Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
501 views
in Technique[技术] by (71.8m points)

llvm - How build clang-tools? "make clang-tools" does nothing

I succesfully checked-out llvm (v12) project and built llvm+clang invoking:

cmake -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" ../llvm
make check-all

After this operation empty clang-tools directory appeared. After calling make clang it remains empty. When I call make clang-tools it does nothing - there is a target with this name because there is no error info about missing target but the command doesn't do nor print anything. On the other hand, when I try make clang-tools-extra it complains that there is no such project despite the fact that I configured it with cmake. So I'm also unable to build clang-tools-extra.

What am I doing wrong?

update: There is no CMakeFiles directory in llvm/clang/tools which is - I think - unexpected.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Find the list of targets in the output of ninja help or make help or xcodebuild -list or any other generator.

A project's external name can very well be different from the internal target name.

If you want to build everything, just set the install prefix:

cmake -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" ../llvm -DCMAKE_INSTALL_PREFIX=../my_install

and run make install

It will do the right thing.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...