Specify log level for CMake messages (less stderr)

Summary:
Specify message levels in CMake. Prefer STATUS (stdout).

As the default message mode (i.e. level) is NOTICE in CMake, more then necessary messages get printed to stderr. Some tools,  noticably ccmake treat this as an error and require additional confirmation and re-running CMake's configuration step.

This commit specifies a mode (either STATUS or WARNING or FATAL_ERROR)  instead of the default.

* I used `csearch -f 'llvm-project/.+(CMakeLists\.txt|cmake)' -l 'message\("'` to find all locations.
* Reviewers were chosen by the most common authors of specific files. If there are more suitable reviewers for these CMake changes, please let me know.

Patch by: Christoph Siedentop

Reviewers: zturner, beanz, xiaobai, kbobyrev, lebedev.ri, sgraenitz

Reviewed By: sgraenitz

Subscribers: mgorny, lebedev.ri, #sanitizers, lldb-commits, llvm-commits

Tags: #sanitizers, #lldb, #llvm

Differential Revision: https://reviews.llvm.org/D63370

llvm-svn: 363821
This commit is contained in:
Stefan Granitz 2019-06-19 15:25:32 +00:00
parent 1ad10137c9
commit f2ffa7320e
4 changed files with 14 additions and 14 deletions

View File

@ -410,8 +410,8 @@ macro(darwin_add_embedded_builtin_libraries)
INCLUDE ${arch}_FUNCTIONS
${${arch}_SOURCES})
if(NOT ${arch}_filtered_sources)
message("${arch}_SOURCES: ${${arch}_SOURCES}")
message("${arch}_FUNCTIONS: ${${arch}_FUNCTIONS}")
message(WARNING "${arch}_SOURCES: ${${arch}_SOURCES}")
message(WARNING "${arch}_FUNCTIONS: ${${arch}_FUNCTIONS}")
message(FATAL_ERROR "Empty filtered sources!")
endif()
endforeach()

View File

@ -128,7 +128,7 @@ endif()
# addresses them, but it can be improved and extended on an as-needed basis.
function(find_python_libs_windows)
if ("${PYTHON_HOME}" STREQUAL "")
message("LLDB embedded Python on Windows requires specifying a value for PYTHON_HOME. Python support disabled.")
message(WARNING "LLDB embedded Python on Windows requires specifying a value for PYTHON_HOME. Python support disabled.")
set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)
return()
endif()
@ -140,12 +140,12 @@ function(find_python_libs_windows)
REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"+]+)[+]?\".*" "\\1"
PYTHONLIBS_VERSION_STRING "${python_version_str}")
message("-- Found Python version ${PYTHONLIBS_VERSION_STRING}")
message(STATUS "Found Python version ${PYTHONLIBS_VERSION_STRING}")
string(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.][0-9]+" "python\\1\\2" PYTHONLIBS_BASE_NAME "${PYTHONLIBS_VERSION_STRING}")
unset(python_version_str)
else()
message("Unable to find ${PYTHON_INCLUDE_DIR}/patchlevel.h, Python installation is corrupt.")
message("Python support will be disabled for this build.")
message(WARNING "Unable to find ${PYTHON_INCLUDE_DIR}/patchlevel.h, Python installation is corrupt.")
message(WARNING "Python support will be disabled for this build.")
set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)
return()
endif()
@ -165,13 +165,13 @@ function(find_python_libs_windows)
foreach(component PYTHON_EXE;PYTHON_LIB;PYTHON_DLL)
if(NOT EXISTS ${${component}})
message("unable to find ${component}")
message(WARNING "unable to find ${component}")
unset(${component})
endif()
endforeach()
if (NOT PYTHON_EXE OR NOT PYTHON_LIB OR NOT PYTHON_DLL)
message("Unable to find all Python components. Python support will be disabled for this build.")
message(WARNING "Unable to find all Python components. Python support will be disabled for this build.")
set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)
return()
endif()
@ -181,10 +181,10 @@ function(find_python_libs_windows)
set (PYTHON_DLL ${PYTHON_DLL} PARENT_SCOPE)
set (PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR} PARENT_SCOPE)
message("-- LLDB Found PythonExecutable: ${PYTHON_EXE}")
message("-- LLDB Found PythonLibs: ${PYTHON_LIB}")
message("-- LLDB Found PythonDLL: ${PYTHON_DLL}")
message("-- LLDB Found PythonIncludeDirs: ${PYTHON_INCLUDE_DIR}")
message(STATUS "LLDB Found PythonExecutable: ${PYTHON_EXE}")
message(STATUS "LLDB Found PythonLibs: ${PYTHON_LIB}")
message(STATUS "LLDB Found PythonDLL: ${PYTHON_DLL}")
message(STATUS "LLDB Found PythonIncludeDirs: ${PYTHON_INCLUDE_DIR}")
endfunction(find_python_libs_windows)
if (NOT LLDB_DISABLE_PYTHON)

View File

@ -95,7 +95,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
endif()
else()
message("-- Found PythonInterp: ${PYTHON_EXECUTABLE}")
message(STATUS "Found PythonInterp: ${PYTHON_EXECUTABLE}")
endif()
set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")

View File

@ -12,7 +12,7 @@ function(install_symlink name target outdir)
set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")
message("Creating ${name}")
message(STATUS "Creating ${name}")
execute_process(
COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "${target}" "${name}"