llvm.org GIT mirror llvm / 2f1f9f8
[CMake] Use LLVM_ENABLE_IDE instead of CMAKE_CONFIGURATION_TYPES There are several places where we use CMAKE_CONFIGURATION_TYPES to determine if we are using an IDE generator and in turn decide not to generate some of the convenience targets (like all the install-* and check-llvm-* targets). This decision is made because IDEs don't always deal well with the thousands of targets LLVM can generate. This approach does not work for Visual Studio 15's new CMake integration. Because VS15 uses a Ninja generator, it isn't a multi-configuration build, and generating all these extra targets mucks up the UI and adds little value. With this change we still don't generate these targets by default for Visual Studio and Xcode generators, and LLVM_ENABLE_IDE becomes a switch that can be enabled on the VS15 CMake builds, to improve the IDE experience. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340435 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Bieneman 1 year, 2 days ago
4 changed file(s) with 10 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
975975 add_custom_target(llvm-headers DEPENDS intrinsics_gen)
976976 set_target_properties(llvm-headers PROPERTIES FOLDER "Misc")
977977
978 if (NOT CMAKE_CONFIGURATION_TYPES)
978 if (NOT LLVM_ENABLE_IDE)
979979 add_llvm_install_targets(install-llvm-headers
980980 DEPENDS llvm-headers
981981 COMPONENT llvm-headers)
985985 # This must be at the end of the LLVM root CMakeLists file because it must run
986986 # after all targets are created.
987987 if(LLVM_DISTRIBUTION_COMPONENTS)
988 if(CMAKE_CONFIGURATION_TYPES)
988 if(LLVM_ENABLE_IDE)
989989 message(FATAL_ERROR "LLVM_DISTRIBUTION_COMPONENTS cannot be specified with multi-configuration generators (i.e. Xcode or Visual Studio)")
990990 endif()
991991
658658 ${install_type} DESTINATION ${install_dir}
659659 COMPONENT ${name})
660660
661 if (NOT CMAKE_CONFIGURATION_TYPES)
661 if (NOT LLVM_ENABLE_IDE)
662662 add_llvm_install_targets(install-${name}
663663 DEPENDS ${name}
664664 COMPONENT ${name})
889889 RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}
890890 COMPONENT ${name})
891891
892 if (NOT CMAKE_CONFIGURATION_TYPES)
892 if (NOT LLVM_ENABLE_IDE)
893893 add_llvm_install_targets(install-${name}
894894 DEPENDS ${name}
895895 COMPONENT ${name})
927927 install (TARGETS ${name}
928928 RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
929929 COMPONENT ${name})
930 if (NOT CMAKE_CONFIGURATION_TYPES)
930 if (NOT LLVM_ENABLE_IDE)
931931 add_llvm_install_targets(install-${name}
932932 DEPENDS ${name}
933933 COMPONENT ${name})
13771377 endfunction()
13781378
13791379 function(add_lit_testsuites project directory)
1380 if (NOT CMAKE_CONFIGURATION_TYPES)
1380 if (NOT LLVM_ENABLE_IDE)
13811381 cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
13821382
13831383 # Search recursively for test directories by assuming anything not
14361436 CODE "install_symlink(${full_name} ${full_dest} ${output_dir})"
14371437 COMPONENT ${component})
14381438
1439 if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE)
1439 if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE)
14401440 add_llvm_install_targets(install-${name}
14411441 DEPENDS ${name} ${dest} install-${dest}
14421442 COMPONENT ${name})
14691469 CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})"
14701470 COMPONENT ${component})
14711471
1472 if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE)
1472 if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE)
14731473 add_llvm_install_targets(install-${name}
14741474 DEPENDS ${name} ${dest} install-${dest}
14751475 COMPONENT ${name})
131131 PATTERN LLVM-Config.cmake EXCLUDE
132132 PATTERN GetHostTriple.cmake EXCLUDE)
133133
134 if (NOT CMAKE_CONFIGURATION_TYPES)
134 if (NOT LLVM_ENABLE_IDE)
135135 # Add a dummy target so this can be used with LLVM_DISTRIBUTION_COMPONENTS
136136 add_custom_target(cmake-exports)
137137 add_llvm_install_targets(install-cmake-exports
9999 PREFIX ${LLVMToolchainDir}/usr/)
100100
101101 if(LLVM_DISTRIBUTION_COMPONENTS)
102 if(CMAKE_CONFIGURATION_TYPES)
102 if(LLVM_ENABLE_IDE)
103103 message(FATAL_ERROR "LLVM_DISTRIBUTION_COMPONENTS cannot be specified with multi-configuration generators (i.e. Xcode or Visual Studio)")
104104 endif()
105105