Commit Graph

33280 Commits

Author SHA1 Message Date
Brad King
4391808712 Merge topic 'file-COPY_FILE-retry'
d34986036f ExternalData: Improve robustness on Windows to copy a data object to a file
efa9eec040 file(COPY_FILE): Add option to retry on Windows if input access fails
fa518188d8 cmSystemTools: Remove unused CopySingleFile overload

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7934
2022-11-18 09:40:13 -05:00
Brad King
0784261a68 Merge topic 'clang-tidy-module-pragma-once-check'
91a7c0b51c CMake: fix violations of #pragma once check
aa0c99c55c clang-tidy module: add test for #pragma once check
c9af6f2ff6 clang-tidy module: add #pragma once check
68a4d97da7 clang-tidy module: allow header files in test cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !7933
2022-11-18 09:35:21 -05:00
Brad King
1cefd1da95 Merge topic 'ninja-swiftmodule-no-exe'
38c8807c5a Ninja: Avoid re-linking a Swift executable on every build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7901
2022-11-18 09:34:35 -05:00
Brad King
7be4574790 Merge topic 'refactor-cmDocumentation'
6e3e8827fa Refactor: `cmGlobalGeneratorFactory::GetDocumentation` returns entry
e99a4acbcd cmGlobalGeneratorFactory.h: Simplify returning default values
7daadd304f cmake.cxx: Simplify `cmake::AppendExtraGeneratorsDocumentation()`
df2047c2ac cpack.cxx: Optimize calls to `std::osteam::operator<<`
f6180485bb cpack.cxx: Eliminate redundant `if`
d7c183f35c cpack.cxx: Deduplicate "Generators" section creation code
9c06f0dd71 cmake.cxx: Move `static` functions to an anonymous namespace
69918b07e1 cmDocumentationEntry: Drop all user provided ctors for C++ >= 14
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7605
2022-11-18 09:28:46 -05:00
Brad King
e558beeef6 Merge topic 'build-local-interface-genex'
38cbf5e15b Genex: Add $<BUILD_LOCAL_INTERFACE:...> genex
37b5c78688 cmGeneratorExpression: Refactor stripExportInterface() to use enum class

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7919
2022-11-18 09:27:35 -05:00
Brad King
1cc936f314 Merge topic 'genex-TARGET_PROPERTY-scope'
8437141b53 Genex: Fix TARGET_PROPERTY lookup scope in transitive usage requirements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !7928
2022-11-18 09:25:43 -05:00
Kitware Robot
ee7479fb5a CMake Nightly Date Stamp 2022-11-18 00:01:09 -05:00
Brad King
efa9eec040 file(COPY_FILE): Add option to retry on Windows if input access fails
On Windows, a file may be inaccessible for a short time after it is
created.  This occurs for various reasons, including indexing, antivirus
tools, and NTFS's asynchronous semantics.  Add an `INPUT_MAY_BE_RECENT`
option to tell CMake that the input file may have been recently created
so that we can retry a few times to read it.
2022-11-17 15:05:07 -05:00
Kyle Edwards
91a7c0b51c CMake: fix violations of #pragma once check 2022-11-17 13:55:52 -05:00
Brad King
fa518188d8 cmSystemTools: Remove unused CopySingleFile overload 2022-11-17 13:27:19 -05:00
Evan Wilde
38c8807c5a Ninja: Avoid re-linking a Swift executable on every build
Swift doesn't emit swiftmodules for executables, so we shouldn't put it
in dependency graph.  Ninja sees the "missing" dependency and always
tries to rebuild/re-link the target.
2022-11-17 13:05:22 -05:00
Kyle Edwards
38cbf5e15b Genex: Add $<BUILD_LOCAL_INTERFACE:...> genex
Fixes: #23209
2022-11-17 09:31:27 -05:00
Kyle Edwards
37b5c78688 cmGeneratorExpression: Refactor stripExportInterface() to use enum class 2022-11-17 09:31:27 -05:00
Brad King
c5a945dce8 Merge topic 'vs-build-parallel'
48db261e69 cmake --build: Use both inter- and intra-project parallelism with msbuild

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7926
2022-11-17 08:15:54 -05:00
Brad King
14cf3b1039 Merge topic 'file-archive-zstd-compression-level'
ed519b1cba file(ARCHIVE_CREATE): Allow higher compression level for Zstd

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7924
2022-11-17 08:15:04 -05:00
Brad King
8437141b53 Genex: Fix TARGET_PROPERTY lookup scope in transitive usage requirements
When `$<TARGET_PROPERTY:tgt,prop>` is used in an `INTERFACE_*` target
property for usage requirements, it may be evaluated in the context of a
dependent target in another directory.  Look up the `tgt` name in the
directory of the target whose property holds the expression so that
imported targets isolated to that directory are visible.

Fixes: #24163
2022-11-17 07:57:21 -05:00
Alex Turbov
6e3e8827fa Refactor: cmGlobalGeneratorFactory::GetDocumentation returns entry
Before, a documentation entry was in/out parameter.
Now it's a normal return value.

This also makes possible to eliminate defaulted default ctor
for `cmDocumentationEntry` for C++ 11.

