Commit Graph

29702 Commits

Author SHA1 Message Date
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
222bf361e4 CMake 3.19.0 2020-11-18 07:46:23 -05:00
Tobias Ribizel
fea49b2df0 CTest: Rename CudaMemcheck to CudaSanitizer 2020-11-17 21:06:30 +01:00
Gusts Kaksis
b1ef2fffe7 Xcode: Clean library paths to avoid linker duplicate symbol definitions 2020-11-16 07:14:57 +11: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
Brad King
7a04f45722 CMake 3.19.0-rc3 2020-11-06 09:19:57 -05:00
Brad King
dd8c91a4f3 Merge topic 'cmake-gui-file-dialog-crash' into release-3.19
5f782119c8 cmake-gui: Restore workaround for crash in file dialog

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5472
2020-11-06 07:57:51 -05:00
Brad King
5f782119c8 cmake-gui: Restore workaround for crash in file dialog
In commit ce9dbceb42 (QtDialog: remove Qt4-only code, 2020-06-02,
v3.19.0-rc1~712^2~1) we removed an event filter that was thought to be
necessary only as a workaround for a bug in Qt.  However, that bug was
fixed in Qt 4.5, and the file dialog still crashes as of Qt 5.14 without
the filter.  Restore the workaround pending further investigation.

Fixes: #21400
2020-11-05 14:50:45 -05:00
Gusts Kaksis
bffb17be3d Xcode: Inherit target library and framework search paths from project
Xcode has multiple levels of build settings with priority in descending
order:

1. Target
2. Project
3. Workspace
4. SDK defaults

`CMAKE_XCODE_ATTRIBUTE_*` path variables add these to project level, but
linked frameworks and libraries override this in target level.  Add the
`$(inherited)` macro to keep both in the final list.

Fixes: #21387
2020-11-05 13:48:54 +02:00
Marc Chevrier
1c912056a1 cmake_path: remove new command from 3.19
Defer adding this command until post-3.19 development so that it
has more time to mature before being included in a release.

Issue: #21385
2020-11-03 09:55:35 -05:00
Kyle Edwards
cb2d01c182 CMakePresets.json: Don't warn if no path argument is given
If --preset is specified with no path argument, use the current
directory as the source directory, the preset's binaryDir as the
binary directory, and don't issue the standard warning for no path
specified.

Fixes: #21386
2020-11-02 09:46:08 -05:00
Brad King
f506cc6bb2 CMake 3.19.0-rc2 2020-10-28 08:03:20 -04:00
Brad King
199247c21a Merge topic 'cmake-presets-help-flag' into release-3.19
c619be2784 ccmake: Don't list --preset in --help

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5428
2020-10-28 07:47:37 -04:00
Brad King
fe310851a8 Merge topic 'cmake-gui-manual-argument' into release-3.19
ef03124237 CMake GUI: Add --browse-manual argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5417
2020-10-28 07:37:07 -04:00
Brad King
15caa11da5 Merge topic 'xcode-fix-source-linking' into release-3.19
5dc23300b1 Xcode: Fix regression that automatically links libraries in source list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5432
2020-10-28 07:26:46 -04:00
Kyle Edwards
ef03124237 CMake GUI: Add --browse-manual argument 2020-10-27 12:05:41 -04:00
Kyle Edwards
c619be2784 ccmake: Don't list --preset in --help
And show available options in cmake-gui.

Fixes: #21313
2020-10-27 10:29:24 -04:00
Brad King
8d6a0b9364 Merge topic 'cuda_vs_skip_computation' into release-3.19
dd77dec18d VS: Don't compute CUDA options unless necessary
e9109dec36 Merge branch 'ninja-multi-per-config-sources' into release-3.18
7c0de4175b Merge branch 'cmake-E-cat-binary' into release-3.18

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5422
2020-10-27 08:20:54 -04:00
Craig Scott
698851cdb7 Merge topic 'cmake-presets-path-arg' into release-3.19
b7d7eca66d CMakePresets.json: Rework how --preset argument is handled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5416
2020-10-27 07:33:45 -04:00
Raul Tambre
dd77dec18d VS: Don't compute CUDA options unless necessary
In the following scenario (with 3.18 policies):
1. A CXX target is created.
2. CUDA language is enabled.

CMake 3.18 introduced CMP0104, which requires CUDA_ARCHITECTURES to be
set.  Because the CXX target was created before CUDA was enabled it
wouldn't have it set.  The Visual Studio generator would however end up
computing CUDA compile options for the CXX target, which would result in
a fatal error due to the policy violation.

There doesn't seem to be a reason to do this for targets that don't
actually use the CUDA language, so we can skip and generate the CXX
target just fine.

Fixes: #21341
2020-10-27 07:29:01 -04:00
Gusts Kaksis
5dc23300b1 Xcode: Fix regression that automatically links libraries in source list
In commit e637744c51 (Xcode: Use "Link Binary With Libraries" to link
any library, 2019-07-10, v3.19.0-rc1~494^2~1) we accidentally added all
the library type files to "Link Binary With Libraries" build phase if
they were passed in as source files.  Revert that change as any actually
linked libraries will be added to that build phase later in the
`AddDependAndLinkInformation` call.

Fixes: #21361
2020-10-27 07:12:26 -04:00
Brad King
e9109dec36 Merge branch 'ninja-multi-per-config-sources' into release-3.18
Merge-request: !5430
2020-10-26 16:14:00 -04:00
Kyle Edwards
b8937a992b Merge branch 'release' into ninja-multi-per-config-sources 2020-10-26 15:43:57 -04:00
Kyle Edwards
d13bd6ec3d Ninja Multi-Config: Don't try to calculate dependencies for "all" 2020-10-26 15:37:04 -04:00
Brad King
9fa7afe7d3 Merge topic 'correct_profiling-output_exception' into release-3.19
afac7482d2 cmake: command arguments which use '=' behave consistently

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5414
2020-10-26 10:29:22 -04:00
Brad King
a1fe3be2bf Merge topic 'per-config-source-TARGET_FILE' into release-3.19
cd33bfcad5 add_custom_command: Properly recognize if sources depend on config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5410
2020-10-26 10:28:30 -04:00
Kyle Edwards
b7d7eca66d CMakePresets.json: Rework how --preset argument is handled
If a path argument with no -S or -B leads to a cache directory,
use that directory as the binary directory. Otherwise, use the
binary directory from the preset.

Fixes: #21311
2020-10-26 22:32:45 +11:00
Robert Maynard
afac7482d2 cmake: command arguments which use '=' behave consistently
Fixes: #21351

The `profiling-format`, `profiling-output`, and `preset` all would
crash when invoked without a trailing `=`.
2020-10-23 09:12:43 -04:00
Brad King
f2a59d400e Merge topic 'vs-fortran-debugging-flags' into release-3.19
8ad6fabfc5 VS: Remove flag table entries for Fortran /Z* flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5406
2020-10-23 08:44:47 -04:00
Craig Scott
5e1858c0c2 Merge topic 'cmake-presets-toolset-arch-config' into release-3.19
64afabdbcb CMakePresets.json: Split cmakeGeneratorConfig field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5387
2020-10-23 06:37:56 -04:00
Deniz Bahadir
cd33bfcad5 add_custom_command: Properly recognize if sources depend on config
Fixes: #21349
2020-10-22 23:03:05 +02:00
Kyle Edwards
64afabdbcb CMakePresets.json: Split cmakeGeneratorConfig field
Make this field separate for both architecture and toolset. Allow
architecture and toolset to be either strings or objects with value
and strategy fields.

Fixes: #21317
2020-10-22 11:24:39 -04:00
Kyle Edwards
25742c589c CMakePresets.json: Add ${sourceDirName} macro
Fixes: #21312
2020-10-22 11:09:28 -04:00
Kyle Edwards
609122007d Merge topic 'cmake-presets-invalid-macro' into release-3.19
638557cbfe CMakePresets.json: Properly report macro expansion errors

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5397
2020-10-22 11:05:09 -04:00
Volker Jacht
8ad6fabfc5 VS: Remove flag table entries for Fortran /Z* flags
These were included when the Fortran flag table was first created by
commit 10c91ded4f (ENH: add support for Intel Fortran Visual studio IDE,
2008-04-30, v2.8.0~2227), but they map to fields not actually supported
by the IDE.  Remove their table entries.

Instead use just `/debug:minimal` and `/debug:full` to control debug
information level in VS Intel Fortran.  Let flags like `/Z7` pass
through as raw additional options because they have no corresponding IDE
property and can be used to complement the supported options.

Fixes: #21340
2020-10-22 09:08:52 -04:00
Kyle Edwards
920d180047 CMakePresets.json: Allow boolean for cache variable value
Fixes: #21327
2020-10-21 10:37:08 -04:00
Kyle Edwards
638557cbfe CMakePresets.json: Properly report macro expansion errors
Make a distinction between strings which simply use the
$vendor{<...>} macro, which is valid but makes it unusable by CMake,
and strings which actually contain invalid macro expansions.

Fixes: #21308
2020-10-21 09:20:52 -04:00
Brad King
0356b81525 find_package: Fix regression in searching root prefix
Fix the check added by commit 2ff1693066 (find_package: avoid showing
files as directories when searching config files, 2020-09-30,
v3.19.0-rc1~67^2) to avoid skipping the root prefix `/`.

Fixes: #21324
2020-10-19 11:08:49 -04:00
Brad King
f4e6dfe55d Merge topic 'separate_arguments-no-args' into release-3.19
747f80fe82 separate_arguments: Fix crash on *_COMMAND with no arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5382
2020-10-19 10:26:30 -04:00
Brad King
ae1ca3034e Merge topic 'doc-CMP0111' into release-3.19
5c3a91c808 CMP0111: Clarify that the new error is on a missing property setting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex Reinking <alex_reinking@berkeley.edu>
Merge-request: !5385
2020-10-19 10:23:50 -04:00
Craig Scott
792863ac29 Merge topic 'cmake-gui-disable-presets' into release-3.19
d471406f0b CMake GUI: Disable preset fields instead of hiding them

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !5374
2020-10-17 07:13:18 -04:00
Kyle Edwards
d471406f0b CMake GUI: Disable preset fields instead of hiding them 2020-10-16 15:16:04 -04:00
Brad King
e1d124286a Merge topic 'file-configure-angle-brackets' into release-3.19
06a9a3bdc3 file(CONFIGURE): Allow angle brackets in content

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5379
2020-10-16 09:23:42 -04:00
Robert Bozzetto
747f80fe82 separate_arguments: Fix crash on *_COMMAND with no arguments
Fixes: #21320
2020-10-16 08:49:28 -04:00
Brad King
5c3a91c808 CMP0111: Clarify that the new error is on a missing property setting
The previous wording could be confused with the file missing on disk.
2020-10-16 08:26:00 -04:00
Brad King
b9cb1d324d Fix regression in test/install/package configuration selection
In commit 7a969fe21d (cmMakefile: Refactor API to better handle empty
config values, 2020-06-30, v3.19.0-rc1~567^2), calls to
`GetGeneratorConfigs` that pass `OnlyMultiConfig` only want to get any
configurations listed if the generator is multi-config.  Fix the
implementation to actually do that.

Fixes: #21316
2020-10-15 10:53:09 -04:00
Cristian Adam
06a9a3bdc3 file(CONFIGURE): Allow angle brackets in content
Fixes: #21306
2020-10-15 15:42:21 +02:00
Brad King
b1d9a25f35 Merge topic 'cmake-E-cat-binary' into release-3.19
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management
f1fdd15863 clang-format: Fix include block order in ctest.cxx and cpack.cxx

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5364
2020-10-15 08:10:50 -04:00
Johnny Jazeix
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
Reset `std::cout` to write in binary mode with no encoding conversions.

Co-Author: Brad King <brad.king@kitware.com>
Fixes: #21295
2020-10-14 12:08:07 -04:00
Brad King
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management 2020-10-14 12:08:06 -04:00