Commit Graph

29873 Commits

Author SHA1 Message Date
Brad King
c178fad186 Merge topic 'fix-compile-db-crash'
67e2130c96 Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5521
2020-11-23 11:19:59 -05:00
Kitware Robot
732cc38459 CMake Nightly Date Stamp 2020-11-23 00:01:15 -05:00
Kitware Robot
4c67c0d28f CMake Nightly Date Stamp 2020-11-22 00:01:05 -05:00
Kitware Robot
17a37a83b0 CMake Nightly Date Stamp 2020-11-21 00:01:11 -05:00
Brad King
bf241bcc1e Merge topic 'improve_cmakes_error_handling_of_bad_parameters'
7302a23a1f cmake: Simplify -W recognition of no- and error= prefixes
98290782b6 cmake: redesign command-line argument parsing
d800c26ce9 cmake: Fix processing of -Wno-error= flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Merge-request: !5458
2020-11-20 10:09:03 -05:00
Brad King
60a131efd5 Merge topic 'revert-explicit-LANGUAGE-flag'
30aa715fac Revert "specify language flag when source LANGUAGE property is set"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5519
2020-11-20 10:05:11 -05:00
Brad King
67e2130c96 Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule
Fixes: #21471
2020-11-20 09:45:14 -05:00
Kitware Robot
8dc3ef670d CMake Nightly Date Stamp 2020-11-20 00:01:08 -05:00
Brad King
30aa715fac Revert "specify language flag when source LANGUAGE property is set"
Revert commit 74b1c9fc8e (Explicitly specify language flag when source
LANGUAGE property is set, 2020-06-01, v3.19.0-rc1~722^2) and the lookup
tables from its two immediate ancestors.  The purpose of that change was
to convert an explicit `LANGUAGE` source file property into an explicit
language specification compiler flag like `-x c`.  This seems reasonable
since the property is documented as meaning "indicate what programming
language the source file is".  It is also needed to help compilers deal
with non-standard source file extensions they don't recognize.

However, some projects have been setting `LANGUAGE C` on `.S` assembler
source files to mean "use the C compiler".  Passing `-x c` for them
breaks the build because the `.S` sources are not written in C.  These
projects should be updated to use `enable_language(ASM)`, for which
CMake often chooses the C compiler as the assembler when using
toolchains that support it (which would have to be the case for projects
using the approach).

Revert the change for now to preserve the old behavior for such projects.
We can re-introduce it with a policy in a future version of CMake.

Fixes: #21469
Issue: #14516, #20716
2020-11-19 17:06:03 -05:00
Brad King
f800e28a9c Merge topic 'scandep-p1689r3'
2cb1d77c58 scandep: update format to P1689 R3

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !5515
2020-11-19 10:43:26 -05:00
Brad King
7302a23a1f cmake: Simplify -W recognition of no- and error= prefixes 2020-11-19 08:53:58 -05:00
Robert Maynard
98290782b6 cmake: redesign command-line argument parsing
Make handling more consistent:

   "-S" -> invalid
   "-S/path/to/source" -> valid
   "-S /path/to/source" -> valid
   "-S=/path/to/source" -> now valid

   "-D" -> invalid
   "-DStr" -> valid
   "-D Str" -> valid
   "-D=Str" -> now valid

   "--log-level=" -> invalid
   "--log-level" -> invalid
   "--log-level=2" -> valid
   "--log-level 2" -> now valid
2020-11-19 08:53:58 -05:00
Kitware Robot
785552c754 CMake Nightly Date Stamp 2020-11-19 00:01:24 -05:00
Brad King
2cb1d77c58 scandep: update format to P1689 R3
The `work-directory` field has been moved into individual rules since
each one may correspond to a different compiler invocation and therefore
a different work directory.

