[PATCH] D41611: [opt-viewer] Check for pygments.lexer.c_cpp

Jonas Hahnfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 2 09:54:18 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL321659: [opt-viewer] Check for pygments.lexer.c_cpp (authored by Hahnfeld, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D41611?vs=128273&id=128429#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D41611

Files:
  llvm/trunk/cmake/config-ix.cmake


Index: llvm/trunk/cmake/config-ix.cmake
===================================================================
--- llvm/trunk/cmake/config-ix.cmake
+++ llvm/trunk/cmake/config-ix.cmake
@@ -640,7 +640,8 @@
 string(REPLACE " " ";" LLVM_BINDINGS_LIST "${LLVM_BINDINGS}")
 
 function(find_python_module module)
-  string(TOUPPER ${module} module_upper)
+  string(REPLACE "." "_" module_name ${module})
+  string(TOUPPER ${module_name} module_upper)
   set(FOUND_VAR PY_${module_upper}_FOUND)
 
   execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import ${module}"
@@ -658,13 +659,16 @@
 
 set (PYTHON_MODULES
   pygments
+  # Some systems still don't have pygments.lexers.c_cpp which was introduced in
+  # version 2.0 in 2014...
+  pygments.lexers.c_cpp
   yaml
   )
 foreach(module ${PYTHON_MODULES})
   find_python_module(${module})
 endforeach()
 
-if(PY_PYGMENTS_FOUND AND PY_YAML_FOUND)
+if(PY_PYGMENTS_FOUND AND PY_PYGMENTS_LEXERS_C_CPP_FOUND AND PY_YAML_FOUND)
   set (LLVM_HAVE_OPT_VIEWER_MODULES 1)
 else()
   set (LLVM_HAVE_OPT_VIEWER_MODULES 0)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41611.128429.patch
Type: text/x-patch
Size: 1054 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180102/1067ca59/attachment.bin>


More information about the llvm-commits mailing list