Commit Graph

54137 Commits

Author SHA1 Message Date
Alex Turbov 97d6bbcc01 Refactor: Replace std::to_string w/ more specialized bool2string 2021-08-03 10:55:46 -04:00
Alex Turbov 9721ab416f Refactor: Reorder MATCHES handler from top below to the fail-fast 2021-08-03 10:55:46 -04:00
Alex Turbov d4d44e86f6 Refactor: Reduce variables scope in HandleLevel2 2021-08-03 10:55:46 -04:00
Alex Turbov cc6cdacc18 Refactor: Simplify boolean to string result assignments 2021-08-03 10:55:46 -04:00
Alex Turbov e3c1dbe18b Refactor: Replace if block w/ boolean expression
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-08-03 10:55:45 -04:00
Alex Turbov 047f8321a0 Refactor: Avoid redundant operator<< on printing messages
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-08-03 10:55:45 -04:00
Alex Turbov 4de2a4a46d Refactor: Opt-out do+while loops and reduce nesting level in handlers
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-08-03 10:55:45 -04:00
Alex Turbov 78fcbb20cd Refactor: Remove reducible flag from handleLevelN() functions
The indicator that smth has been done is the `newArgs` size get
differ after an iteration.

Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-08-03 10:55:45 -04:00
Alex Turbov b0d6596399 Refactor: Make cmConditionEvaluator::IsTrue a bit more compact
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-08-03 10:55:30 -04:00
Alex Turbov 18bd6c98ea Refactor: Generalize policy checking in HandleLevel1
Also, move OLD policy checking out of the loop to evaluate it once.
2021-07-26 23:40:18 +03:00
Alex Turbov 8bc4a740d6 Refactor: When handle predicates, there is no need to check 2nd arg
Introduce an overload for `IncrementArguments()` w/ one iterator
and use it in the handler level 1.
2021-07-26 23:40:18 +03:00
Alex Turbov 9946ff6848 Refactor: Initialize args vector from iterators instead of copy
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-07-26 23:40:18 +03:00
Alex Turbov bf2fe90372 Refactor: Speedup predicates and binary operation
Before predicates and binary ops reducers use series of `if ()` blocks
to match the keywords. However, if matched the currect `arg` get replaced
with evaluation result, so further `if (<match-another-keyword>)`
is just wasting time/resources.

