Commit Graph

18 Commits

Author SHA1 Message Date
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Marc Chevrier
00932ea864 Introduce CMAKE_<LANG>_LINK_MODE variable.
This variable define how the link step is done. Possible values are:
* DRIVER: the compiler is used as driver for the link step
* LINKER: the linker is used directly for the link step.
2025-01-10 13:24:16 +01:00
Marc Chevrier
aeaec06267 Intel/Classic: deactivate linker dependency file support
The Intel Classic compilers' IPO plugins do not support the
`-Wl,--dependency-file,...` linker flag.

Fixes: #26483
2024-11-28 09:54:22 -05:00
Joerg Bornemann
d538cb0e18 Only initialize CMAKE_CXX_COMPILER_PREDEFINES_COMMAND
Don't initialize the other CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND
variables.

The only language variant that is used is
CMAKE_CXX_COMPILER_PREDEFINES_COMMAND, and the other language variants
contained invalid, namely C++-specific commands.

Fixes: #23968
2022-11-16 13:08:31 +01:00
Michael Hirsch
13f3382b1c Intel/IntelLLVM: Fortran has distinct "-Werror"-like flag
Update the compiler options table added by commit 76a08cd253
(COMPILE_WARNING_AS_ERROR: Add options to treat warnings as errors,
2022-04-21, v3.24.0-rc1~173^2) to use the Intel Fortran compilers'
dedicated `-warn*` flags.
2022-10-07 10:05:49 -04:00
Martin Duffy
76a08cd253 COMPILE_WARNING_AS_ERROR: Add options to treat warnings as errors
Add `COMPILE_WARNING_AS_ERROR` target property and supporting
`CMAKE_COMPILE_WARNING_AS_ERROR` variable.

`COMPILE_WARNING_AS_ERROR` is initialized by
`CMAKE_COMPILE_WARNING_AS_ERROR`. It is a boolean variable. If it is
true, it expands to a different flag depending on the compiler such that
any warnings at compile will be treated as errors.

Supports compiler ids that I could find a relevant flag for.
2022-05-06 12:14:37 -04:00
Brad King
e76c11aa7c Merge branch 'backport-3.17-pch-no-Fortran' into pch-no-Fortran 2020-06-02 08:24:11 -04:00
Brad King
10c88c4337 PCH: Do not enable GNU or Intel PCH settings for Fortran
The PCH settings are shared by C and CXX languages but do not make sense
for Fortran.  In particular, `CMAKE_PCH_EXTENSION` should not be set
because it can overwrite the value set for C/C++ languages, which may
have a different compiler vendor than the Fortran compiler.

Fixes: #20752
2020-06-02 08:23:40 -04:00
Cristian Adam
2ce08e5489 PCH: add an option to disable -Winvalid-pch
Fixes: #20295
2020-03-26 14:24:46 +01:00
Cristian Adam
b8626261e9 Precompile headers: Add methods to generate PCH sources
Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
2019-08-28 11:47:40 -04:00
Sebastian Holtermann
83f2d48388 Respect CMAKE_<LANG>_COMPILER_ARG1 in CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND
AUTOMOC used to fail to generate ``moc_predefs.h`` when ``ccache`` was used
as a compiler starter by e.g. configuring a project with the environment
variable CXX="ccache g++".
The reason was that ``CMAKE_<LANG>_COMPILER_ARG1`` wasn't respected in the
definition of ``CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND`` for various
compilers.  This is fixed by this patch.

Fixes #17275.
2018-08-28 20:07:53 +02:00
Chuck Atkins
0198502ff4 Intel: Use common compiler macros for language standard default 2017-05-02 09:49:23 -04:00
Aleix Pol
0903531964 Autogen: Pass explicit predefines header to moc if possible
Qt is relying on whoever calls moc to include a file with the predefined
values that will be used by the compiler, otherwise moc takes wrong
paths and weird things happen.
Instead, generate an include file and feed it to all mocs to make sure
it's generating correct code.

Co-Author: Sebastian Holtermann <sebholt@xwmw.org>
Fixes: #16640
2017-04-20 08:59:07 -04:00
Brad King
86578eccf2 Simplify CMake per-source license notices
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.
2016-09-27 15:14:44 -04:00
Brad King
a66004bee0 Honor CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in toolchain files
Document these variables.

Change our convention for setting these variables from:

    set(CMAKE_C_FLAGS_INIT "...")

to

    string(APPEND CMAKE_C_FLAGS_INIT " ...")

so that any value previously set by a toolchain file will be used.

Automate the conversion with:

    sed -i 's/set *(\(CMAKE_\(C\|CXX\|Fortran\|RC\|ASM\|${[^}]\+}\)_FLAGS\(_[^_]\+\)\?_INIT \+"\)/string(APPEND \1 /' \
      Modules/Compiler/*.cmake Modules/Platform/*.cmake

and follow up with some manual fixes (e.g. to cases that already
meant to append).  Also revert the automated changes to contexts
that are not protected from running multiple times.
2016-07-06 10:13:31 -04:00
Brad King
f9dbe22ca2 Intel: Do not use GNU-like flags on Windows
Refactor options out of `Modules/Compiler/Intel-{ASM,C,CXX,Fortran}.cmake`
into a common helper in `Modules/Compiler/Intel.cmake`.  Condition
them to be used only on non-Windows hosts where the Intel compiler
is GNU-like instead of MSVC-like.

Previously this worked only because the options were later overridden
by `Modules/Platform/Windows-Intel*.cmake`, but it is cleaner to not
set the options in the first place.
2016-07-05 13:58:42 -04:00
Brad King
2eca4dd2d1 Use Intel for Linux flags only on Linux
The commit "Split Intel compiler information files" moved some Linux
specific flags into the platform-independent Intel compiler info files.
This moves them back.
2009-09-01 13:55:13 -04:00
Brad King
2ce6a7d0fb Split Intel compiler information files
This moves platform-independent Intel compiler flags into separate
"Compiler/Intel-<lang>.cmake" modules.  Platform-specific flags are
left untouched.
2009-08-21 09:54:42 -04:00