Commit Graph

2934 Commits

Author SHA1 Message Date
Brad King
ea67dbc4cd Merge topic 'file_generate_target'
27a912193b file(GENERATE): Add TARGET argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5131
2020-08-25 10:31:02 -04:00
Brad King
0b0dc86eab Merge topic 'unk_imported_location'
359c500a24 cmTarget: Raise error if imported target location is not set

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5113
2020-08-25 10:30:14 -04:00
Craig Scott
b972e25276 FetchContent: Fix SOURCE_DIR, BUILD_DIR when disconnected or overridden
Fixes: #21123
2020-08-23 18:38:47 +10:00
Raul Tambre
359c500a24 cmTarget: Raise error if imported target location is not set
Previously we would synthesize <TARGET_NAME>-NOTFOUND as the location. This
would then end up on the link line and cause build failures.
Policy CMP0110 is added to control this behaviour.

Fixes #19080, #19943.
2020-08-21 08:38:39 -04:00
Raul Tambre
27a912193b file(GENERATE): Add TARGET argument
Adds TARGET argument to file(GENERATE) to make resolving generator expressions
requiring a target possible.

Implements #21101, fixes #21074.
2020-08-20 17:41:52 +03:00
Brad King
2a8f363a54 Merge topic 'fix-file-generate-cmp0070'
462b6d83e8 file(GENERATE): Test source properties
1977f7833b file(GENERATE): Update existing tests
04fbd7566a file(GENERATE): Fix missing check for policy CMP0070
2dc2732f67 file(GENERATE): Refactor outputFileName calculation
a9602bb41e file(GENERATE): Refactor inputFileName calculation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5090
2020-08-20 07:59:23 -04:00
Brad King
d13b010321 Merge topic 'msvc_c11'
f4373feda8 Tests: Fix RunCMake.try_compile test for C standards with MSVC 19.27

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5145
2020-08-20 07:49:27 -04:00
Brad King
f4373feda8 Tests: Fix RunCMake.try_compile test for C standards with MSVC 19.27
Since commit f7347f28c7 (MSVC: Record support for C11 and c_restrict,
2020-08-09) we know about MSVC C language standards.  Update the
`RunCMake.try_compile` test to be aware of this even when CMake is
itself configured by an older CMake that does not know this.
2020-08-19 14:52:52 -04:00
Brad King
fed08ce4cf Merge topic 'ExternalProject-retry-only-recoverable'
116b06870d ExternalProject: add INACTIVITY_TIMEOUT argument
f24e34975a ExternalProject: retry download on recoverable errors

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5034
2020-08-19 11:47:34 -04:00
Josef Angstenberger
462b6d83e8 file(GENERATE): Test source properties
Output files get the source property `GENERATED` which is indirectly
checked by adding them to a library.
For a missing file that is not generated CMake will abort.

With the new behavior according CMP0070 relative files are generated
into the binary directory.
2020-08-19 09:05:53 -04:00
Josef Angstenberger
1977f7833b file(GENERATE): Update existing tests
Add the additional CMP0070 warning as expected stderr.

The warning occurs twice because the output file name is evaluated
multiple times.
2020-08-19 09:05:53 -04:00
Brad King
31b057182e Merge topic 'FixGraphvizAliasTargets'
f7dd74e4ef Graphviz: Fix bug that shows duplicated alias targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5134
2020-08-18 10:29:06 -04:00
Thomas Bernard
116b06870d ExternalProject: add INACTIVITY_TIMEOUT argument
In order to abort transfers on slow connections the ExternalProject
command support passing the INACTIVITY_TIMEOUT argument.