This patch introduce a chain of `if` → `else if` → ..., so after
first match the loop restarts w/ the next argument.
2021-07-26 23:40:18 +03:00
Alex Turbov 7bec39dc10 Style: Add empty lines to increase readability
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-07-26 23:40:18 +03:00
Alex Turbov 314538703a Refactor: Deduplicate code for AND and OR handling in if() command
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-07-26 23:40:18 +03:00
Alex Turbov 95fc27cedd Refactor: Rewrite parenthesis scanner to avoid ifs
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-07-26 23:40:18 +03:00
Alex Turbov 135c37bdd7 Refactor: Make HandleBinaryOp and HandlePredicate free functions 2021-07-26 23:40:18 +03:00
Alex Turbov 498c8c7773 Refactor: More auto and constness
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-07-26 23:40:18 +03:00
Alex Turbov 961df6cde6 Refactor: Make IncrementArguments() the free function
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-07-26 23:40:18 +03:00
Alex Turbov 0f65d0cd83 Refactor: Turn the innter while loop in HandleLevelN() into for
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-07-26 23:40:18 +03:00
Alex Turbov 24cbfb8d96 Refactor: Turn reducible flag into boolean
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-07-26 23:40:18 +03:00
Alex Turbov c26f15c66d Refactor: Use cm::string_view for static const literals
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-07-26 23:40:14 +03:00
Alex Turbov fab3890025 Refactor: Opt-out if stataments to select 1st param
... for some calls to `cmExpandedCommandArgument`.

Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-07-26 21:20:27 +03:00
Alex Turbov 4b4e603075 Refactor: Add constness
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-07-26 21:20:18 +03:00
Alex Turbov bebb3a1f5a Refactor: Use anonymous namespace instead of static keyword for consts
Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2021-07-26 21:20:05 +03:00
Brad King 0d987bbd88 Merge topic 'refactor-target-export'
e8e19ed8f2 Refactor export file generator inteface
55e4753bbb Refactor cmTargetExport removing InterfaceIncludeDirecories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6370
2021-07-26 09:44:15 -04:00
Brad King 60eecc1fa2 Merge topic 'support_other_cuda_libdevice_locations'
125bbf07b1 CUDA: Extract nvvm libdevice location from compiler verbose output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !6365
2021-07-26 09:41:29 -04:00
Brad King cac4d5d923 Merge branch 'release-3.21' 2021-07-26 09:39:55 -04:00
Brad King 2cc59a80b8 Merge topic 'doc-custom-command-depfiles'
f6e5743d0e Help: Clarify and correct wording around DEPFILE option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6387
2021-07-26 09:39:55 -04:00
Brad King 0079f24f45 Merge topic 'doc-custom-command-depfiles' into release-3.21
f6e5743d0e Help: Clarify and correct wording around DEPFILE option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6387
2021-07-26 09:39:55 -04:00
Brad King b9ee85cc29 Merge branch 'release-3.21' 2021-07-26 09:36:49 -04:00
Brad King 00a3889c19 Merge topic 'ninja-multi-test-fix' into release-3.21
08131e83bc Tests: Clean up Ninja Multi-Config test from cb777dd

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6383
2021-07-26 09:36:49 -04:00
Brad King f68bff274b Merge topic 'ninja-multi-test-fix'
08131e83bc Tests: Clean up Ninja Multi-Config test from cb777dd

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6383
2021-07-26 09:36:49 -04:00
Brad King 2b7cd57796 Merge branch 'release-3.21' 2021-07-26 09:34:52 -04:00
Brad King 00cbc4cff7 Merge topic 'autouic-header-depends'
e5ec0e52f4 AUTOUIC: Fix generating of dependency rules for UI header files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6380
2021-07-26 09:34:52 -04:00
Brad King 98d813b92c Merge topic 'autouic-header-depends' into release-3.21
e5ec0e52f4 AUTOUIC: Fix generating of dependency rules for UI header files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6380
2021-07-26 09:34:51 -04:00
Brad King d31f0f5682 Merge branch 'release-3.21' 2021-07-26 09:33:57 -04:00
Brad King 6a93b5a2ec Merge topic 'autogen-deps'
4bda03370d AutoGen: Fix needless compilation of mocs_compilation.cpp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6381
2021-07-26 09:33:57 -04:00
Brad King 2f7c4a788c Merge topic 'autogen-deps' into release-3.21
4bda03370d AutoGen: Fix needless compilation of mocs_compilation.cpp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6381
2021-07-26 09:33:56 -04:00
Craig Scott 0743bfb85c Merge branch 'release-3.21' 2021-07-26 07:48:02 -04:00
Craig Scott 9d9d527513 Merge topic 'doc-ctest-output' into release-3.21
ba6d1947b6 Help: Add cross-references between test output size ctest variables
cdde9e5a10 Help: Improve wording and cross-referencing for ctest JUnit output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6389
2021-07-26 07:48:02 -04:00
Craig Scott 18259fa689 Merge topic 'doc-ctest-output'
ba6d1947b6 Help: Add cross-references between test output size ctest variables
cdde9e5a10 Help: Improve wording and cross-referencing for ctest JUnit output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6389
2021-07-26 07:48:02 -04:00
Craig Scott ba6d1947b6 Help: Add cross-references between test output size ctest variables 2021-07-26 21:08:45 +10:00
Kitware Robot ffbd3bb42f CMake Nightly Date Stamp 2021-07-26 00:01:14 -04:00
Craig Scott cdde9e5a10 Help: Improve wording and cross-referencing for ctest JUnit output 2021-07-25 21:37:29 +10:00
Kitware Robot a87c54aba3 CMake Nightly Date Stamp 2021-07-25 00:01:08 -04:00
Craig Scott f6e5743d0e Help: Clarify and correct wording around DEPFILE option
The previous wording contradicted itself regarding whether
Visual Studio generators were supported, and about when
generator expressions could be used. Restructure the paragraphs
and max it clearer what support was added in which CMake
versions.
2021-07-24 15:08:21 +10:00
Kitware Robot acb068b0f0 CMake Nightly Date Stamp 2021-07-24 00:01:12 -04:00
Kyle Edwards 08131e83bc Tests: Clean up Ninja Multi-Config test from cb777dd 2021-07-23 13:22:59 -04:00
Joerg Bornemann 4bda03370d AutoGen: Fix needless compilation of mocs_compilation.cpp
For an AUTOMOC'ed target foo, when depfiles are used, there are the
following dependencies:

foo_autogen -> foo_autogen/timestamp
foo_autogen/mocs_compilation.cpp -> foo_autogen/timestamp

The first is used to trigger AUTOGEN.
The second erroneously triggers a recompilation of
mocs_compilation.cpp when any source file of target foo is touched.

Remove the latter dependency and replace it with an order-only
dependency from foo_autogen/mocs_compilation.cpp to
foo_autogen_timestamp_deps.

That is achieved by making mocs_compilation.cpp or its
per-configuration variants byproduct(s) of the timestamp file.

Fixes: #22338
2021-07-23 15:47:28 +02:00