diff options
author | Brad King <brad.king@kitware.com> | 2019-07-29 15:50:32 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-07-29 15:50:42 (GMT) |
commit | f22a2a1fa536127739baa8f6e020d9972adeb5c2 (patch) | |
tree | fb9b2450db132a74a770c98b5d3efc1d89c356a4 /Tests | |
parent | d275877dfcee52938e8564febe6f57f96c10f351 (diff) | |
parent | 72fcadb007261f8e1883040d7dc5643e3555aa45 (diff) | |
download | CMake-f22a2a1fa536127739baa8f6e020d9972adeb5c2.zip CMake-f22a2a1fa536127739baa8f6e020d9972adeb5c2.tar.gz CMake-f22a2a1fa536127739baa8f6e020d9972adeb5c2.tar.bz2 |
Merge topic 'CheckCXXSymbolExists-c++-syntax'
72fcadb007 CheckCXXSymbolExists: Make C++-syntax symbols work on more compilers
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3545
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt index f058c19..2028a13 100644 --- a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt @@ -49,6 +49,15 @@ else () message(STATUS "errno found in <cerrno>") endif () +check_cxx_symbol_exists("std::fopen" "cstdio" CSE_RESULT_FOPEN) +if (NOT CSE_RESULT_FOPEN) + if(NOT ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.10)) + message(SEND_ERROR "CheckCXXSymbolExists did not find std::fopen in <cstdio>") + endif() +else() + message(STATUS "std::fopen found in <cstdio>") +endif() + if (CMAKE_COMPILER_IS_GNUCXX) string(APPEND CMAKE_CXX_FLAGS " -O3") unset(CSE_RESULT_O3 CACHE) @@ -60,3 +69,8 @@ if (CMAKE_COMPILER_IS_GNUCXX) message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing with optimization -O3") endif () endif () + +check_cxx_symbol_exists("std::non_existent_function_for_symbol_test<int*>" "algorithm" CSE_RESULT_NON_SYMBOL) +if (CSE_RESULT_NON_SYMBOL) + message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol.") +endif() |