Support for arbitrary binary paths has been removed for simplicity.
We now assume paths have a valid UTF-8 round-trip representation.
2020-11-18 10:42:57 -05:00
Brad King
222bf361e4 CMake 3.19.0 2020-11-18 07:46:23 -05:00
Brad King
04b6de78a7 Merge topic 'ninja-fortran-ddi-format'
f3eed2c49d cmGlobalNinjaGenerator: use P1689 dependency file format for Fortran
a02c4ccabc cmScanDepFormat: add reader and writer for the format from P1689R2
fa18069ebd Ninja: Exclude unused dyndep features during CMake bootstrap

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michael Hirsch, Ph.D. <michael@scivision.dev>
Merge-request: !5485
2020-11-18 07:32:21 -05:00
Brad King
c8b2331e8b Merge topic 'rename_cuda_memcheck'
fea49b2df0 CTest: Rename CudaMemcheck to CudaSanitizer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5514
2020-11-18 07:29:54 -05:00
Kitware Robot
e58bc4bc31 CMake Nightly Date Stamp 2020-11-18 00:01:28 -05:00
Tobias Ribizel
fea49b2df0 CTest: Rename CudaMemcheck to CudaSanitizer 2020-11-17 21:06:30 +01:00
Brad King
d800c26ce9 cmake: Fix processing of -Wno-error= flags
Fix two bugs that happened to cancel each other out for cases covered
by our test suite.  Add a test case that distinguishes them.
2020-11-17 13:22:52 -05:00
Ben Boeckel
f3eed2c49d cmGlobalNinjaGenerator: use P1689 dependency file format for Fortran
The module dependency specification format described in the C++
JTC1/SC22/WG21 paper [1] is also suitable for use by Fortran.

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1689r2.html
2020-11-17 13:17:04 -05:00
Ben Boeckel
a02c4ccabc cmScanDepFormat: add reader and writer for the format from P1689R2
This format is currently subject to change, but is not too far from the
end goal.

Some bits are currently unimplemented (see TODO comments).
2020-11-17 13:16:05 -05:00
Brad King
c0619861c9 Merge topic 'cmake-build-specify-makefile-name'
cfce067b3f Tests: Add RunCMake.Make case for conflicting Makefile names
378c047ae3 Makefiles: Explicitly tell 'make' tool what Makefile name to use

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5509
2020-11-17 13:16:02 -05:00
Brad King
0b47e940cf Merge topic 'cpack-deb-no-dbgsyms'
c826745f5a CPack/DEB: Do not crash when asked for debug symbols when there are none

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5443
2020-11-17 13:14:54 -05:00
Brad King
0c0e7525c4 Merge topic 'pch-header-not-generated'
7524501d89 PCH: Do not mark PCH-header as generated

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5510
2020-11-17 13:13:49 -05:00
Kitware Robot
9506449445 CMake Nightly Date Stamp 2020-11-17 00:01:09 -05:00
Craig Scott
67ebcfbcbb Merge topic 'xcode-clean-lib-paths'
b1ef2fffe7 Xcode: Clean library paths to avoid linker duplicate symbol definitions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5511
2020-11-16 14:23:52 -05:00
Andrew Fuller
c826745f5a CPack/DEB: Do not crash when asked for debug symbols when there are none
Fixes: #21356
2020-11-16 14:03:07 -05:00
Deniz Bahadir
7524501d89 PCH: Do not mark PCH-header as generated
The PCH header file itself is written by CMake and is not generated by
part of the buildsystem.  Therefore the `GENERATED` property is not
appropriate to set because the file is always present before the build
starts.  We already do not mark the PCH source file as `GENERATED`
either.

This is a preparation for solving #18399, which will no longer allow to
unset the `GENERATED` property from a source-file once it was set.

Fixes: #21437
Signed-off-by: Deniz Bahadir <dbahadir@benocs.com>
2020-11-16 12:56:54 -05:00
Brad King
fa18069ebd Ninja: Exclude unused dyndep features during CMake bootstrap 2020-11-16 11:42:40 -05:00
Oliver Schneider
378c047ae3 Makefiles: Explicitly tell 'make' tool what Makefile name to use
CMake did not specify the filename of the Makefile generated by it.
Due to GNU make precedence rules this means that the presence of a
GNUmakefile or makefile would take precedence over the generated
Makefile.

This is only relevant for in-source builds and only whenever an
alternative makefile by the above mentioned names exists.

This patch adds the (seemingly universal) `-f` switch and the
(hardcoded) filename (it is now hardcoded separately in these two
files):

- cmLocalUnixMakefileGenerator3.cxx
- cmGlobalUnixMakefileGenerator3.cxx

