Commit Graph

21 Commits

Author SHA1 Message Date
Brad King
03c31b0395 Drop Visual Studio 9 2008 generator
This generator has been deprecated since CMake 3.27.  Remove it.
2024-05-08 10:37:34 -04:00
Brad King
0f688386ea Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.log
`try_compile` and `try_run` now automatically log checks using them to
`CMakeConfigureLog.yaml`.

Add `LOG_DESCRIPTION` arguments to some `try_compile` calls to
replace the description previously written to the old logs.

Issue: #23200
2023-01-18 16:41:01 -05:00
Matthew Woehlke
d00d8537f6 Modules: Use new keyword-dispatched try_compile signature
Modify modules that ship with CMake and use the project flavor of
try_compile to use the new signature added by commit 56ae40cc59
(try_compile: Add PROJECT keyword-dispatched signature, 2022-09-14).
2022-09-16 13:14:51 -04:00
Robert Maynard
96bc59b1ca CUDA: Add Device LTO support for nvcc
Fixes #22200
2022-07-22 10:34:45 -04:00
Robert Maynard
1527d48cd0 CheckIPO: Refactor logic selecting test source files 2022-07-13 10:25:10 -04:00
Brad King
ec08bc1752 CheckIPOSupported: Compile check using flags of calling project
Forward `CMAKE_<LANG>_FLAGS` and `CMAKE_<LANG>_FLAGS_DEBUG` from the
calling project into the test project.  The set of flags may affect the
availability of IPO support.  Since this may change the result of the
check for existing projects, add a policy for compatibility.

This was discovered after commit 5fcadc481e (MSVC: Default to -ZI
instead of /Zi for x86 and x64, 2022-05-24) introduced policy CMP0138 to
switch our default for MSVC's debug info flag.  The `-ZI` flag is
incompatible with the `-GL` flag used for IPO, so CMP0138 was reverted
pending future work on an alternative solution.  Re-use the CMP0138
policy number for this change to CheckIPOSupported instead.

Fixes: #23607
2022-06-10 09:12:43 -04:00
Nikita Nemkin
8fea95319b Help: Add .. versionadded directives to module docs
Issue: #19715
2020-12-02 21:00:30 +05:00
Kitware Robot
496ec6036f Help: Add Sphinx 'versionadded' directives to each top-level document
Run the `Utilities/Sphinx/update_versions.py` script to add initial
markup to every top-level document and find module.

Issue: #19715
2020-07-06 10:23:20 -04:00
Brad King
4b8297721f CheckIPOSupported: Avoid polluting cache with common name 'result'
Fixes: #20508
2020-03-26 12:57:07 -04:00
Kyle Edwards
88b40744b5 CMakeParseArguments: Remove superfluous includes of CMakeParseArguments
Because cmake_parse_arguments() has been implemented as a native
command, there is no need to include(CMakeParseArguments) anymore.
Its inclusion has been removed from several CMake modules.

Tests/CMakeOnly/CMakeLists.txt has been changed to include the
*building* CMake's copy of CMakeParseArguments rather than the
*built* CMake's copy. This file included the *built* copy because
when this file was introduced, CMake could still be built with versions
that didn't supply cmake_parse_arguments(). Now, CMake requires 3.1 or
greater, where cmake_parse_arguments() existed but was still in the
form of a module, so we include it from the *building* CMake.
2018-12-13 19:51:01 -05:00
Niels Dekker
567fabe88e IPO: INTERPROCEDURAL_OPTIMIZATION (LTCG) for Visual Studio
Add IPO support for Visual Studio (which is referred to by VS as
"Link Time Code Generation" and "Whole Program Optimization"), for
VS version >= 10.  This allows CMake/VS users to enable IPO by setting
property `INTERPROCEDURAL_OPTIMIZATION`.

Fixes: #16748
2018-09-17 10:53:10 -04:00
Brad King
4e1ea02bb8 CheckIPOSupported: Tolerate backslashes in output of failed checks
Avoid passing the output of our `try_compile` through a macro argument.
Macro invocations re-parse their arguments and so should not be given
arbitrary content that may contain backslashes and such.

Instead pass a simple message.  This is also more readable in the case
that the macro generates a message itself.  After the macro returns,
report the real output directly to the variable named by our caller.
Also record the output in a log file as other checks do on failure.

Fixes: #18244
2018-08-30 11:46:19 -04:00
Brad King
b7dbb25a0a CheckIPOSupported: Simplify result reporting logic
Simplify the test for whether a `RESULT` argument was given to the
`check_ipo_supported` call.  Also do not set an empty variable name
if `OUTPUT` was not given.
2018-08-30 11:45:13 -04:00
Brad King
9e341f05b0 CheckIPOSupported: Document existing Fortran support
Support was added by commit v3.9.0-rc1~318^2 (CheckIPOSupported: Add
Fortran support, 2017-04-02) but the documentation was not updated.
2018-01-30 12:58:41 -05:00
Brad King
ba247ccaba IPO: Consider support for each language separately
We only define `INTERPROCEDURAL_OPTIMIZATION` behavior for C, CXX, and
Fortran languages.  Do not try to enable support for other languages.
Furthermore, each language builds with a different compiler, so check
for support by CMake and the compiler for each language independently.

Fixes: #16944
2017-06-14 10:36:57 -04:00
Ruslan Baratov
7e75568b00 Xcode: Support IPO (LTO) 2017-05-02 18:33:25 +03:00
Ruslan Baratov
87199ea66b CheckIPOSupported: Add Fortran support 2017-04-04 09:35:39 -04:00
Ruslan Baratov
c92fd25661 CheckIPOSupported: Move '_CMakeLTOTest-*' under 'CMakeFiles' 2017-04-04 09:35:31 -04:00
Ruslan Baratov
1588a577d1 Add policy CMP0069 to enforce INTERPROCEDURAL_OPTIMIZATION
Previously the `INTERPROCEDURAL_OPTIMIZATION` target property was
honored only for the Intel compiler on Linux and otherwise ignored.  In
order to add support for more compilers incrementally without changing
behavior in the future, add a new policy whose NEW behavior enforces the
`INTERPROCEDURAL_OPTIMIZATION` property.  Add flags for supported
compilers and otherwise produce an error.
2017-03-30 14:56:46 -04:00
Ruslan Baratov
e05835c35b CheckIPOSupported: Visual Studio and Xcode generators do not support IPO 2017-03-30 10:16:10 -04:00
Ruslan Baratov
fdb2ba2521 CheckIPOSupported: New module to check for compiler/cmake IPO support 2017-03-11 19:46:25 +08:00