diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2018-11-26 16:32:06 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2018-12-01 16:56:23 (GMT) |
commit | f266182aecb687f0c20c7fa7019ad0dde3222f46 (patch) | |
tree | 329ec6152a0290856004f3ac263c71acc740a4b3 /Modules/CheckCXXSymbolExists.cmake | |
parent | 29f9db5c63dbfa53acdb449fad78d716a4113a88 (diff) | |
download | CMake-f266182aecb687f0c20c7fa7019ad0dde3222f46.zip CMake-f266182aecb687f0c20c7fa7019ad0dde3222f46.tar.gz CMake-f266182aecb687f0c20c7fa7019ad0dde3222f46.tar.bz2 |
Check* functions family: add support for LINK_OPTIONS
Fixes: #18521
Diffstat (limited to 'Modules/CheckCXXSymbolExists.cmake')
-rw-r--r-- | Modules/CheckCXXSymbolExists.cmake | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake index d067001..970e301 100644 --- a/Modules/CheckCXXSymbolExists.cmake +++ b/Modules/CheckCXXSymbolExists.cmake @@ -7,35 +7,42 @@ CheckCXXSymbolExists Check if a symbol exists as a function, variable, or macro in C++ -.. code-block:: cmake +.. command:: CHECK_CXX_SYMBOL_EXISTS - CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>) + .. code-block:: cmake -Check that the ``<symbol>`` is available after including given header -``<files>`` and store the result in a ``<variable>``. Specify the list of -files in one argument as a semicolon-separated list. -CHECK_CXX_SYMBOL_EXISTS() can be used to check in C++ files, as -opposed to CHECK_SYMBOL_EXISTS(), which works only for C. + CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>) -If the header files define the symbol as a macro it is considered -available and assumed to work. If the header files declare the symbol -as a function or variable then the symbol must also be available for -linking. If the symbol is a type or enum value it will not be -recognized (consider using CheckTypeSize or CheckCSourceCompiles). + Check that the ``<symbol>`` is available after including given header + ``<files>`` and store the result in a ``<variable>``. Specify the list of + files in one argument as a semicolon-separated list. + ``CHECK_CXX_SYMBOL_EXISTS()`` can be used to check in C++ files, as + opposed to ``CHECK_SYMBOL_EXISTS()``, which works only for ``C``. + + If the header files define the symbol as a macro it is considered + available and assumed to work. If the header files declare the symbol + as a function or variable then the symbol must also be available for + linking. If the symbol is a type or enum value it will not be + recognized (consider using :module:`CheckTypeSize` + or :module:`CheckCSourceCompiles`). The following variables may be set before calling this macro to modify the way the check is run: ``CMAKE_REQUIRED_FLAGS`` - string of compile command line flags + string of compile command line flags. ``CMAKE_REQUIRED_DEFINITIONS`` - list of macros to define (-DFOO=bar) + a :ref:`;-list <CMake Language Lists>` of macros to define (-DFOO=bar). ``CMAKE_REQUIRED_INCLUDES`` - list of include directories + a :ref:`;-list <CMake Language Lists>` of header search paths to pass to + the compiler. +``CMAKE_REQUIRED_LINK_OPTIONS`` + a :ref:`;-list <CMake Language Lists>` of options to add to the link command. ``CMAKE_REQUIRED_LIBRARIES`` - list of libraries to link + a :ref:`;-list <CMake Language Lists>` of libraries to add to the link + command. See policy :policy:`CMP0075`. ``CMAKE_REQUIRED_QUIET`` - execute quietly without messages + execute quietly without messages. #]=======================================================================] include_guard(GLOBAL) |