Fixes: #21418
2020-11-16 11:34:53 -05:00
Brad King
01b473b810 Merge topic 'msvc-no-GR'
c00a6d3967 MSVC: Do not add /GR to CMAKE_CXX_FLAGS by default
6114c8e994 MSVC: Factor out initialization of /GR flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5508
2020-11-16 11:19:28 -05:00
Kitware Robot
3ae680841c CMake Nightly Date Stamp 2020-11-16 00:01:17 -05:00
Gusts Kaksis
b1ef2fffe7 Xcode: Clean library paths to avoid linker duplicate symbol definitions 2020-11-16 07:14:57 +11:00
Kitware Robot
75ced70154 CMake Nightly Date Stamp 2020-11-15 00:01:07 -05:00
Craig Scott
eb04e25ba6 Merge topic 'cmake_path-enhancements'
ed21ad181e cmake_path: various enhancements to subcommands/keywords

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5457
2020-11-14 06:39:42 -05:00
Kitware Robot
5501958d16 CMake Nightly Date Stamp 2020-11-14 00:01:08 -05:00
Brad King
c00a6d3967 MSVC: Do not add /GR to CMAKE_CXX_FLAGS by default
The `/GR` flag has been on by default since MSVC cl 14.0 from VS 2005.
Remove it from the default flags to make it easier for projects to pass
`/GR-` themselves to turn it off.

Projects may be using string processing to replace `/GR` with another
flag, so we cannot simply drop it.  Add a policy to drop it in a
compatible way.

Fixes: #21428
2020-11-13 11:46:23 -05:00
Kitware Robot
8b8f0197eb CMake Nightly Date Stamp 2020-11-13 00:01:08 -05:00
Brad King
7ac092bd39 Merge topic 'suppress-link-messages'
8e2eba6b4c MSVC: Suppress rc/mt/link output unless verbose is requested

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5492
2020-11-12 09:13:50 -05:00
Kitware Robot
8705f9116e CMake Nightly Date Stamp 2020-11-12 00:01:09 -05:00
Marc Chevrier
ed21ad181e cmake_path: various enhancements to subcommands/keywords
This change address partly the remarks done in issue #21385
2020-11-11 23:43:51 +01:00
Brad King
5e3b0aa9b2 Merge topic 'ninja-cleandead-no-dyndep'
c5011399c5 Ninja: Avoid cleandead with dyndep bindings for Fortran module dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5490
2020-11-11 09:34:17 -05:00
Orgad Shaneh
8e2eba6b4c MSVC: Suppress rc/mt/link output unless verbose is requested
Output like the following is typically not interesting at all:
LINK : program database F:\Project\Project.pdb missing; performing full link
   Creating library Project.lib and object Project.exp

Fixes #21422
2020-11-11 14:46:58 +02:00
Kitware Robot
e31ccdd4c4 CMake Nightly Date Stamp 2020-11-11 00:01:36 -05:00
Brad King
c5011399c5 Ninja: Avoid cleandead with dyndep bindings for Fortran module dependencies
The Ninja `cleandead` tool does not account for implicit outputs
discovered by `dyndep` bindings and can remove Fortran `.mod` files that
are still needed.  Disable the `cleandead` step when using `dyndep`
bindings.

Fixes: #21406
2020-11-10 15:16:28 -05:00
Kitware Robot
cb5cf3f04d CMake Nightly Date Stamp 2020-11-10 00:01:10 -05:00
Brad King
2b0a1180b0 Merge topic 'ninja-dyndep-refactor'
941be1d356 cmNinjaTargetGenerator: Clarify variable names for preprocessing conditions
33a8e0bb09 cmNinjaTargetGenerator: Simplify scan rule depfile selection
bff1871c39 cmNinjaTargetGenerator: Generalize GetScanRule helper
9f60e8aa52 cmNinjaTargetGenerator: Remove redundant conditions for dyndep blocks
43fe7e0c97 cmNinjaTargetGenerator: Revise conditions to clarify dyndep code paths
1416012f2c cmNinjaTargetGenerator: Clarify scan rule code grouping
f2eec04728 cmNinjaTargetGenerator: Clarify scan rule helper functions
170cfc764d cmNinjaTargetGenerator: Drop unnecessary mutation
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5478
2020-11-09 08:02:33 -05:00
Kitware Robot
eb48859594 CMake Nightly Date Stamp 2020-11-09 00:01:10 -05:00
Kitware Robot
94be747920 CMake Nightly Date Stamp 2020-11-08 00:01:06 -05:00