summaryrefslogtreecommitdiff
path: root/Modules/CheckCXXCompilerFlag.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'doc_varreq'Brad King2023-03-161-5/+0
|\ | | | | | | | | | | | | | | 9e1b30121f Help:toolchain: refer to CheckSourceCompiles cf48022dc5 Help:Check*: include CMAKE_REQUIRED_* vars to dedupe Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8300
| * Help:Check*: include CMAKE_REQUIRED_* vars to dedupescivision2023-03-141-5/+0
| | | | | | | | | | | | CMAKE_REQUIRED_FLAGS now notes that space-delimited string, not ;-list is required, which could be surprising compared to similar options that do use ;-list
* | Modules:Check,GenerateExportHeader: include only what's neededscivision2023-03-131-1/+0
|/ | | | | | GenerateExportHeader had a hidden state requirement that other modules were included first. Considering include_guard, Modules should include all they actually use.
* Modules: Do not implicitly add new functions via old Check ModulesRobert Maynard2020-10-261-2/+2
| | | | | | | | | | | | | The conversion of Check<Lang>CompilerFlag, SourceCompiles, and SourceRuns over to the new functions has the possibility of breaking projects that had functions with those existing names. To reduce the possibility of collisions we now have all the legacy code call functions that start with `cmake_`, and users will need to explicitly include the new modules to get the non-prefixed versions Fixes: #21359
* CheckCompilerFlag: unified way to check compiler flags per languageRobert Maynard2020-09-281-21/+5
|
* Check*CompilerFlag: Do not set result as a normal variable tooBrad King2020-09-211-1/+0
| | | | | | | | | Refactoring in commit cb984c6627 (Check*CompilerFlag: Modernize modules, 2019-12-09, v3.17.0-rc1~320^2) accidentally left the result set as a normal variable in addition to as a cache entry. This is not specified by the documentation, and is not the behavior in CMake 3.16 and below. Fixes: #21207
* Check*CompilerFlag: Modernize modulesAlexander Grund2019-12-091-17/+12
| | | | | | - User lower-case names - Wrap in function instead of macro to avoid set-unset calls - Use IN LISTS for foreach
* Modules: Consistently use 2 space indentationKitware Robot2019-05-141-23/+23
|
* Help: Revise docs of modules AddFileDependencies..CheckFunctionExistsJoachim Wuttke (l)2018-10-191-2/+1
| | | | | | * Replace '::' by '.. code-block:: cmake' wherever it makes sense. * Convert to definition list where appropriate. * Prefer '<placeholder>' over 'placeholder'.
* Check*: Added include guardsCristian Adam2017-12-011-0/+1
|
* Check*CompilerFlag: Rewrite documentation of these modulesBrad King2017-06-151-19/+30
| | | | | | | | Format with modern markup. Clarify that the setting of `CMAKE_REQUIRED_DEFINITIONS` is temporary. Add a note warning about contamination of the checks by `CMAKE_<LANG>_FLAGS`. Issue: #16973
* Simplify CMake per-source license noticesBrad King2016-09-271-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Check*CompilerFlag: Revert to previous method used to pass flags (#15641)Brad King2015-07-081-4/+4
| | | | | | | | | Since commit v3.3.0-rc1~397^2 (Check*CompilerFlag: Refactor method used to pass flags, 2015-02-24) these check modules pass the flags to the compiler front-end during linking as well as during compilation. This breaks checks for flags like '-x c++' that are meant only for the compilation step. Revert the change and add a test covering a compiler-only flag.
* Check*CompilerFlag: Refactor method used to pass flagsMark Abraham2015-02-241-4/+4
| | | | | | | Refactor the Check*CompilerFlag modules to pass the flags to Check*SourceCompiles using CMAKE_REQUIRED_FLAGS instead of CMAKE_REQUIRED_DEFINITIONS. Both end up being used, but the variable for "FLAGS" is more precise.
* Convert builtin help to reStructuredText source filesKitware Robot2013-10-151-10/+18
| | | | | | | | Run the convert-help.bash script to convert documentation: ./convert-help.bash "/path/to/CMake-build/bin" Then remove it.
* Check*CompilerFlag: make C and CXX modules share most error patterns (#14339)Rolf Eike Beer2013-08-131-14/+5
| | | | | | | This simplifies maintenance as most patterns will be for both modules and may be added at a central place. While at it add error patterns for XL and BCC.
* CheckC*CompilerFlag: add documentation what to expect from a positive resultRolf Eike Beer2013-08-131-0/+3
|
* Check*CompilerFlag: Document use of CMAKE_REQUIRED_DEFINITIONS (#14309)Brad King2013-07-251-3/+4
| | | | | Explain how CMAKE_REQUIRED_DEFINITIONS is set before calling the check_*_source_compiles macros.
* Check{C,CXX}CompilerFlag: Test using C locale (#14102)Brad King2013-04-221-0/+13
| | | | | | | Set the locale to C while running the compiler for these checks because we match the resulting warning messages in English only. Suggested-by: Marco Nolden <m.nolden@dkfz-heidelberg.de>
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-1/+1
| | | | | | | | | | | | | | | | | Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Convert CMake-language commands to lower caseKitware Robot2012-08-131-6/+6
| | | | | | | | | | | | | | | | | Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code: cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Check{C,CXX}CompilerFlag: catch more Intel warning types (#12576)Rolf Eike Beer2012-04-271-1/+3
| | | | Patch provided by Szilárd Páll.
* Check{C,CXX}CompilerFlag: detect ICC error messagesRolf Eike Beer2012-02-231-0/+1
| | | | Patch provided by Christopher Sean Morrison.
* Improve checks for Open64 and g++ incompatible flags (#12119)Matthias Kretz2012-02-121-0/+3
|
* Merge topic 'generate_export_header'David Cole2011-09-011-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6a6393c Don't use a variable name that might be used in other files. 5ca8c56 Fix up verbatim code sections of the dox. 75596e6 Don't start a line with a dash(-) 826374a Remove blank line at the start of the file. 8b9b8e1 Add documentation about the prefix and no_deprecated options. 51bc63a Fix the feature of using a specific prefix for macros. 3449f6b Add quotes in case cmake is installed in a prefix with a space. 36d28f2 Fix Compiler id variable name. 99b2aab Disable the tests for Watcom. 7ac0ab1 Quote paths in case there is a space in one of them. 89108b9 Look for errors reported by PGI too. e0cc024 Add missing NO_EXPORT macro variant. 1b031d1 More consistency in the macro options. 03d60c7 Try to make the macros do almost nothing for Watcom. 6adeda9 Possibly fix configuration test on AIX. e253348 Possibly fix test on HPUX. 32eff0c Test for too-old-intel compilers. 42154ec Fix up the regex command for Intel. a147a06 Add some settings for non-truncation of test output. bf73e75 Hopefully add version extraction for Intel. aa4f0b6 Fix the version extraction regex for clang. a493d1a Test the correct cxx variable. b6ee2ee Comment the test assertion for now a9a8b9e Exclude win32 from hidden visibility checks. afae7a9 Start testing expected values for compiler flags. 1ae3365 Exclude PGI from exports and deprecated. f426496 Exclude cygwin from the hidden visibility feature. f84c7db Don't enable deprecated on old GCC 9672b33 Don't enable deprecated on HP. 10d8c44 Disable testing of deprecated macros. 97392a7d Fixup forgotten part of aed84517c942a4c40f493fcf997cdf6a047349f8 2aeab4f Borland can't do deprecated. c41c68b Try to error on deprecated on Intel and SunCC. aed8451 Test for deprecated attribute before declspec. c448b09 Perform the -Werror test only once. fb88c6e Add some messaging output to make remaining issues findable. 01e9e98 Test -Werror instead of enabling it per compiler. 9aab2aa Expect the tests to pass if hidden visibilty is not enabled. 856bdb3 Don't change the expected build result based on the platform. df4615e Add the COMPILER_HAS_DEPRECATED only if it has a declspec variant 78a6e1c Exclude the XL compiler from the hidden-visibility test. e1f7ee3 Test for compiler features, instead of for specific platforms. 9554e10 Split the deprecated available check from setting macro values. 1590d5f Don't export methods on already exported classes. 750b67c Don't use hidden visibility on non-mingw windows either. 1f3be45 Make sure the hidden visibility variables never get set on MINGW. 399f415 Only set the deprecated attribute if hidden visibilty is enabled. 1c6b41b Remember to surround the other deprecated test in the Borland check. 3f7e036 Export deprecated free methods too. 7fa5592 Add some debug output to narrow down deprecation test issues 7924c1d Another attempt at fixing Borland. 50460ea Fix off-by-not in test for Borland. b443459 Use the correct project name compiletest not compilefail fc3772e Another attempt to fix the tests on Borland. bab4a22 Disable all export macros on Borland. cff9493 Only set the COMPILER_HAS_HIDDEN_VISIBILITY if GCC >= 4.2 af443b8 Set the CMAKE_RUNTIME_OUTPUT_DIRECTORY for windows builds. 61726f8 Only run the failure tests with gcc >= 4.2 002ddf2 Fix typo and tests failing as a result. 4443037 Fix tests with clang. ffaa127 Test expected no-op instead of aborting the build. 6aca0e2 Short-circuit the tests on unsupported compilers. d123bce Add some debug output. 3574b75 Simplify the compiler feature check c7a937b Simplify. We already know we have hidden visibility at this point. 3b188c8 Test for features, not specific compilers. 4718233 Remove the fatal_warnings option which is no longer used. b19911e Add missing licence header. 706ed2b Add a newline at the end of the file. 8963716 Add a newline at the end of the file. def0a54 Handle the case where the user changes the DEFINE_SYMBOL property. 3088070 Add the GenerateExportMacro with unit tests.
| * Look for errors reported by PGI too.Stephen Kelly2011-08-241-0/+1
| |
| * Possibly fix configuration test on AIX.Stephen Kelly2011-08-231-0/+1
| |
* | Fix CHECK_(C|CXX)_COMPILER_FLAG for Clang (#12394)Brad King2011-08-081-0/+1
|/ | | | | This compiler warns and returns 0 for unrecognized flags. We fix the compiler flag check macros by looking for a warning in the output.
* BUG: Fix compiler flag test for non-English MSVC (#11336)Brad King2010-11-041-1/+2
| | | | Approach suggested by John Stark.
* Modules: Fix spelling 'To distributed' -> 'To distribute'Todd Gamblin2010-08-091-1/+1
|
* Convert CMake non-find modules to BSD LicenseBrad King2009-09-281-4/+12
| | | | | | | This adds copyright/license notification blocks CMake's non-find modules. Most of the modules had no notices at all. Some had notices referring to the BSD license already. This commit normalizes existing notices and adds missing notices.
* Fix CHECK_(C|CXX)_COMPILER_FLAG for XL and SunProBrad King2009-09-181-1/+3
| | | | | | These compilers warn and return 0 for unrecognized flags. We fix the compiler flag check macros by looking for a warning in the output. We also update the regex for GNU on older Macs. See issue #9516.
* Fix CHECK_(C|CXX)_COMPILER_FLAG for HPBrad King2009-09-171-0/+1
| | | | | | This compiler warns and returns 0 for unrecognized flags. We fix the compiler flag check macros by looking for a warning in the output. See issue #9516.
* Fix CHECK_(C|CXX)_COMPILER_FLAG for GNU and MSVCBrad King2009-09-171-1/+5
| | | | | | These compilers warn and return 0 for unrecognized flags. We fix the compiler flag check macros by looking for a warning in the output. See issue #9516.
* Cleanup generic compiler check macro documentationBrad King2009-09-171-4/+6
| | | | | | | | | | | | | | | This commit improves formatting and style of the documentation for the general-purpose compiler check macros: CHECK_C_COMPILER_FLAG CHECK_C_SOURCE_COMPILES CHECK_C_SOURCE_RUNS CHECK_CXX_COMPILER_FLAG CHECK_CXX_SOURCE_COMPILES CHECK_CXX_SOURCE_RUNS This sytle is more consistent with CMake command documentation. It also looks nicer in the generated documentation text files.
* ENH: two macros to check whether the C/CXX compiler supports a given flag:Alexander Neundorf2006-09-181-0/+21
CHECK_CXX_COMPILER_FLAG("-Wall" COMPILER_SUPPORTS_WALL) Alex