This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Add LLVM_ENABLE_IDE option to better process sources for IDE's
ClosedPublic

Authored by EricWF on Nov 18 2017, 3:54 PM.

Details

Summary

Currently LLVM has no way to support configuring for IDE's like CLion. Like XCode and MSVC's IDE, CLion needs to see all of the headers and tablegen files in order to properly parse the sources.

This patch adds an LLVM_ENABLE_IDE option which can be used to configure for IDE's in general. It is used by LLVMProcessSources.cmake to determine if the extra source files should be added to the target.

Unfortunately because of the low level of LLVMProcessSources.cmake, I'm not sure where the LLVM_ENABLE_IDE option should live. I choose HandleLLVMOptions.cmake so that out-of-tree Clang builds would correctly configure the option by default.

Diff Detail

Event Timeline

EricWF created this revision.Nov 18 2017, 3:54 PM
lebedev.ri edited edge metadata.Nov 21 2017, 12:48 PM

Looks good to me, but i have no prior involvement in llvm cmake build system so i'm not sure i can/should Accept this Revision.

cmake/modules/HandleLLVMOptions.cmake
853

When using qtcreator, which results in extra generator being used, the LLVM_ENABLE_IDE option is correctly default-on, which is great.

cmake/modules/LLVMProcessSources.cmake
55

Or do we want to rely on LLVM_ENABLE_IDE?

beanz accepted this revision.Nov 27 2017, 10:10 AM

One comment below. Otherwise LGTM.

cmake/modules/LLVMProcessSources.cmake
55

This should just be if(LLVM_ENABLE_IDE) because MSVC_IDE and XCODE are checked when setting the default for that variable.

This revision is now accepted and ready to land.Nov 27 2017, 10:10 AM
EricWF updated this revision to Diff 129574.Jan 11 2018, 8:00 PM
EricWF marked an inline comment as done.
  • Address inline comments.
EricWF closed this revision.Jan 11 2018, 8:02 PM