Commit Graph

28378 Commits

Author SHA1 Message Date
Brad King
bd580b7d56 CMake 3.17.1 2020-04-09 08:33:17 -04:00
Brad King
b8b98c98c3 Merge topic 'ccmake_incremental_log_display' into release-3.17
60bfaa8fe6 ccmake: Use incremental rendering for the logs
e9b36731e9 cmCursesLongMessageForm: Factor out helper to draw message to form

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !4573
2020-04-09 08:12:12 -04:00
Brad King
0f72aba269 Merge topic 'apple-arch-sysroots' into release-3.17
84a1e67380 Apple: Fix mapping CMAKE_APPLE_ARCH_SYSROOTS to custom OSX_ARCHITECTURES
45fa9b32ca Apple: Improve handling of missing SDKs in CMAKE_APPLE_ARCH_SYSROOTS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4583
2020-04-09 08:10:55 -04:00
Sylvain Joubert
60bfaa8fe6 ccmake: Use incremental rendering for the logs
This should avoid an exponential slowdown in the display time for
projects with lots of output.
This is still slower than cmake due to the ncurses drawing, but it should
now be O(L) in total and not O(L^2) wrt to output length.

Fixes: #20535
2020-04-08 14:40:09 -04:00
Brad King
e9b36731e9 cmCursesLongMessageForm: Factor out helper to draw message to form 2020-04-08 14:39:46 -04:00
Brad King
84a1e67380 Apple: Fix mapping CMAKE_APPLE_ARCH_SYSROOTS to custom OSX_ARCHITECTURES
The `CMAKE_OSX_ARCHITECTURES` value is not used directly by generators.
It is used to initialize a per-target `OSX_ARCHITECTURES` property, but
that property can also be set explicitly by project code to a subset of
the full list of architectures.  In order to handle this case, construct
a mapping from each `CMAKE_OSX_ARCHITECTURES` entry to the corresponding
`CMAKE_APPLE_ARCH_SYSROOTS` entry by name.  Use the mapping to find the
sysroot for each entry in `OSX_ARCHITECTURES` for a given target.

If `CMAKE_APPLE_ARCH_SYSROOTS` does not have the same length as
`CMAKE_OSX_ARCHITECTURES`, error out early rather than risking a crash
or assertion failure.

Fixes: #20534
2020-04-08 13:40:09 -04:00
Brad King
45fa9b32ca Apple: Improve handling of missing SDKs in CMAKE_APPLE_ARCH_SYSROOTS
Use `<arch>-SDK-NOTFOUND` instead of an empty string as a placeholder in
`CMAKE_APPLE_ARCH_SYSROOTS` for architectures whose SDK is not found.
This ensures the length of `CMAKE_APPLE_ARCH_SYSROOTS` matches the
length of `CMAKE_OSX_ARCHITECTURES`.  It also makes the missing SDKs
more visible in the value.

Issue: #20534
2020-04-08 11:51:02 -04:00
Kyle Edwards
2f949be4b3 Ninja: Make config uppercase in object order target
Fixes: #20539
2020-04-07 14:28:35 -04:00
Brad King
3d61ff7b10 Merge topic 'llvm-rc-include-path' into release-3.17
35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4570
2020-04-07 08:00:44 -04:00
Thomas Bernard
35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing
Since commit 1c2d031cbd (Add -E cmake_llvm_rc to preprocess files for
llvm-rc, 2020-01-14, v3.17.0-rc1~24^2) with llvm-rc we explicitly
preprocess RC source files and then compile separately without -I flags.
This broke cases where the RC source references data files adjacent to
itself or in the include path.

This change adds the expansion of the include paths when calling the
llvm-rc in order for the resource files to be picked up correctly by
llvm-rc.  Since the RC compiled file is first preprocessed, the file
being compiled by llvm-rc resides in the build directory. In order for
llvm-rc to find the resource data specified relative to the .rc file
being compiled, the source file path is preppended in the include list
so that the original source path takes priority over all the other
includes paths specified.

A space was added in the CMAKE_INCLUDE_FLAG_RC to make the include
directive work properly for llvm-rc. Checks on the rc.exe showed that
the syntax change doesn't affect it's proper operation.

