diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -64,8 +64,15 @@ endif() if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "No build type selected, default to Debug") - set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (default Debug)" FORCE) + message(FATAL_ERROR " +No build type selected. You need to pass -DCMAKE_BUILD_TYPE= in order to configure LLVM. +Available options are: + * -DCMAKE_BUILD_TYPE=Release - For an optimized build with no assertions or debug info. + * -DCMAKE_BUILD_TYPE=Debug - For an unoptimized build with assertions and debug info. + * -DCMAKE_BUILD_TYPE=RelWithDebInfo - For an optimized build with no assertions but with debug info. + * -DCMAKE_BUILD_TYPE=MinSizeRel - For a build optimized for size instead of speed. +Learn more about these options in our documentation at https://llvm.org/docs/CMake.html +") endif() # Side-by-side subprojects layout: automatically set the @@ -1252,11 +1259,11 @@ set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Don't install benchmark" FORCE) set(BENCHMARK_DOWNLOAD_DEPENDENCIES OFF CACHE BOOL "Don't download dependencies" FORCE) set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Disable Google Test in benchmark" FORCE) - set(BENCHMARK_ENABLE_WERROR ${LLVM_ENABLE_WERROR} CACHE BOOL + set(BENCHMARK_ENABLE_WERROR ${LLVM_ENABLE_WERROR} CACHE BOOL "Handle -Werror for Google Benchmark based on LLVM_ENABLE_WERROR" FORCE) # Since LLVM requires C++11 it is safe to assume that std::regex is available. set(HAVE_STD_REGEX ON CACHE BOOL "OK" FORCE) - add_subdirectory(${LLVM_THIRD_PARTY_DIR}/benchmark + add_subdirectory(${LLVM_THIRD_PARTY_DIR}/benchmark ${CMAKE_CURRENT_BINARY_DIR}/third-party/benchmark) add_subdirectory(benchmarks) endif() diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -69,6 +69,14 @@ Changes to building LLVM ------------------------ +* Omitting ``CMAKE_BUILD_TYPE`` when using a single configuration generator is now + an error. You now have to pass ``-DCMAKE_BUILD_TYPE=`` in order to configure + LLVM. This is done to help new users of LLVM select the correct type, since building + LLVM in Debug mode is very resource intensive we want to make sure that new users + makes the choice that lines up with their usage. We have also improved documentation + around this setting that should help new users, you can find this documentation + `here `_. + Changes to TableGen -------------------