Author: stefan.graenitz
Date: Wed Jun 19 08:25:32 2019
New Revision: 363821

URL: http://llvm.org/viewvc/llvm-project?rev=363821&view=rev
Log:
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

Modified:
    lldb/trunk/cmake/modules/LLDBConfig.cmake
    lldb/trunk/cmake/modules/LLDBStandalone.cmake

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=363821&r1=363820&r2=363821&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Wed Jun 19 08:25:32 2019
@@ -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)

Modified: lldb/trunk/cmake/modules/LLDBStandalone.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBStandalone.cmake?rev=363821&r1=363820&r2=363821&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake Wed Jun 19 08:25:32 2019
@@ -95,7 +95,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
                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}")


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to