Fixes: #20529
2020-04-06 21:19:12 +02:00
Brad King
d68794a707 Merge topic 'cpack-nsis-version' into release-3.17
aa78a2537c CPack/NSIS: Document and check requirement of at least NSIS 3.0

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4552
2020-04-01 10:43:24 -04:00
Brad King
aa78a2537c CPack/NSIS: Document and check requirement of at least NSIS 3.0
Since commit 9d2816544e (CPack/NSIS: Also preload the "UserInfo.dll"
plugin, 2020-01-04, v3.17.0-rc1~204^2) we require NSIS 3.0.  Since
older versions do not support Windows 8 or above, we can now require
at least version 3.0.

Fixes: #20514
2020-03-31 10:57:28 -04:00
Brad King
69c8bf6967 Merge topic 'link-libs-config-case' into release-3.17
2af18704fd Merge branch 'backport-3.16-link-libs-config-case'
3f976bf201 target_link_libraries: Fix regression in case of $<CONFIG> genex
5a95b5e091 target_link_libraries: Fix regression in case of $<CONFIG> genex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4544
2020-03-31 09:19:42 -04:00
Brad King
3f976bf201 target_link_libraries: Fix regression in case of $<CONFIG> genex
Since commit b8626261e9 (Precompile headers: Add methods to generate PCH
sources, 2019-07-13, v3.16.0-rc1~182^2~4) we look up source files for a
target using an upper-case configuration even though an original-case
name is sufficient.  Since commit 36ded610af (PCH: Generate sources
during Compute step, 2019-10-05, v3.16.0-rc1~2^2) the source file lookup
is the first time we compute many on-demand structures that depend on
the configuration name.  This caused the `$<CONFIG>` generator
expression to evaluate to the upper-case configuration name in some
cases where we used original-case before.

Fix this by switching the source file lookup to the original-case config
name.  Add a test covering the symptom that led to the discovery of this
problem.

Fixes: #20517
2020-03-30 11:33:55 -04:00
Brad King
b835c5d5c9 Merge topic 'ctest-timeout-report' into release-3.17
7fda917fa4 CTest: Fix reported duration on timeout when grindchild keeps pipes open

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4530
2020-03-27 07:46:14 -04:00
Brad King
2fe8ea555e Merge topic 'llvm-rc-stderr' into release-3.17
dc93cbb0d8 llvm-rc: Print stderr output when calling tools through cmake_llvm_rc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4525
2020-03-27 07:39:29 -04:00
Brad King
0af3a9b755 Merge topic 'make-nested-silent' into release-3.17
d6d9da5178 Makefiles: Fix silencing of nested calls for GNU make 4.3

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4515
2020-03-27 07:35:12 -04:00
Brad King
7fda917fa4 CTest: Fix reported duration on timeout when grindchild keeps pipes open
Since commit d1976cd1f2 (CTest: Fix timeout when grandchild keeps pipes
open, 2020-01-13, v3.17.0-rc1~169^2) we no longer hang, but the test
duration we report after the timeout is the amount of time the immediate
child ran before exiting.  Fix the logic to instead report the actual
amount of time we spent monitoring the test before the timeout.

Fixes: #20509
2020-03-26 14:35:54 -04:00
Thomas Bernard
dc93cbb0d8 llvm-rc: Print stderr output when calling tools through cmake_llvm_rc
The stored error pipe is output if the program fails.

Fixes: #20494
2020-03-26 07:59:55 -04:00
Brad King
d6d9da5178 Makefiles: Fix silencing of nested calls for GNU make 4.3
Since GNU make 4.3, `.SILENT:` no longer causes nested `$(MAKE)` calls
to get `-s` implicitly.  Add the `-s` flag explicitly on such calls to
suppress messages about Entering/Leaving directories.

