diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2015-09-22 04:11:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-25 14:07:54 (GMT) |
commit | a27bc0ccacff7bc590ace2ce941f0552d05fd14c (patch) | |
tree | b9f4b5e0ce15408cf38aa7db19af5ac4d900c850 /Modules/CheckSymbolExists.cmake | |
parent | 7279f2939e98ae9ecfb8fda2dc82f6b0048b9316 (diff) | |
download | CMake-a27bc0ccacff7bc590ace2ce941f0552d05fd14c.zip CMake-a27bc0ccacff7bc590ace2ce941f0552d05fd14c.tar.gz CMake-a27bc0ccacff7bc590ace2ce941f0552d05fd14c.tar.bz2 |
Check(Function|Library|Symbol)Exists: make it work if only C++ is enabled
Diffstat (limited to 'Modules/CheckSymbolExists.cmake')
-rw-r--r-- | Modules/CheckSymbolExists.cmake | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake index 79c5ba7..c4dff3f 100644 --- a/Modules/CheckSymbolExists.cmake +++ b/Modules/CheckSymbolExists.cmake @@ -44,10 +44,14 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) - - macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE) - _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) + if(CMAKE_C_COMPILER_LOADED) + _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) + elseif(CMAKE_CXX_COMPILER_LOADED) + _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) + else() + message(FATAL_ERROR "CHECK_SYMBOL_EXISTS needs either C or CXX language enabled") + endif() endmacro() macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE) |