Fixes: #20992
2020-08-18 09:16:18 -04:00
Stephan Rohmen
f7dd74e4ef Graphviz: Fix bug that shows duplicated alias targets
When using subdirectories the alias targets were duplicated
2020-08-17 21:48:47 +02:00
Brad King
fe3a404a73 Merge topic 'add_test-special-chars-in-name'
a20987732b add_test: Allow special characters in test name (w/ policy CMP0110)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5076
2020-08-17 14:58:49 -04:00
Brad King
386bec2d9d Merge topic 'xcode12-link-matching-zlib'
862dbe1367 Xcode: Link matching zlib for iOS Simulator SDK

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5125
2020-08-17 14:52:51 -04:00
Brad King
3313bf06eb Merge topic 'ios-combined-prune-archs'
5852b8867f CMakeIOSInstallCombined: Enforce disjoint architecture sets
79098d23eb Tests: Avoid warnings about unused arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5111
2020-08-17 14:52:08 -04:00
Gregor Jasny
862dbe1367 Xcode: Link matching zlib for iOS Simulator SDK
The XcodeRemoveExcessiveISystem test runs
`find_package(ZLIB)` which returns an SDK-relative
path to `zlib.tlb`. When the test switches the SDK
for building to something different than the SDK used
for configuration the linker rightfully complains about
the mismatch.

The fix is to configure and build with the same SDK.
2020-08-13 18:05:34 +02:00
Kyle Edwards
2e42651dff Add option to optimize link dependencies for static libraries
Add an `OPTIMIZE_DEPENDENCIES` target property and supporting
`CMAKE_OPTIMIZE_DEPENDENCIES` variable to optionally enable pruning and
flattening of outgoing dependencies from static libraries.  Since they
do not actually link, they only depend on side effects of their
dependencies.  Therefore we can drop dependencies that contribute no
side effects.
2020-08-12 11:31:07 -04:00
Deniz Bahadir
a20987732b add_test: Allow special characters in test name (w/ policy CMP0110)
Restore the change from commit f84af8e270 (add_test: Allow special
characters in test name, 2020-05-16, v3.18.0-rc1~142^2) that had to be
reverted by commit f84af8e270 (add_test: Allow special characters in
test name, 2020-05-16, v3.18.0-rc1~142^2) for compatibility.

Add policy CMP0110 to make the change in a compatible way.
Also, support even more characters than before by generating the
test scripts using bracket arguments around the test names.

Fixes: #19391
Signed-off-by: Deniz Bahadir <dbahadir@benocs.com>
2020-08-12 10:44:07 -04:00
Thomas Bernard
f24e34975a ExternalProject: retry download on recoverable errors
In order to shorten the download failure of ExternalProject download
steps, a download retry is only done when a recoverable network
error is encountered.
2020-08-11 07:25:58 +02:00
Brad King
d6ee9b4a43 Merge topic 'build-interface-targets'
bafa9fe887 fileapi: Add INTERFACE libraries with SOURCES to codemodel-v2
4391913133 Add INTERFACE libraries to generated buildsystem if they have SOURCES
afb998704e Remove filtering of allowed INTERFACE library properties
e7edba2baf Makefiles: Use IsInBuildSystem in global generator target type checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5078
2020-08-10 11:38:59 -04:00
Brad King
e259ea433d Merge topic 'runcmake-make-english'
3d2ab71d42 Tests: Set LC_MESSAGES for RunCMake.Make

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5114
2020-08-10 11:35:34 -04:00
Brad King
0953c0051e Merge topic 'clang-cl-vfs'
20ebaed972 Clang: Add support for passing VFS arguments
d993ebd4ca clang-cl: Add '--' before source file
a94672b919 cmake: Change cmake_llvm_rc separator from -- to ++ to avoid conflict

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5087
2020-08-10 11:33:19 -04:00
Brad King
72409ee089 Merge topic 'test-FindPkgConfig-isolate-env' into release-3.18
8b12982653 Merge branch 'backport-test-FindPkgConfig-isolate-env'
4c939b0d39 Tests: Isolate RunCMake.FindPkgConfig from caller environment
20eeb40aaf Tests: Isolate RunCMake.FindPkgConfig from caller environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5108
2020-08-10 10:45:54 -04:00
Brad King
000b761777 Merge topic 'test-FindPkgConfig-isolate-env'
8b12982653 Merge branch 'backport-test-FindPkgConfig-isolate-env'
4c939b0d39 Tests: Isolate RunCMake.FindPkgConfig from caller environment
20eeb40aaf Tests: Isolate RunCMake.FindPkgConfig from caller environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5108
2020-08-10 10:45:54 -04:00
Kyle Edwards
3d2ab71d42 Tests: Set LC_MESSAGES for RunCMake.Make
LANG was already set, but is not enough on some systems. Set
LC_MESSAGES too.
2020-08-08 12:36:49 -04:00
Gregor Jasny
79098d23eb Tests: Avoid warnings about unused arguments 2020-08-08 14:32:48 +02:00
Thomas Bernard
a94672b919 cmake: Change cmake_llvm_rc separator from -- to ++ to avoid conflict 2020-08-07 11:47:15 -04:00
Brad King
ac44121027 Merge topic 'cuda_memcheck_more_errors'
d7a2cf681b Tests: Add cases for cuda-memcheck error types
562dcec3c4 CTest: Add error types to cuda-memcheck parser

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5101
2020-08-07 11:04:08 -04:00
Brad King
20eeb40aaf Tests: Isolate RunCMake.FindPkgConfig from caller environment
Avoid interference from `CMAKE_PREFIX_PATH` and friends if they
happen to be set in the environment from which the tests are run.
2020-08-07 10:37:28 -04:00
Brad King
bafa9fe887 fileapi: Add INTERFACE libraries with SOURCES to codemodel-v2
INTERFACE libraries with SOURCES now appear in the generated
buildsystem, so include them in the codemodel output too.

