aboutsummaryrefslogtreecommitdiff
path: root/find-modules/FindPythonModuleGeneration.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2017-01-13 18:57:57 +0000
committerStephen Kelly <steveire@gmail.com>2017-01-13 18:57:57 +0000
commit173d9984ef62c07b331f4cb1e6138e8993dfb92f (patch)
treea44996ee24f88b89af1858db0144ca7d52951962 /find-modules/FindPythonModuleGeneration.cmake
parent115ab483d8dc368324136512a5f093f1d5bfdce3 (diff)
downloadextra-cmake-modules-173d9984ef62c07b331f4cb1e6138e8993dfb92f.tar.gz
extra-cmake-modules-173d9984ef62c07b331f4cb1e6138e8993dfb92f.tar.bz2
Bindings: Fix logic for finding the clang driver
Use find_package to locate the executable.
Diffstat (limited to 'find-modules/FindPythonModuleGeneration.cmake')
-rw-r--r--find-modules/FindPythonModuleGeneration.cmake8
1 files changed, 4 insertions, 4 deletions
diff --git a/find-modules/FindPythonModuleGeneration.cmake b/find-modules/FindPythonModuleGeneration.cmake
index 30fb5125..7a4f7d45 100644
--- a/find-modules/FindPythonModuleGeneration.cmake
+++ b/find-modules/FindPythonModuleGeneration.cmake
@@ -251,11 +251,11 @@ include(CMakeParseArguments)
set(GPB_MODULE_DIR ${CMAKE_CURRENT_LIST_DIR})
function(_compute_implicit_include_dirs)
- set(CLANG_CXX_DRIVER clang++${_GPB_CLANG_SUFFIX})
- if (NOT EXISTS ${CLANG_CXX_DRIVER})
- set(CLANG_CXX_DRIVER clang++)
+ find_program(_GBP_CLANG_CXX_DRIVER_PATH clang++-${_GPB_CLANG_SUFFIX})
+ if (NOT _GBP_CLANG_CXX_DRIVER_PATH)
+ message(FATAL_ERROR "Failed to find clang driver corresponding to ${libclang_LIBRARY}")
endif()
- execute_process(COMMAND ${CLANG_CXX_DRIVER} -v -E -x c++ -
+ execute_process(COMMAND ${_GBP_CLANG_CXX_DRIVER_PATH} -v -E -x c++ -
ERROR_VARIABLE _compilerOutput
OUTPUT_VARIABLE _compilerStdout
INPUT_FILE /dev/null)