Fixes: #20487
2020-03-26 07:34:24 -04:00
Francisco Facioni
ecc0086bfc cmake-gui: Fix use-after-free in Open-possible check
Fix `QCMake::checkOpenPossible` to copy `toLocal8Bit().data()` before
its lifetime expires.
2020-03-20 08:38:31 -04:00
Brad King
e3185e3d1b CMake 3.17.0 2020-03-20 06:26:14 -04:00
Brad King
119d1dadce Merge topic 'export-repeat' into release-3.17
8affe9aa33 export: Fix use-after-free on multiple calls overwriting same FILE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4494
2020-03-20 06:17:00 -04:00
Brad King
8affe9aa33 export: Fix use-after-free on multiple calls overwriting same FILE
CMake 3.16 and below allow multiple `export()` calls with the same output
file even without using `APPEND`.  The implementation worked by accident
by leaking memory.  Refactoring in commit 5444a8095d (cmGlobalGenerator:
modernize memrory managemenbt, 2019-12-29, v3.17.0-rc1~239^2) cleaned up
that memory leak and converted it to a use-after-free instead.

The problem is caused by using the `cmGlobalGenerator::BuildExportSets`
map to own `cmExportBuildFileGenerator` instances.  It can own only
one instance per output FILE name at a time, so repeating use of the
same file now frees the old `cmExportBuildFileGenerator` instance
and leaves the pointer in the `cmMakefile::ExportBuildFileGenerators`
vector dangling.  Move ownership of the instances into `cmMakefile`'s
vector since its entries are not replaced on a repeat output FILE.

In future work we should introduce a policy to error out on this case.
For now simply fix the use-after-free to restore CMake <= 3.16 behavior.

Fixes: #20469
2020-03-19 06:41:39 -04:00
Kyle Edwards
1994f950ff cmake: List valid values for --trace-format on the command line 2020-03-18 16:16:46 -04:00
Brad King
1ec72e0947 CMake 3.17.0-rc3 2020-03-12 09:45:24 -04:00
Brad King
d584d01103 Merge topic 'swift-link-line-spaces' into release-3.17
af39d1b993 Swift: Fix quoting of library search paths with spaces

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4469
2020-03-12 09:32:01 -04:00
Saleem Abdulrasool
af39d1b993 Swift: Fix quoting of library search paths with spaces
The library search paths added by commit 2746c61e6d (Swift: Add library
search paths for dependencies, 2019-06-09, v3.16.0-rc1~561^2) need to be
quoted properly on command lines to handle spaces and such.  This was
already done by `cmLinkLineComputer::ComputeLinkPath` for
non-Swift-specific link directories.
2020-03-12 08:46:11 -04:00
Brad King
3cf22df42e Merge topic 'ctest-curl-debugfunction' into release-3.17
7a1cce210b CTest: Fix our internal CURL_DEBUGFUNCTION to conform to CURL docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4459
2020-03-12 08:19:43 -04:00
Craig Scott
3d388e5e98 Merge topic 'rename-macho-version-properties' into release-3.17
14732d3f30 macOS: Rename OSX_*_VERSION properties to MACHO_*_VERSION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4452
2020-03-12 06:52:11 -04:00
Brad King
14732d3f30 macOS: Rename OSX_*_VERSION properties to MACHO_*_VERSION
The properties added by commit 4a62e3d97c (macOS: Add
OSX_COMPATIBILITY_VERSION and OSX_CURRENT_VERSION properties,
2020-01-24, v3.17.0-rc1~80^2~1) are general-purpose for all platforms
using Mach-O formats and not just on OS X.  Rename them accordingly.
The properties are new to the CMake 3.17 release so we can rename
them without compatibility concerns.

Fixes: #20442
2020-03-12 21:15:40 +11:00
Betsy McPhail
7a1cce210b CTest: Fix our internal CURL_DEBUGFUNCTION to conform to CURL docs
The curl debug callback function must return ``0``.