We do not need to bump the `codemodel-v2` object kind minor
version because that was already done in post-3.18 development
by commit 7d6861f367 (fileapi: Extend codemodel targets with
language standard, 2020-06-18).

Fixes: #18608
2020-08-07 08:46:34 -04:00
Brad King
4391913133 Add INTERFACE libraries to generated buildsystem if they have SOURCES
INTERFACE libraries were created with the intention of collecting usage
requirements for use by other targets via `target_link_libraries`.
Therefore they were not allowed to have SOURCES and were not included in
the generated buildsystem.  In practice, this has become limiting:

* Header-only libraries do have sources, they just do not compile.
  Developers should be able to edit those sources (the header files)
  in their IDE.

* Header-only libraries may need to generate some of their header
  files via custom commands.

Some projects work around these limitations by pairing each interface
library with an `add_custom_target` that makes the header files and
custom commands appear in the generated buildsystem and in IDEs.

Lift such limitations by allowing INTERFACE libraries to have SOURCES.
For those with sources, add a corresponding build target to the
generated buildsystem.

Fixes: #19145
2020-08-07 08:46:32 -04:00
Brad King
4daf76e10a Merge topic 'compiler_flags'
f76c20da63 Toolchain: Test compiler initial settings
db486da265 Toolchain: Update documentation for initial compiler flags
deec2f587c Toolchain: Take CMAKE_<lang>_FLAGS_INIT into account during compiler detection
ca899af3e2 Toolchain: Handle repeated invocations of CMake with -DCMAKE_C_COMPILER
12ba89e142 Toolchain: Make `/path/comp;-argn' behave the same as 'comp;-argn'
6f1af899db Toolchain: Capture all arguments from CMAKE_<LANG>_COMPILER
ec1d3bc0b6 cmake: avoid exception when printing "changed variables" message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4136
2020-08-06 11:00:12 -04:00
Brad King
030aa9dc30 Merge topic 'automoc_timestamp_deps'
9a9ed4b9d3 Merge branch 'backport-3.17-automoc_timestamp_deps'
7445c9a58a AutoGen: Add test to check for correct AutoMoc dependencies
a79056bb02 AutoGen: Fix over-specified direct dependencies of custom command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Aleix <aleixpol@kde.org>
Merge-request: !5085
2020-08-06 10:31:23 -04:00
Brad King
9a9ed4b9d3 Merge branch 'backport-3.17-automoc_timestamp_deps' 2020-08-05 15:42:39 -04:00
Tobias Ribizel
d7a2cf681b Tests: Add cases for cuda-memcheck error types 2020-08-05 11:28:00 +02:00
Alexandru Croitor
7445c9a58a AutoGen: Add test to check for correct AutoMoc dependencies
When using Qt 5.15.0 or above together with Ninja, check that touching
a source file of a dependency does not needlessly re-run AUTOMOC for
the dependee target.
2020-08-03 19:38:16 +02:00
Fred Baksik
f76c20da63 Toolchain: Test compiler initial settings 2020-08-03 12:34:46 -04:00
Brad King
afb998704e Remove filtering of allowed INTERFACE library properties
Previously we disallowed use of arbitrary properties on INTERFACE
libraries.  The goal was to future-proof projects using them by not
allowing properties to be set that may affect their future inclusion in
the generated buildsystem.  In order to prepare to actually include
INTERFACE libraries in the generated buildsystem, drop the filter and
allow arbitrary properties to be set.

Issue: #19145
2020-08-03 10:04:23 -04:00
Brad King
37e27aa552 Merge topic 'fixup_bundle_item-fix'
45ed314bff BundleUtilities: do not run install_name_tool on scripts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5071
2020-07-29 08:12:25 -04:00
T.J. Corona
45ed314bff BundleUtilities: do not run install_name_tool on scripts
Use the same approach as commit 08be74bfd7 (GetPrerequisites: Fix
handling of executable scripts, 2018-12-16, v3.14.0-rc1~206^2).
2020-07-28 10:35:51 -04:00
Craig Scott
22bfe014d0 Merge topic 'file-download-no-save'
fed7d8f76d file(DOWNLOAD): Make file argument optional

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5060
2020-07-28 10:23:35 -04:00
Brad King
40d3f5a227 Merge topic 'revert-add_test-special-chars'
5fc5f4d26e add_test: Revert "Allow special characters in test name"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5067
2020-07-28 08:24:34 -04:00
Brad King
5fc5f4d26e add_test: Revert "Allow special characters in test name"
Revert commit f84af8e270 (add_test: Allow special characters in test
name, 2020-05-16, v3.18.0-rc1~142^2).  Unfortunately the fix breaks
projects that were working around the limitation with manual escaping.
The fix can be re-introduced with a policy in a future version.

Also add a 3.18.1 release note explaining the change.

Fixes: #21017, #20965
Issue: #19391
2020-07-28 08:04:11 +10:00
Kyle Edwards
fed7d8f76d file(DOWNLOAD): Make file argument optional 2020-07-27 11:26:50 -04:00
Brad King
11cf196fd2 Merge topic 'EXCLUDE_FROM_ALL-genex'
22bd267388 Help: Add release note for EXCLUDE_FROM_ALL genex support
807c8aa9f0 Tests: Simplify RunCMake.ExcludeFromAll single-config case
36743436cf Tests: Fix RunCMake.ExcludeFromAll test program warning
99c131c5a3 cmGlobalGenerator: Fix spelling of EXCLUDE_FROM_ALL in error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5049
2020-07-27 10:40:56 -04:00
Brad King
e3b5abd068 Merge topic 'fix-typos-identified-using-codespell'
207373802e Fix typos identified using codespell

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5040
2020-07-23 08:28:21 -04:00
Brad King
807c8aa9f0 Tests: Simplify RunCMake.ExcludeFromAll single-config case
Also avoid using parts of an unrelated test (NinjaMultiConfig)
that were not designed for use with all generators.
2020-07-23 07:13:36 -04:00
Brad King
36743436cf Tests: Fix RunCMake.ExcludeFromAll test program warning
Add a return value to `main()`.
2020-07-23 07:13:36 -04:00