diff --git a/CMakeLists.txt b/CMakeLists.txt index 162944a26..351628046 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,7 +103,11 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) endif() if (LLVM_PACKAGE_VERSION VERSION_LESS LLVM_MIN_SUPPORTED OR LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL LLVM_VERSION_UPPER_BOUND) - message(FATAL_ERROR "Found unsupported version: LLVM ${LLVM_PACKAGE_VERSION};\nPlease set LLVM_DIR pointing to the llvm version ${LLVM_MIN_SUPPORTED} to ${LLVM_MAX_SUPPORTED} build or installation folder") + set(diag_kind FATAL_ERROR) + if (CMAKE_BUILD_TYPE STREQUAL "Debug") + set(diag_kind WARNING) + endif() + message(${diag_kind} "Found unsupported version: LLVM ${LLVM_PACKAGE_VERSION};\nPlease set LLVM_DIR pointing to the llvm version ${LLVM_MIN_SUPPORTED} to ${LLVM_MAX_SUPPORTED} build or installation folder") endif() message(STATUS "Found supported version: LLVM ${LLVM_PACKAGE_VERSION}") @@ -136,7 +140,11 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) endif() if (LLVM_PACKAGE_VERSION VERSION_LESS CLANG_MIN_SUPPORTED OR LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL CLANG_VERSION_UPPER_BOUND) - message(FATAL_ERROR "Found unsupported version: Clang ${LLVM_PACKAGE_VERSION};\nPlease set Clang_DIR pointing to the clang version ${CLANG_MIN_SUPPORTED} to ${CLANG_MAX_SUPPORTED} build or installation folder") + set(diag_kind FATAL_ERROR) + if (CMAKE_BUILD_TYPE STREQUAL "Debug") + set(diag_kind WARNING) + endif() + message(${diag_kind} "Found unsupported version: Clang ${LLVM_PACKAGE_VERSION};\nPlease set Clang_DIR pointing to the clang version ${CLANG_MIN_SUPPORTED} to ${CLANG_MAX_SUPPORTED} build or installation folder") endif() message(STATUS "Found supported version: Clang ${LLVM_PACKAGE_VERSION}")