llvm.org GIT mirror llvm / b34f2ee
[CMake] Change the default value of LLVM_ENABLE_IDE There really aren't any generator behaviors that we need to take `CMAKE_EXTRA_GENERATOR` into account for. Where we need to take different behaviors for IDEs is mostly in enabling or disabling certain build system features that are optional but trip up the IDE UIs. Like the generation of lots of utility targets. By changing the LLVM_ENABLE_IDE default to only being on for multi-configuration generators, we allow gating where it will impact the UI presentation, while also supporting optionally disabling the generation if your tooling workflow encounters problems. Presently being able to manually disable extra target generation is useful for Visual Studio 2017's CMake integration where the IDE has trouble displaying and working with the large number of optional targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344553 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Bieneman 1 year, 1 day ago
1 changed file(s) with 13 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
867867 set(LLVM_ENABLE_PLUGINS ON)
868868 endif()
869869
870 # Remove LLVM_ENABLE_IDE from the CMake cache. This is a temporary change to
871 # allow CMake caches to be cleaned up so that we can change the default for this
872 # option and how it is used.
873 unset(LLVM_ENABLE_IDE CACHE)
874 #set(LLVM_ENABLE_IDE_default OFF)
875 #if (XCODE OR MSVC_IDE OR CMAKE_EXTRA_GENERATOR)
876 # set(LLVM_ENABLE_IDE_default ON)
877 #endif()
878 #option(LLVM_ENABLE_IDE "Generate targets and process sources for use with an IDE"
879 # ${LLVM_ENABLE_IDE_default})
870 # By default we should enable LLVM_ENABLE_IDE only for multi-configuration
871 # generators. This option disables optional build system features that make IDEs
872 # less usable.
873 set(LLVM_ENABLE_IDE_default OFF)
874 if (CMAKE_CONFIGURATION_TYPES)
875 set(LLVM_ENABLE_IDE_default ON)
876 endif()
877 option(LLVM_ENABLE_IDE
878 "Disable optional build system features that cause problems for IDE generators"
879 ${LLVM_ENABLE_IDE_default})
880 if (CMAKE_CONFIGURATION_TYPES AND NOT LLVM_ENABLE_IDE)
881 message(WARNING "Disabling LLVM_ENABLE_IDE on multi-configuration generators is not recommended.")
882 endif()
880883
881884 function(get_compile_definitions)
882885 get_directory_property(top_dir_definitions DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)