summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2024-06-16 13:37:37 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2024-06-21 09:18:12 (GMT)
commit5617c34c3135f7ec203d5a48b803eb323f458bc3 (patch)
treec924f13607ec0db9ba89cf7ccd9f97b60b2278b7
parentc3821911f8a7f6017cbbd4fddc560d0ec6586185 (diff)
downloadCMake-5617c34c3135f7ec203d5a48b803eb323f458bc3.zip
CMake-5617c34c3135f7ec203d5a48b803eb323f458bc3.tar.gz
CMake-5617c34c3135f7ec203d5a48b803eb323f458bc3.tar.bz2
Libraries processing: update configuration wording
-rw-r--r--Modules/Platform/AIX-GNU.cmake2
-rw-r--r--Modules/Platform/AIX-XL.cmake2
-rw-r--r--Modules/Platform/Apple-Clang.cmake2
-rw-r--r--Modules/Platform/Windows-Clang.cmake2
-rw-r--r--Modules/Platform/Windows-MSVC.cmake2
-rw-r--r--Source/cmComputeLinkDepends.cxx23
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1.cmake2
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2.cmake2
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3.cmake2
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-stderr.txt2
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4.cmake2
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_DEDUPLICATION-result.txt (renamed from Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-result.txt)0
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_DEDUPLICATION-stderr.txt (renamed from Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-stderr.txt)4
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_DEDUPLICATION.cmake (renamed from Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY.cmake)2
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER.cmake2
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/RunCMakeTest.cmake2
16 files changed, 28 insertions, 25 deletions
diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake
index 55a6680..f6616fb 100644
--- a/Modules/Platform/AIX-GNU.cmake
+++ b/Modules/Platform/AIX-GNU.cmake
@@ -17,7 +17,7 @@ macro(__aix_compiler_gnu lang)
set(CMAKE_${lang}_VERBOSE_LINK_FLAG "-Wl,-v")
set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath")
- set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE UNICITY=ALL)
+ set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL)
if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 7 OR CMAKE_SYSTEM_VERSION VERSION_LESS 7.1)
unset(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY)
diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake
index c225de9..cd202cb 100644
--- a/Modules/Platform/AIX-XL.cmake
+++ b/Modules/Platform/AIX-XL.cmake
@@ -17,7 +17,7 @@ macro(__aix_compiler_xl lang)
set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ")
set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath")
- set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE UNICITY=ALL)
+ set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL)
set(_OBJECTS " <OBJECTS>")
if(DEFINED CMAKE_XL_CreateExportList AND CMAKE_XL_CreateExportList STREQUAL "")
diff --git a/Modules/Platform/Apple-Clang.cmake b/Modules/Platform/Apple-Clang.cmake
index 31f4293..e0b6cd6 100644
--- a/Modules/Platform/Apple-Clang.cmake
+++ b/Modules/Platform/Apple-Clang.cmake
@@ -15,7 +15,7 @@ macro(__apple_compiler_clang lang)
set(CMAKE_${lang}_SYSTEM_FRAMEWORK_SEARCH_FLAG "-iframework ")
endif()
- set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE UNICITY=ALL)
+ set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL)
set(CMAKE_${lang}_LINK_LIBRARY_USING_FRAMEWORK "-framework <LIBRARY>")
set(CMAKE_${lang}_LINK_LIBRARY_USING_FRAMEWORK_SUPPORTED TRUE)
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index 35055bc..8c9b79c 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -55,7 +55,7 @@ macro(__windows_compiler_clang_gnu lang)
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "")
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
- set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=FORWARD UNICITY=ALL)
+ set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=FORWARD DEDUPLICATION=ALL)
# linker selection
set(CMAKE_${lang}_USING_LINKER_DEFAULT "-fuse-ld=lld-link")
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index c737b88..3a400e5 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -514,7 +514,7 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_${lang}_DEPFILE_FORMAT msvc)
endif()
- set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=FORWARD UNICITY=ALL)
+ set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=FORWARD DEDUPLICATION=ALL)
# linker selection
set(CMAKE_${lang}_USING_LINKER_SYSTEM "${CMAKE_LINKER_LINK}")
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index cc323f4..2f24ad7 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -376,8 +376,10 @@ public:
case cmPolicies::NEW: {
if (auto libProcessing = makefile->GetDefinition(cmStrCat(
"CMAKE_", linkLanguage, "_LINK_LIBRARIES_PROCESSING"))) {
+ // UNICITY keyword is just for compatibility with previous
+ // implementation
cmsys::RegularExpression processingOption{
- "^(ORDER|UNICITY)=(FORWARD|REVERSE|ALL|NONE|SHARED)$"
+ "^(ORDER|UNICITY|DEDUPLICATION)=(FORWARD|REVERSE|ALL|NONE|SHARED)$"
};
std::string errorMessage;
for (auto const& option : cmList{ libProcessing }) {
@@ -390,13 +392,14 @@ public:
} else {
errorMessage += cmStrCat(" ", option, '\n');
}
- } else if (processingOption.match(1) == "UNICITY") {
+ } else if (processingOption.match(1) == "UNICITY" ||
+ processingOption.match(1) == "DEDUPLICATION") {
if (processingOption.match(2) == "ALL") {
- this->Unicity = All;
+ this->Deduplication = All;
} else if (processingOption.match(2) == "NONE") {
- this->Unicity = None;
+ this->Deduplication = None;
} else if (processingOption.match(2) == "SHARED") {
- this->Unicity = Shared;
+ this->Deduplication = Shared;
} else {
errorMessage += cmStrCat(" ", option, '\n');
}
@@ -499,7 +502,7 @@ private:
Reverse
};
- enum UnicityKind
+ enum DeduplicationKind
{
None,
Shared,
@@ -520,11 +523,11 @@ private:
}
}
- return this->Unicity == None ||
- (this->Unicity == Shared &&
+ return this->Deduplication == None ||
+ (this->Deduplication == Shared &&
(entry.Target == nullptr ||
entry.Target->GetType() != cmStateEnums::SHARED_LIBRARY)) ||
- (this->Unicity == All && entry.Kind != LinkEntry::Library);
+ (this->Deduplication == All && entry.Kind != LinkEntry::Library);
}
template <typename Range>
@@ -539,7 +542,7 @@ private:
}
OrderKind Order = Reverse;
- UnicityKind Unicity = Shared;
+ DeduplicationKind Deduplication = Shared;
const cmGeneratorTarget* Target;
const std::string& LinkLanguage;
EntryVector& Entries;
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1.cmake b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1.cmake
index e79eb45..ac5f7f1 100644
--- a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1.cmake
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1.cmake
@@ -1,7 +1,7 @@
enable_language(C)
-set(CMAKE_C_LINK_LIBRARIES_PROCESSING ORDER= UNICITY=ALL)
+set(CMAKE_C_LINK_LIBRARIES_PROCESSING ORDER= DEDUPLICATION=ALL)
add_library(lib STATIC lib.c)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2.cmake b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2.cmake
index c9da734..63edfd3 100644
--- a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2.cmake
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2.cmake
@@ -1,7 +1,7 @@
enable_language(C)
-set(CMAKE_C_LINK_LIBRARIES_PROCESSING UNICITY=ALL ORDER)
+set(CMAKE_C_LINK_LIBRARIES_PROCESSING DEDUPLICATION=ALL ORDER)
add_library(lib STATIC lib.c)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3.cmake b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3.cmake
index a1311fe..0bd7c5f 100644
--- a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3.cmake
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3.cmake
@@ -1,7 +1,7 @@
enable_language(C)
-set(CMAKE_C_LINK_LIBRARIES_PROCESSING WRONG=REVERSE UNICITY=ALL)
+set(CMAKE_C_LINK_LIBRARIES_PROCESSING WRONG=REVERSE DEDUPLICATION=ALL)
add_library(lib STATIC lib.c)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-stderr.txt b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-stderr.txt
index 46d5513..256fd4e 100644
--- a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-stderr.txt
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-stderr.txt
@@ -2,7 +2,7 @@ CMake Error at InvalidConfiguration4.cmake:[0-9]+ \(add_executable\):
Erroneous option\(s\) for 'CMAKE_C_LINK_LIBRARIES_PROCESSING':
WRONG=REVERSE
- UNICITY=WRONG
+ DEDUPLICATION=WRONG
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4.cmake b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4.cmake
index 9d48f4f..ccb4dae 100644
--- a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4.cmake
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4.cmake
@@ -1,7 +1,7 @@
enable_language(C)
-set(CMAKE_C_LINK_LIBRARIES_PROCESSING WRONG=REVERSE UNICITY=WRONG)
+set(CMAKE_C_LINK_LIBRARIES_PROCESSING WRONG=REVERSE DEDUPLICATION=WRONG)
add_library(lib STATIC lib.c)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-result.txt b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_DEDUPLICATION-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-result.txt
+++ b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_DEDUPLICATION-result.txt
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-stderr.txt b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_DEDUPLICATION-stderr.txt
index 4d759b7..1138a31 100644
--- a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-stderr.txt
+++ b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_DEDUPLICATION-stderr.txt
@@ -1,7 +1,7 @@
-CMake Error at Invalid_UNICITY.cmake:[0-9]+ \(add_executable\):
+CMake Error at Invalid_DEDUPLICATION.cmake:[0-9]+ \(add_executable\):
Erroneous option\(s\) for 'CMAKE_C_LINK_LIBRARIES_PROCESSING':
- UNICITY=WRONG
+ DEDUPLICATION=WRONG
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY.cmake b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_DEDUPLICATION.cmake
index f423eef..e5ff622 100644
--- a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY.cmake
+++ b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_DEDUPLICATION.cmake
@@ -1,7 +1,7 @@
enable_language(C)
-set(CMAKE_C_LINK_LIBRARIES_PROCESSING ORDER=REVERSE UNICITY=WRONG)
+set(CMAKE_C_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=WRONG)
add_library(lib STATIC lib.c)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER.cmake b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER.cmake
index 72a7e02..f0c7ee3 100644
--- a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER.cmake
+++ b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER.cmake
@@ -1,7 +1,7 @@
enable_language(C)
-set(CMAKE_C_LINK_LIBRARIES_PROCESSING ORDER=WRONG UNICITY=ALL)
+set(CMAKE_C_LINK_LIBRARIES_PROCESSING ORDER=WRONG DEDUPLICATION=ALL)
add_library(lib STATIC lib.c)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/RunCMakeTest.cmake b/Tests/RunCMake/LinkLibrariesProcessing/RunCMakeTest.cmake
index 763f48b..d4105b4 100644
--- a/Tests/RunCMake/LinkLibrariesProcessing/RunCMakeTest.cmake
+++ b/Tests/RunCMake/LinkLibrariesProcessing/RunCMakeTest.cmake
@@ -1,7 +1,7 @@
include(RunCMake)
run_cmake(Invalid_ORDER)
-run_cmake(Invalid_UNICITY)
+run_cmake(Invalid_DEDUPLICATION)
run_cmake(InvalidConfiguration1)
run_cmake(InvalidConfiguration2)
run_cmake(InvalidConfiguration3)