How to build LLVM source code on Eclipse?

无人久伴 提交于 2019-12-04 13:19:17

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.

  1. Tools/versions used by me:

    • eclipse 4.3 Kepler, CDT 8.2.1
    • Oracle Java SDK 1.7.0_45
    • cmake 2.8.11.2
    • LLVM 3.5svn
  2. Create a folder for CDT project files in your workspace. I.e. workspace/llvm.

  3. 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.

  4. 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.

  5. Import the project into your workspace. File → Import... → General → Existing Projects into Workspace.

  6. The project 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...
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!