aboutsummaryrefslogtreecommitdiff
path: root/find-modules
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2017-01-13 18:39:15 +0000
committerStephen Kelly <steveire@gmail.com>2017-01-13 18:40:10 +0000
commit4332f9eea11b5911f0b03c90df310a48e22114a5 (patch)
treedcde37e1b13c302bf989fea90cd0452c0ae64d65 /find-modules
parent029798941a1082b8d5f00b7aaa234615d96844ca (diff)
downloadextra-cmake-modules-4332f9eea11b5911f0b03c90df310a48e22114a5.tar.gz
extra-cmake-modules-4332f9eea11b5911f0b03c90df310a48e22114a5.tar.bz2
Bindings: Determine the clang suffix from the filename if cached
The suffix is used later to run the clang executable in order to determine the built-in system includes.
Diffstat (limited to 'find-modules')
-rw-r--r--find-modules/FindPythonModuleGeneration.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/find-modules/FindPythonModuleGeneration.cmake b/find-modules/FindPythonModuleGeneration.cmake
index 4ef316a0..88f553dd 100644
--- a/find-modules/FindPythonModuleGeneration.cmake
+++ b/find-modules/FindPythonModuleGeneration.cmake
@@ -194,6 +194,9 @@ if (NOT libclang_LIBRARY)
set(_GPB_CLANG_SUFFIX 3.${_LIBCLANG3_FIND_VERSION})
find_library(libclang_LIBRARY clang-3.${_LIBCLANG3_FIND_VERSION})
endwhile()
+else()
+ string(REGEX MATCH ".*clang-([0-9]+\\.[0-9]+).*" _GPB_CLANG_SUFFIX ${libclang_LIBRARY})
+ set(_GPB_CLANG_SUFFIX ${CMAKE_MATCH_1})
endif()
if (NOT libclang_LIBRARY)