summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/config-ix.cmake
diff options
context:
space:
mode:
authorJonas Hahnfeld <hahnjo@hahnjo.de>2018-01-02 17:53:08 +0000
committerJonas Hahnfeld <hahnjo@hahnjo.de>2018-01-02 17:53:08 +0000
commit9e4431fff02ea6a5e0542c06ff24618f08a98466 (patch)
treebfe445d4ef2dc5f1140a324c9e531a17ac7cca6b /llvm/cmake/config-ix.cmake
parent40a01d5314ffc3c5f4c379cd69015f962dde5f72 (diff)
downloadbcm5719-llvm-9e4431fff02ea6a5e0542c06ff24618f08a98466.tar.gz
bcm5719-llvm-9e4431fff02ea6a5e0542c06ff24618f08a98466.zip
[opt-viewer] Check for pygments.lexer.c_cpp
Some systems still don't have this module which was introduced in version 2.0 (CentOS 7, sigh). Differential Revision: https://reviews.llvm.org/D41611 llvm-svn: 321659
Diffstat (limited to 'llvm/cmake/config-ix.cmake')
-rw-r--r--llvm/cmake/config-ix.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index c6be957b0e4..aaf22ff474b 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -640,7 +640,8 @@ endif()
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 @@ endfunction()
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)
OpenPOWER on IntegriCloud