aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorChris Bieneman <chris.bieneman@me.com>2018-10-15 21:14:19 +0000
committerChris Bieneman <chris.bieneman@me.com>2018-10-15 21:14:19 +0000
commitb34f2ee301ef507dacf1984181f87048cd81b9b6 (patch)
treef86823d26d52fc552238933dbe20f39ab6f9b295 /cmake
parentbea8b730d34af6991a91a4fe563234c5ea6eeabc (diff)
[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
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake23
1 files changed, 13 insertions, 10 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index 85aebf6ed71..27875781d22 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -868,16 +868,19 @@ else()
set(LLVM_ENABLE_PLUGINS ON)
endif()
-# Remove LLVM_ENABLE_IDE from the CMake cache. This is a temporary change to
-# allow CMake caches to be cleaned up so that we can change the default for this
-# option and how it is used.
-unset(LLVM_ENABLE_IDE CACHE)
-#set(LLVM_ENABLE_IDE_default OFF)
-#if (XCODE OR MSVC_IDE OR CMAKE_EXTRA_GENERATOR)
-# set(LLVM_ENABLE_IDE_default ON)
-#endif()
-#option(LLVM_ENABLE_IDE "Generate targets and process sources for use with an IDE"
-# ${LLVM_ENABLE_IDE_default})
+# By default we should enable LLVM_ENABLE_IDE only for multi-configuration
+# generators. This option disables optional build system features that make IDEs
+# less usable.
+set(LLVM_ENABLE_IDE_default OFF)
+if (CMAKE_CONFIGURATION_TYPES)
+ set(LLVM_ENABLE_IDE_default ON)
+endif()
+option(LLVM_ENABLE_IDE
+ "Disable optional build system features that cause problems for IDE generators"
+ ${LLVM_ENABLE_IDE_default})
+if (CMAKE_CONFIGURATION_TYPES AND NOT LLVM_ENABLE_IDE)
+ message(WARNING "Disabling LLVM_ENABLE_IDE on multi-configuration generators is not recommended.")
+endif()
function(get_compile_definitions)
get_directory_property(top_dir_definitions DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)