diff options
author | Brad King <brad.king@kitware.com> | 2024-10-25 13:53:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-10-25 14:23:37 (GMT) |
commit | 39fd396421d7b5012e8fb567710ea1c99d67eeab (patch) | |
tree | 3d27db3bd64ef5ee191c388db27b1b3f5f307ed0 /Tests | |
parent | ebd038613ebe3722afe78a1cd33c8de7d77075df (diff) | |
download | CMake-39fd396421d7b5012e8fb567710ea1c99d67eeab.zip CMake-39fd396421d7b5012e8fb567710ea1c99d67eeab.tar.gz CMake-39fd396421d7b5012e8fb567710ea1c99d67eeab.tar.bz2 |
LINK_LIBRARIES_STRATEGY: Rename strategies to clarify expectations
Since commit 7abd3137b7 (Linking: Optionally reorder direct dependencies
from LINK_LIBRARIES, 2024-09-19, v3.31.0-rc1~53^2) the strategy name
`PRESERVE_ORDER` has led users to expect that it strictly preserves
order. While the part of the link line generation logic controlled by
`LINK_LIBRARIES_STRATEGY` does preserve order, it is not the last step.
Toolchain-specific de-duplication can cause the order to change on the
actual link line generated in the build system.
Rename the strategies:
* `PRESERVE_ORDER` => `REORDER_MINIMALLY`
* `REORDER` => `REORDER_FREELY`
The new names make it clear that reordering is always possible, just to
varying degrees. Update the `LINK_LIBRARIES_STRATEGY` documentation to
clarify that the strategies do not directly control the final link line.
Fixes: #26400
Issue: #26271
Diffstat (limited to 'Tests')
23 files changed, 12 insertions, 12 deletions
diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER.cmake b/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER.cmake deleted file mode 100644 index f3dc096..0000000 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(CMAKE_LINK_LIBRARIES_STRATEGY PRESERVE_ORDER) -include(Basic-common.cmake) diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER.cmake b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER.cmake deleted file mode 100644 index 8e62377..0000000 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(CMAKE_LINK_LIBRARIES_STRATEGY REORDER) -include(Basic-common.cmake) diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER-run-stdout.txt b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY-run-stdout-dedup-reverse.txt index 7e46d1ba..7e46d1ba 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER-run-stdout.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY-run-stdout-dedup-reverse.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER-run-stdout-dedup.txt b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY-run-stdout-dedup.txt index 7e46d1ba..7e46d1ba 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER-run-stdout-dedup.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY-run-stdout-dedup.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER-run-stdout-dedup-reverse.txt b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY-run-stdout.txt index 7e46d1ba..7e46d1ba 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER-run-stdout-dedup-reverse.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY-run-stdout.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER-stderr.txt b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY-stderr-dedup-reverse.txt index b908fbc..b908fbc 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER-stderr.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY-stderr-dedup-reverse.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER-stderr-dedup.txt b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY-stderr-dedup.txt index b908fbc..b908fbc 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER-stderr-dedup.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY-stderr-dedup.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER-stderr-dedup-reverse.txt b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY-stderr.txt index b908fbc..b908fbc 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER-stderr-dedup-reverse.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY-stderr.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY.cmake b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY.cmake new file mode 100644 index 0000000..ea38b5b --- /dev/null +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_FREELY.cmake @@ -0,0 +1,2 @@ +set(CMAKE_LINK_LIBRARIES_STRATEGY REORDER_FREELY) +include(Basic-common.cmake) diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER-run-stdout-dedup-reverse.txt b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY-run-stdout-dedup-reverse.txt index 7e46d1ba..7e46d1ba 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER-run-stdout-dedup-reverse.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY-run-stdout-dedup-reverse.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER-run-stdout.txt b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY-run-stdout-dedup.txt index 6ef12eb..6ef12eb 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER-run-stdout.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY-run-stdout-dedup.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER-run-stdout-dedup.txt b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY-run-stdout.txt index 6ef12eb..6ef12eb 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER-run-stdout-dedup.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY-run-stdout.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER-stderr-dedup-reverse.txt b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY-stderr-dedup-reverse.txt index 7d91bee..7d91bee 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER-stderr-dedup-reverse.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY-stderr-dedup-reverse.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER-stderr-dedup.txt b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY-stderr-dedup.txt index d4bccc4..d4bccc4 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER-stderr-dedup.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY-stderr-dedup.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER-stderr.txt b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY-stderr.txt index 7e9a1cd..7e9a1cd 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Basic-PRESERVE_ORDER-stderr.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY-stderr.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY.cmake b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY.cmake new file mode 100644 index 0000000..12876b1 --- /dev/null +++ b/Tests/RunCMake/LinkLibrariesStrategy/Basic-REORDER_MINIMALLY.cmake @@ -0,0 +1,2 @@ +set(CMAKE_LINK_LIBRARIES_STRATEGY REORDER_MINIMALLY) +include(Basic-common.cmake) diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-PRESERVE_ORDER.cmake b/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-PRESERVE_ORDER.cmake deleted file mode 100644 index 9f694db..0000000 --- a/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-PRESERVE_ORDER.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(CMAKE_LINK_LIBRARIES_STRATEGY PRESERVE_ORDER) -include(Duplicate-common.cmake) diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER.cmake b/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER.cmake deleted file mode 100644 index cc51e0a..0000000 --- a/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(CMAKE_LINK_LIBRARIES_STRATEGY REORDER) -include(Duplicate-common.cmake) diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER-stderr.txt b/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER_FREELY-stderr.txt index 2353288..2353288 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER-stderr.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER_FREELY-stderr.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER_FREELY.cmake b/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER_FREELY.cmake new file mode 100644 index 0000000..c205fad --- /dev/null +++ b/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER_FREELY.cmake @@ -0,0 +1,2 @@ +set(CMAKE_LINK_LIBRARIES_STRATEGY REORDER_FREELY) +include(Duplicate-common.cmake) diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-PRESERVE_ORDER-stderr.txt b/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER_MINIMALLY-stderr.txt index 2637f93..2637f93 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-PRESERVE_ORDER-stderr.txt +++ b/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER_MINIMALLY-stderr.txt diff --git a/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER_MINIMALLY.cmake b/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER_MINIMALLY.cmake new file mode 100644 index 0000000..6d4545b --- /dev/null +++ b/Tests/RunCMake/LinkLibrariesStrategy/Duplicate-REORDER_MINIMALLY.cmake @@ -0,0 +1,2 @@ +set(CMAKE_LINK_LIBRARIES_STRATEGY REORDER_MINIMALLY) +include(Duplicate-common.cmake) diff --git a/Tests/RunCMake/LinkLibrariesStrategy/RunCMakeTest.cmake b/Tests/RunCMake/LinkLibrariesStrategy/RunCMakeTest.cmake index eb107ed..787b636 100644 --- a/Tests/RunCMake/LinkLibrariesStrategy/RunCMakeTest.cmake +++ b/Tests/RunCMake/LinkLibrariesStrategy/RunCMakeTest.cmake @@ -44,8 +44,8 @@ function(run_strategy case exe) endforeach() endfunction() -run_strategy(Basic-PRESERVE_ORDER "main") -run_strategy(Basic-REORDER "main") +run_strategy(Basic-REORDER_MINIMALLY "main") +run_strategy(Basic-REORDER_FREELY "main") -run_cmake(Duplicate-PRESERVE_ORDER) -run_cmake(Duplicate-REORDER) +run_cmake(Duplicate-REORDER_MINIMALLY) +run_cmake(Duplicate-REORDER_FREELY) |