I am trying to add a new pass to the llvm compiler infrastructure. I have been able to build LLVM-2.9 using make.But I wants to build using Eclipse so that I can trace the code. I imported llvm source files to c++ project with LinuxGcc tool chain and CDT internal builder(Eclipse with CDT-7.0).But it gives some errors. Is this is a right way to build llvm using eclipse?. Please suggest me steps involved to build llvm source using Eclipse. Note: Platform ubuntu.
Tools/versions used by me:
Create a folder for CDT project files in your workspace. I.e. workspace/llvm.
Generate CDT project files with cmake (being in workspace/llvm):
cmake -G "Eclipse CDT4 - Unix Makefiles" -D_ECLIPSE_VERSION=4.3 ../../src/llvm
If eclipse version is not set the generator will assume 3.7 and inform you that it can be changed by CMAKE_ECLIPSE_VERSION option, what turns out to be the wrong name for that option.
Increase eclipse heap allocation size. The default setting is too small and C++ Indexer would hang the whole IDE. Replace default settings with
-Xms512m
-Xmx1024m
in eclipse.ini file.
Import the project into your workspace. File → Import... → General → Existing Projects into Workspace.
llvm can be built as one (option Build Project). There are also separated targets created for every lib and executable, placed in [Targets] folder. Individual target can be built with option Make Targets → Build...You can use cmake -G"Eclipse CDT4 - Unix Makefiles" to produce the native Eclipse set of projects. It might require tweaking your CMakeLists.txt to remove the check for in-source builds (since Eclipse can only support project files and sources in the same directory, but for some reason the current CMakeLists allows it for MSVS only) - just follow the error messages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With