summaryrefslogtreecommitdiffstats
path: root/Modules/CheckCXXSymbolExists.cmake
diff options
context:
space:
mode:
authorHong Xu <hong@topbug.net>2019-07-07 22:47:06 (GMT)
committerBrad King <brad.king@kitware.com>2019-07-26 19:09:28 (GMT)
commit72fcadb007261f8e1883040d7dc5643e3555aa45 (patch)
tree0a7f2ab77a257930351375e04a61223149f74bdc /Modules/CheckCXXSymbolExists.cmake
parent93f10f06b3b86085a180e5259f653646e1705baf (diff)
downloadCMake-72fcadb007261f8e1883040d7dc5643e3555aa45.zip
CMake-72fcadb007261f8e1883040d7dc5643e3555aa45.tar.gz
CMake-72fcadb007261f8e1883040d7dc5643e3555aa45.tar.bz2
CheckCXXSymbolExists: Make C++-syntax symbols work on more compilers
On some compilers the syntax `#ifndef std::fopen` will always lead to compilation error. Avoid generating it in the check.
Diffstat (limited to 'Modules/CheckCXXSymbolExists.cmake')
-rw-r--r--Modules/CheckCXXSymbolExists.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake
index b112094..5c9079d 100644
--- a/Modules/CheckCXXSymbolExists.cmake
+++ b/Modules/CheckCXXSymbolExists.cmake
@@ -27,6 +27,17 @@ Check if a symbol exists as a function, variable, or macro in ``C++``.
not be recognized: consider using the :module:`CheckTypeSize`
or :module:`CheckCXXSourceCompiles` module instead.
+.. note::
+
+ This command is unreliable when ``<symbol>`` is (potentially) an overloaded
+ function. Since there is no reliable way to predict whether a given function
+ in the system environment may be defined as an overloaded function or may be
+ an overloaded function on other systems or will become so in the future, it
+ is generally advised to use the :module:`CheckCXXSourceCompiles` module for
+ checking any function symbol (unless somehow you surely know the checked
+ function is not overloaded on other systems or will not be so in the
+ future).
+
The following variables may be set before calling this macro to modify
the way the check is run: