Commit Graph

29720 Commits

Author SHA1 Message Date
Brad King
dd1f26e22e Merge topic 'export-namelink' into release-3.19
38bcb5c0a3 export: Do not fail generation for separate namelink only case

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5556
2020-12-02 09:17:50 -05:00
Brad King
b76013b515 Merge topic 'ninja-regen-metadata' into release-3.19
73d1c78bf4 ci: update to use ninja 1.10.2
11f4259362 Ninja: Clean metadata after regen during build on Windows with 1.10.2+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5555
2020-12-01 09:29:11 -05:00
Deniz Bahadir
38bcb5c0a3 export: Do not fail generation for separate namelink only case
Update the change from commit 64690f6df0 (export: Do not fail generation
for namelink-only case, 2020-10-09, v3.19.0-rc1~7^2) to also handle
separate namelink-only and namelink-skip calls.

Fixes: #21529
2020-12-01 07:35:17 -05:00
Brad King
11f4259362 Ninja: Clean metadata after regen during build on Windows with 1.10.2+
Ninja 1.10.2 fixes support for `generator = 1` rules that run metadata
update commands during regeneration while a build is running.  Update
the condition added by commit ccaa0bccc4 (Ninja: Do not clean metadata
when re-generating inside a running build, 2020-01-27,
v3.17.0-rc1~73^2) to remove our workaround when Ninja is new enough.

Fixes: #20274
2020-11-30 14:57:48 -05:00
Cristian Adam
35432aabda PCH: Fix compiler errors on iOS multi-arch using Ninja Multi-Config
Fixes: #21401
2020-11-30 13:31:51 -05:00
Stephen Kelly
34f6d76755 QNX: Do not disable compiler extensions for CMake itself
The `set(CMAKE_CXX_EXTENSIONS FALSE)` option has the effect of passing
compile option `-std=c++NN` instead of `-std=gnu++NN`.  On some
platforms, the latter form (or the secondary effects that it has, such
as setting _XOPEN_SOURCE) is required.  This typically affects platforms
such as mingw, cygwin and QNX.  The GNU-like compiers default to
`-std=gnu++NN`, which means that users can typically build source code
on those platforms by default.

While the `set(CMAKE_CXX_EXTENSIONS FALSE)` option was set here in
commit f034b0f6 (CMake compilation: do not use compiler extensions,
2020-03-14), the other changes in that commit added `#defines` which
become required in the absense of use of `-std=gnu++NN`.  However, only
platforms regularly tested in the cmake dashboard were ported, as is
reasonable.  That made CMake fail to compile on QNX and perhaps other
platforms which for which no one is submitting regular testing to the
cmake dashboard.

Make the `set(CMAKE_CXX_EXTENSIONS FALSE)` option conditional on non-QNX
to restore the QNX build.

Issue: #21503
2020-11-25 10:17:29 -05:00
Brad King
64fb825438 CMake 3.19.1 2020-11-24 08:50:26 -05:00
Brad King
1f1d705154 Merge topic 'policy-cmp0111-iface' into release-3.19
54ef732b0c cmVisualStudio10TargetGenerator: Avoid GetFullPath on INTERFACE library
f06f4b517c cmTarget: Do not enforce CMP0111 on imported INTERFACE libraries
43c95df8fb Tests: Match RunCMake.CMP0111 stderr more strictly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5530
2020-11-24 08:43:22 -05:00
Brad King
aeb0e40111 Merge topic 'fix-find-make-program' into release-3.19
ef91fb02f3 cmGlobalGenerator: FindMakeProgram() at a generator-specific time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Frank Dana <ferdnyc@gmail.com>
Merge-request: !5529
2020-11-24 08:42:32 -05:00
Brad King
6b4bb3bf7f Merge topic 'xcode-cc-work-dir' into release-3.19
36921d2d23 Xcode: Fix custom command work-dir placeholders in "new build system"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5527
2020-11-24 08:41:23 -05:00
Brad King
2ca9016376 Merge topic 'cmFileTime-fix-overflow' into release-3.19
b4c994f69c cmFileTime: Fix overflow on time computation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5526
2020-11-24 08:40:08 -05:00
Brad King
54ef732b0c cmVisualStudio10TargetGenerator: Avoid GetFullPath on INTERFACE library
Issue: #21470
2020-11-23 15:57:05 -05:00
Brad King
f06f4b517c cmTarget: Do not enforce CMP0111 on imported INTERFACE libraries
Fix logic added by commit 359c500a24 (cmTarget: Raise error if imported
target location is not set, 2020-08-08, v3.19.0-rc1~273^2) to exclude
INTERFACE libraries from the policy.  They have no location.

Fixes: #21470
2020-11-23 15:56:28 -05:00
Kyle Edwards
ef91fb02f3 cmGlobalGenerator: FindMakeProgram() at a generator-specific time
d5b5c192 moved FindMakeProgram() to an earlier time, which resulted
in CMAKE_MAKE_PROGRAM not being read from the toolchain file. Change
it to only call FindMakeProgram() early in the specific cases of
Visual Studio and Xcode, and restore the old behavior for all other
generators.

Fixes: #21486
2020-11-23 14:20:08 -05:00
Brad King
ed049d1678 Merge topic 'fix-compile-db-crash' into release-3.19
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:58 -05:00
Brad King
36921d2d23 Xcode: Fix custom command work-dir placeholders in "new build system"
The placeholders for `CONFIGURATION` and `EFFECTIVE_PLATFORM_NAME` need
to be handled in the `WORKING_DIRECTORY` of custom commands just as we
already do for the `COMMAND`.

Fixes: #21483
2020-11-23 10:24:13 -05:00
Marc Chevrier
b4c994f69c cmFileTime: Fix overflow on time computation
On Windows, time starting point is Januray, 1st of 1601.
So computing number of nanoseconds from this date exceeds 64bit
capabilities.
2020-11-23 15:03:25 +01: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
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