DNG
DNG

Reputation: 649

how to make llvm project compile faster?

I'm a llvm new learner

after cmake -S llvm -B build -G Xcode -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi"

I got a llvm project, compiling the project is so slow

How to make it compile faster?

Ninja is an option.

777

from the build folder, I see libLLVMWindowsManifest.a

99999

i don't need windows platform version.

I just need X86 version

How to make the complier do less job, by avoid compiling unrelated CPU architecture?

Upvotes: 2

Views: 2282

Answers (1)

harry
harry

Reputation: 1095

-DLLVM_TARGETS_TO_BUILD="X86" is the flag you're looking for. But this alone won't speed up the build time significantly.

Play with CMAKE_BUILD_TYPE (-DCMAKE_BUILD_TYPE=Release/Debug/RelWithDebInfo/MinSizeRel) and see which suits you better. The default for CMAKE_BUILD_TYPE is Debug, and it's very slow.

If you want to debug builds, -DLLVM_OPTIMIZED_TABLEGEN=ON will improve your build time.

And finally, in my experience Ninja builds are slightly faster.

Upvotes: 9

Related Questions