summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-03-15 14:30:57 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2022-03-22 10:36:10 (GMT)
commitd6583327827a7d53b358cbec03186293c4a5d53d (patch)
tree3b8a74c1aaafb03013aea079fe831b841d989335
parente4039a8e34d3ac01abb88851cacc5eb043a0cbc2 (diff)
downloadCMake-d6583327827a7d53b358cbec03186293c4a5d53d.zip
CMake-d6583327827a7d53b358cbec03186293c4a5d53d.tar.gz
CMake-d6583327827a7d53b358cbec03186293c4a5d53d.tar.bz2
Genex-LINK_GROUP: Add support feature RESCAN on BSD systems
-rw-r--r--Help/release/dev/rescan-static-libraries.rst5
-rw-r--r--Help/variable/LINK_GROUP_PREDEFINED_FEATURES.txt8
-rw-r--r--Modules/Platform/FreeBSD.cmake7
-rw-r--r--Modules/Platform/NetBSD.cmake7
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_GROUP/RunCMakeTest.cmake2
5 files changed, 22 insertions, 7 deletions
diff --git a/Help/release/dev/rescan-static-libraries.rst b/Help/release/dev/rescan-static-libraries.rst
index 1ab3485..8892d70 100644
--- a/Help/release/dev/rescan-static-libraries.rst
+++ b/Help/release/dev/rescan-static-libraries.rst
@@ -1,5 +1,6 @@
rescan-static-libraries
-----------------------
-* The :genex:`LINK_GROUP` generator expression gained the ability to manage
- circular references between static libraries by using ``RESCAN`` feature.
+* The :genex:`LINK_GROUP` generator expression gained the ability to manage, on
+ ``Linux`` and ``BSD`` systems, circular references between static libraries
+ by using ``RESCAN`` feature.
diff --git a/Help/variable/LINK_GROUP_PREDEFINED_FEATURES.txt b/Help/variable/LINK_GROUP_PREDEFINED_FEATURES.txt
index 7c5b458..5f1a11b 100644
--- a/Help/variable/LINK_GROUP_PREDEFINED_FEATURES.txt
+++ b/Help/variable/LINK_GROUP_PREDEFINED_FEATURES.txt
@@ -15,8 +15,8 @@ static libraries, the following feature can be used:
``-z rescan-start`` and ``-z rescan-end``).
Using this feature has a significant performance cost. It is best to use it
- only when there are unavoidable circular references between two or more static
- libraries.
+ only when there are unavoidable circular references between two or more
+ static libraries.
- This feature is available on ``Linux`` and ``SunOS`` platforms as well as
- ``Windows`` when ``GNU`` toolchain is used.
+ This feature is available on ``Linux``, ``BSD``, and ``SunOS`` target
+ platforms as well as ``Windows`` when ``GNU`` toolchain is used.
diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake
index 4c8cb6a..bd5a786 100644
--- a/Modules/Platform/FreeBSD.cmake
+++ b/Modules/Platform/FreeBSD.cmake
@@ -53,4 +53,11 @@ endif()
set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE)
+# Features for LINK_GROUP generator expression
+## RESCAN: request the linker to rescan static libraries until there is
+## no pending undefined symbols
+set(CMAKE_LINK_GROUP_USING_RESCAN "LINKER:--start-group" "LINKER:--end-group")
+set(CMAKE_LINK_GROUP_USING_RESCAN_SUPPORTED TRUE)
+
+
include(Platform/UnixPaths)
diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake
index 8774159..ab85923 100644
--- a/Modules/Platform/NetBSD.cmake
+++ b/Modules/Platform/NetBSD.cmake
@@ -39,4 +39,11 @@ endif()
set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE)
+# Features for LINK_GROUP generator expression
+## RESCAN: request the linker to rescan static libraries until there is
+## no pending undefined symbols
+set(CMAKE_LINK_GROUP_USING_RESCAN "LINKER:--start-group" "LINKER:--end-group")
+set(CMAKE_LINK_GROUP_USING_RESCAN_SUPPORTED TRUE)
+
+
include(Platform/UnixPaths)
diff --git a/Tests/RunCMake/target_link_libraries-LINK_GROUP/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-LINK_GROUP/RunCMakeTest.cmake
index 8307bb2..400905c 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_GROUP/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_GROUP/RunCMakeTest.cmake
@@ -63,7 +63,7 @@ if ((RunCMake_GENERATOR MATCHES "Makefiles|Ninja|Xcode"
endif()
# Feature RESCAN
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux"
+if (CMAKE_SYSTEM_NAME MATCHES "Linux|BSD"
OR (CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND (NOT CMAKE_C_COMPILER_ID STREQUAL "SunPro" OR CMAKE_C_COMPILER_VERSION VERSION_GREATER "5.9"))
OR (WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU"))
run_cmake(rescan)