Fixes: #20449
2020-03-11 13:36:58 -04:00
Kyle Edwards
2427bbf01c Merge topic 'swift-ninja-multiconfig' into release-3.17
65b3848de0 Swift: support Ninja Multi-Config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4440
2020-03-10 10:16:17 -04:00
Brad King
cb84575b0d Merge topic 'cuda_warning' into release-3.17
6ebc6cec41 cm_cxx_features: Filter out CUDA installation warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4437
2020-03-10 08:22:57 -04:00
Brad King
d11a5d8f2b Merge topic 'invalid_alias' into release-3.17
a54d96b722 cmAlgorithms: Fix -Wnon-c-typedef-for-linkage warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4438
2020-03-10 08:22:00 -04:00
Raul Tambre
a54d96b722 cmAlgorithms: Fix -Wnon-c-typedef-for-linkage warnings
In commit bf1e73305a (cmAlgorithms: Refactor cmRemoveDuplicates,
2019-03-03, v3.15.0-rc1~414^2) we added `union X = struct {}`.
C++ had a rule change whereby only C-compatible unnamed typedefs are
allowed. Clang 11 warns about this by default.  See
https://reviews.llvm.org/D74103.  The aliases don't seem to be
necessary, so simply define as structs.
2020-03-09 09:21:25 -04:00
Raul Tambre
6ebc6cec41 cm_cxx_features: Filter out CUDA installation warnings
Clang always outputs these if it doesn't recognize the installed CUDA version.
They don't affect compiling C++.

Fixes #20434.
2020-03-09 09:17:41 -04:00
Saleem Abdulrasool
65b3848de0 Swift: support Ninja Multi-Config
Enable support for multi-configuration builds using Ninja when building
Swift.
2020-03-09 09:11:22 -04:00
Brad King
cf0dc5efbf Merge topic 'ninja-multi-custom-command-deps' into release-3.17
081c4679f7 Ninja Multi-Config: Don't build target dependencies for custom commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4423
2020-03-05 07:24:48 -05:00
Brad King
b7d8c91822 CMake 3.16.5 2020-03-04 08:50:44 -05:00
Kyle Edwards
8b799f80e3 Ninja Multi-Config: Fix spurious unused variable warning
Fixes: #20381
2020-03-03 15:52:36 -05:00
Kyle Edwards
081c4679f7 Ninja Multi-Config: Don't build target dependencies for custom commands
If cross-config mode is used, and a target depends on another target
as well as a custom command, we don't want the custom command to also
depend on the depended target, as that would build targets unnecessarily.
Fix this behavior.
2020-03-03 15:15:13 -05:00
Brad King
d1cb554c99 CMake 3.17.0-rc2 2020-03-02 14:15:14 -05:00
Brad King
5f36f1027b Merge topic 'ninja-multi-variable-shuffle-again' into release-3.17
c794b70f19 Ninja Multi-Config: Always generate build.ninja
9590c3a400 Generator: Don't allow Ninja Multi-Config variables on other generators
7a63dafafb Ninja Multi-Config: Remove "NMC" from variable names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4403
2020-02-28 11:32:06 -05:00
Kyle Edwards
185d1aefaa foreach: Set fatal error on invalid range
Fixes: #20394
2020-02-27 14:52:06 -05:00
Kyle Edwards
a33b3949e5 foreach: Fix crash when parsing invalid integer
Fixes: #20393
2020-02-27 14:52:06 -05:00
Kyle Edwards
c794b70f19 Ninja Multi-Config: Always generate build.ninja
If CMAKE_DEFAULT_BUILD_TYPE is not specified, use the first item
from CMAKE_CONFIGURATION_TYPES instead.
2020-02-27 10:39:35 -05:00
Kyle Edwards
9590c3a400 Generator: Don't allow Ninja Multi-Config variables on other generators
We may want to enable these variables later on with specific
semantics. To avoid breaking backwards compatibility, make it an
error to use them for now.
2020-02-27 09:23:08 -05:00
Kyle Edwards
7a63dafafb Ninja Multi-Config: Remove "NMC" from variable names
Also rename `..._DEFAULT_BUILD_FILE_CONFIG` to `..._DEFAULT_BUILD_TYPE`.
These name changes make the variables meaningful for future use by other
generators.
2020-02-27 09:22:08 -05:00
Brad King
813b289023 Merge topic 'pch-file-time' into release-3.17
7e9b9fe918 PCH: Copy the timestamp from an absolute header file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4400
2020-02-27 08:48:49 -05:00