summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'refactor-conditions-evaluation'Brad King2021-08-068-474/+573
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 54a70b3988 Refactor: Move version compare op table out of the function f37d6a3170 Refactor: Remove redundant checks for `0` and `1` literals 00961a4782 Refactor: Copy exactly required count of args and avoid `pop_back()` 2a72cad9be Style: Better names of local vars for `IN_LIST` handler 0dd7795706 Refactor: Extract the logic of testing for special variable to func 866b0595f6 Refactor: Introduce `cmArgumentList` container class 51d9194a96 Refactor: Reduce one more condition checking on handling math compare 46810235e3 Refactor: Avoid `if` → `else if` → … for compare operators ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6392
| * Refactor: Move version compare op table out of the functionAlex Turbov2021-08-031-7/+7
| | | | | | | | It's static data and never changed.
| * Refactor: Remove redundant checks for `0` and `1` literalsAlex Turbov2021-08-031-9/+1
| | | | | | | | They are gonna be checked by `cmIsOn()` anyway.
| * Refactor: Copy exactly required count of args and avoid `pop_back()`Alex Turbov2021-08-031-6/+7
| |
| * Style: Better names of local vars for `IN_LIST` handlerAlex Turbov2021-08-031-4/+6
| |
| * Refactor: Extract the logic of testing for special variable to funcAlex Turbov2021-08-031-14/+27
| | | | | | | | Introduce `looksLikeSpecialVariable`. It makes `if()` blocks readable.
| * Refactor: Introduce `cmArgumentList` container classAlex Turbov2021-08-038-154/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `cmArgumentList` has been turned into a class (forward declared in the header). It inherits from the `std::list` (yeah, but we don't intend to store polymorphic classes in it). In addition to the standard methods, now it's possible to move `HandlePredicate` (renamed to `ReduceOneArg`) and `HandleBinaryOp` (renamed to `ReduceTwoArgs`) as its members. Additionally, iterators managements (`IncrementArguments`) have been refactored into two separate classes mimicking iterators. This also allows having a uniform `for` loop and concentrates the logic of iterators advancing in it instead of the loop's body. The arguments processing algorithms operate with "windows" over a collection of arguments. Hence there are two kinds of "iteration windows" -- allowing to observe 2 or 3 elements per loop iteration. These iteration "windows" also passed to reducers.
| * Refactor: Reduce one more condition checking on handling math compareAlex Turbov2021-08-031-12/+13
| |
| * Refactor: Avoid `if` → `else if` → … for compare operatorsAlex Turbov2021-08-032-62/+104
| | | | | | | | | | | | When trying to match one of compare operator key inside `if()` condition, remember the index of matched operator. Later this index used to select the operation to perform instead of strings compare again.
| * Refactor: Set `const` to `cmConditionEvaluator::IsKeyword` parametersAlex Turbov2021-08-032-3/+4
| |
| * Refactor: No need to move iterators after matchAlex Turbov2021-08-031-40/+28
| | | | | | | | | | | | | | | | | | | | A handler's loop of all levels gonna restart after calls to `HandlePredcate` or `HandleBinaryOp`... And the first action in the loop is to setup iterators. So, no need to move 'em inside the functions. Also, no need to pass iterators by reference. Also, reorder parameters of both functions so iterators followed after a reference to the newArgs container.
| * Refactor: Replace `std::to_string` w/ more specialized `bool2string`Alex Turbov2021-08-031-5/+9
| |
| * Refactor: Reorder `MATCHES` handler from top below to the fail-fastAlex Turbov2021-08-031-18/+18
| |
| * Refactor: Reduce variables scope in `HandleLevel2`Alex Turbov2021-08-031-14/+12
| |
| * Refactor: Simplify boolean to string result assignmentsAlex Turbov2021-08-031-5/+4
| |
| * Refactor: Replace `if` block w/ boolean expressionAlex Turbov2021-08-031-6/+2
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Avoid redundant `operator<<` on printing messagesAlex Turbov2021-08-031-9/+15
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Opt-out do+while loops and reduce nesting level in handlersAlex Turbov2021-08-031-309/+287
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Remove `reducible` flag from `handleLevelN()` functionsAlex Turbov2021-08-031-45/+45
| | | | | | | | | | | | | | 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>
| * Refactor: Make `cmConditionEvaluator::IsTrue` a bit more compactAlex Turbov2021-08-031-19/+13
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Generalize policy checking in `HandleLevel1`Alex Turbov2021-07-261-18/+25
| | | | | | | | Also, move OLD policy checking out of the loop to evaluate it once.
| * Refactor: When handle predicates, there is no need to check 2nd argAlex Turbov2021-07-261-30/+34
| | | | | | | | | | Introduce an overload for `IncrementArguments()` w/ one iterator and use it in the handler level 1.
| * Refactor: Initialize args vector from iterators instead of copyAlex Turbov2021-07-261-4/+2
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Speedup predicates and binary operationAlex Turbov2021-07-262-50/+61
| | | | | | | | | | | | | | | | | | | | 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.
| * Style: Add empty lines to increase readabilityAlex Turbov2021-07-261-0/+20
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Deduplicate code for `AND` and `OR` handling in `if()` commandAlex Turbov2021-07-261-16/+9
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Rewrite parenthesis scanner to avoid `if`sAlex Turbov2021-07-261-12/+5
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Make `HandleBinaryOp` and `HandlePredicate` free functionsAlex Turbov2021-07-262-70/+52
| |
| * Refactor: More `auto` and constnessAlex Turbov2021-07-261-33/+27
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Make `IncrementArguments()` the free functionAlex Turbov2021-07-262-25/+22
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Turn the innter `while` loop in `HandleLevelN()` into `for`Alex Turbov2021-07-261-30/+10
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Turn `reducible` flag into booleanAlex Turbov2021-07-262-18/+18
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Use `cm::string_view` for static const literalsAlex Turbov2021-07-262-47/+50
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Opt-out `if` stataments to select 1st paramAlex Turbov2021-07-261-18/+10
| | | | | | | | | | | | ... for some calls to `cmExpandedCommandArgument`. Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Add constnessAlex Turbov2021-07-261-10/+10
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
| * Refactor: Use anonymous namespace instead of `static` keyword for constsAlex Turbov2021-07-261-32/+34
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
* | Merge branch 'release-3.21'Brad King2021-08-060-0/+0
|\ \
| * \ Merge topic 'ninja-lwyu-ar' into release-3.21Brad King2021-08-065-1/+14
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | 93eb4a7bd1 Ninja: Revert accidental LINK_WHAT_YOU_USE impl for static libraries Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6418
* | \ \ Merge topic 'ninja-lwyu-ar'Brad King2021-08-064-0/+10
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 87589fd96a Merge branch 'backport-ninja-lwyu-ar' into ninja-lwyu-ar 93eb4a7bd1 Ninja: Revert accidental LINK_WHAT_YOU_USE impl for static libraries Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6418
| * \ \ \ Merge branch 'backport-ninja-lwyu-ar' into ninja-lwyu-arBrad King2021-08-034-0/+10
| |\ \ \ \ | | | |/ / | | |/| |
| | * | | Ninja: Revert accidental LINK_WHAT_YOU_USE impl for static librariesĐoàn Trần Công Danh2021-08-035-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit d7159f9591, (Ninja: Fix LINK_WHAT_YOU_USE link flag placement, 2021-06-24), we fixed usage of -Wl,--no-as-needed to override -Wl,--as-needed from LDFLAGS. However, that change also passes -Wl,--no-as-needed to `ar`, which is incorrect flag for `ar`. Let's check the target type before passing down the flags. Fixes: #22487
* | | | | Merge branch 'release-3.21'Brad King2021-08-060-0/+0
|\ \ \ \ \ | | |_|/ / | |/| | |
| * | | | Merge branch 'release-3.20' into release-3.21Brad King2021-08-060-0/+0
| |\ \ \ \
* | \ \ \ \ Merge branch 'release-3.20'Brad King2021-08-060-0/+0
|\ \ \ \ \ \ | | |/ / / / | |/| | | |
| * | | | | Merge branch 'macos-10.4' into release-3.20Brad King2021-08-021-1/+3
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Merge-request: !6426
* | \ \ \ \ \ Merge branch 'release-3.21'Brad King2021-08-060-0/+0
|\ \ \ \ \ \ \ | | |_|/ / / / | |/| | | | |
| * | | | | | Merge topic 'macos-10.4' into release-3.21Brad King2021-08-061-1/+3
| |\ \ \ \ \ \ | | | |/ / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1af23c4de2 macOS: Restore support for Mac OS X 10.4 (Tiger) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6426
* | | | | | | Merge topic 'macos-10.4'Brad King2021-08-061-1/+3
|\ \ \ \ \ \ \ | | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1af23c4de2 macOS: Restore support for Mac OS X 10.4 (Tiger) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6426
| * | | | | | macOS: Restore support for Mac OS X 10.4 (Tiger)Evan Miller2021-08-021-1/+3
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 4aed96e230 (Apple: Set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG on non-macOS too, 2021-04-06, v3.20.1~5^2) we always enable support for linking with `-rpath`. The intention of the change was to enable using the flag on iOS, tvOS and watchOS by avoiding a Darwin-specific version check. However, removing the check broke support for OS X 10.4 because the flag is not supported on that version. Restore a form of the check that disables the flag on OS X < 10.5 while still allowing it for the other Apple platforms. Since no one is doing iOS/tvOS/etc development on 10.4, this change should have no unintended side effects. Fixes: #22490
* | | | | | CMake Nightly Date StampKitware Robot2021-08-061-1/+1
| | | | | |