Also, simplify `cmake::AppendGlobalGeneratorsDocumentation()`.
2022-11-17 16:37:13 +04:00
Alex Turbov
e99a4acbcd cmGlobalGeneratorFactory.h: Simplify returning default values 2022-11-17 16:37:13 +04:00
Alex Turbov
7daadd304f cmake.cxx: Simplify cmake::AppendExtraGeneratorsDocumentation() 2022-11-17 16:37:13 +04:00
Alex Turbov
df2047c2ac cpack.cxx: Optimize calls to std::osteam::operator<< 2022-11-17 16:37:13 +04:00
Alex Turbov
f6180485bb cpack.cxx: Eliminate redundant if 2022-11-17 16:37:12 +04:00
Alex Turbov
d7c183f35c cpack.cxx: Deduplicate "Generators" section creation code 2022-11-17 16:37:12 +04:00
Alex Turbov
9c06f0dd71 cmake.cxx: Move static functions to an anonymous namespace 2022-11-17 16:37:12 +04:00
Alex Turbov
69918b07e1 cmDocumentationEntry: Drop all user provided ctors for C++ >= 14
There is no need for them cuz:

- the last field has a default value
- all static instances use 2 arguments convertible to `std::string`
- "dynamic" instances used for _Generator_ doc entries access
  fields diectly using default constructed instance

Moreover, compiler may generate move ctor/assign when needed.
2022-11-17 16:37:12 +04:00
Alex Turbov
439d2cf9cb cmake.cxx: Optimize calls to std::osteam::operator<< 2022-11-17 16:37:12 +04:00
Alex Turbov
e06bd68b36 cmDocumentationFormatter: Hide internal methods into private section 2022-11-17 16:37:12 +04:00
Alex Turbov
5ef97a0182 cmDocumentation: Drop unused SetSections method 2022-11-17 16:37:11 +04:00
Alex Turbov
74b735dea8 cmDocumentation: char*[][2]cmDocumentationEntry[N]
Use fixed size arrays of `cmDocumentationEntry` items instead of
open arrays of two `char` pointers when describe program options
help screens.

Also, drop `const char*[][2]` overloads of methods of
`cmDocumentation` and `cmDocumentationSection` classes in the sake
of generic (template) appenders introduced earlier.
2022-11-17 16:37:11 +04:00
Alex Turbov
807aa8e353 CMakeSetup.cxx: Use anonymous namespace instead of static 2022-11-17 16:37:11 +04:00
Alex Turbov
96dcfa6b44 ccmake.cxx: Use anonymous namespace instead of static 2022-11-17 16:37:11 +04:00
Alex Turbov
8e2a03c078 ctest.cxx: Eliminate redundand trenary operator 2022-11-17 16:37:11 +04:00
Alex Turbov
9ae6569bfe ctest.cxx: Optimize std::ostream::operator<< calls 2022-11-17 16:37:10 +04:00
Alex Turbov
fddc48dd26 ctest.cxx: Use anonymous namespace instead of static arrays 2022-11-17 16:37:10 +04:00
Alex Turbov
95a3d91e5c cmakemain.cxx: Remove always true preprocessor #if block 2022-11-17 16:37:10 +04:00
Alex Turbov
ccff0b87a2 cmDocumentation: Accept Iterable instead of vector on add entries 2022-11-17 16:37:10 +04:00
Alex Turbov
067dcb9efd cmDocumentationSection: Accept Iterable instead of vector on add 2022-11-17 16:37:10 +04:00
Alex Turbov
09fdfe5afa cmDocumentationFormatter: Improve PrintFormatted
Instead of one char at time copy (append), use lines.
2022-11-17 16:37:10 +04:00
Alex Turbov
3feac60591 cmDocumentationFormatter: All printing methods accept strings 2022-11-17 16:37:09 +04:00
Alex Turbov
21c3e2107d cmDocumentationFormatter: Turn while () into for () loop 2022-11-17 16:37:09 +04:00
Alex Turbov
c802bfc548 cmDocumentationFormatter: Eliminate one if in the PrintColumn loop 2022-11-17 16:37:09 +04:00
Alex Turbov
f27537ec3d cmDocumentationFormatter: Turn TextWidth member into size_t
Cuz normally required text width can't be negative. It was `int`…
2022-11-17 16:37:09 +04:00
Alex Turbov
84241189f6 cmDocumentationFormatter: Prevent indentation reset side effect
Fix `cmDocumentationFormatter::PrintColumn()` method to eliminate
an indentation reset side effect.
2022-11-17 16:37:09 +04:00
Alex Turbov
bbe854a45a cmDocumentation: Drop useless call to formatter's SetIndent()
The `cmDocumentationFormatter::PrintSection()` method ignores
the currently set indentation level and use it's own.
2022-11-17 16:37:09 +04:00
Alex Turbov
cf39773df9 cmDocumentationFormatter: Turn TextIndent member into size_t
… instead of `std::string`.
2022-11-17 16:37:07 +04:00
Alex Turbov
1d6c8797fc cmDocumentationFormatter: Use std::ostream padding capabitily
… instead of manually print spaces to align fields.
2022-11-17 16:35:01 +04:00
Alex Turbov
5f3f811836 cmDocumentationFormatter: TextIndent member is std::string now
Was `const char*`.
2022-11-17 16:23:36 +04:00
Alex Turbov
b0fe4036b7 cmDocumentationFormatter: PrintPreformatted accept string
Also, make it `const` method cuz it's not modify the state.
2022-11-17 16:23:35 +04:00
Alex Turbov
3be0d77cc4 cmDocumentationFormatter.h: No need virtual methods
Can be added later it really need.
Also, drop ctor/dtor to make the class trivially destructable.
2022-11-17 16:23:35 +04:00
Alex Turbov
3bff44ffd3 cmDocumentationEntry.h: Drop unused constructor 2022-11-17 16:23:35 +04:00
Alex Turbov
f074e2bd49 cmDocumentation: Optimize std::ostream::operator<<() calls 2022-11-17 16:23:35 +04:00