summaryrefslogtreecommitdiff
path: root/Modules/Platform
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2022-08-15 19:53:35 +0200
committerCraig Scott <craig.scott@crascit.com>2022-08-21 09:27:59 +1000
commita20d7a9707009a5195a817ac54ecabbfd8bd48db (patch)
tree33d2002c812ddd3ca694c93a6557a3147462ff81 /Modules/Platform
parent2ae42d0aa38ead2935d545f7d398ddf5df8b396d (diff)
downloadcmake-a20d7a9707009a5195a817ac54ecabbfd8bd48db.tar.gz
BSD: Set *BSD variables when targeting a *BSD system
Fixes: #23853
Diffstat (limited to 'Modules/Platform')
-rw-r--r--Modules/Platform/DragonFly.cmake2
-rw-r--r--Modules/Platform/FreeBSD.cmake2
-rw-r--r--Modules/Platform/NetBSD.cmake2
-rw-r--r--Modules/Platform/OpenBSD.cmake2
4 files changed, 8 insertions, 0 deletions
diff --git a/Modules/Platform/DragonFly.cmake b/Modules/Platform/DragonFly.cmake
index 12e5f3cccf..d8bc05a1d6 100644
--- a/Modules/Platform/DragonFly.cmake
+++ b/Modules/Platform/DragonFly.cmake
@@ -3,6 +3,8 @@
# see http://archive.netbsd.se/?ml=dfbsd-users&a=2007-07&m=4678361
include(Platform/FreeBSD)
+unset(FREEBSD)
+set(DRAGONFLYBSD 1)
# DragonFly BSD requires -z origin to enable $ORIGIN expansion in RPATH.
# This is not required for FreeBSD since 10.2-RELEASE.
diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake
index bd5a78638e..e968a78ec3 100644
--- a/Modules/Platform/FreeBSD.cmake
+++ b/Modules/Platform/FreeBSD.cmake
@@ -1,3 +1,5 @@
+set(FREEBSD 1)
+set(BSD 1)
set(CMAKE_DL_LIBS "")
set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake
index ab859239fb..a64bf0bd23 100644
--- a/Modules/Platform/NetBSD.cmake
+++ b/Modules/Platform/NetBSD.cmake
@@ -1,3 +1,5 @@
+set(NETBSD 1)
+set(BSD 1)
set(CMAKE_DL_LIBS "")
set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
diff --git a/Modules/Platform/OpenBSD.cmake b/Modules/Platform/OpenBSD.cmake
index 97e2a6a83e..f6b955a167 100644
--- a/Modules/Platform/OpenBSD.cmake
+++ b/Modules/Platform/OpenBSD.cmake
@@ -1,4 +1,6 @@
include(Platform/NetBSD)
+unset(NETBSD)
+set(OPENBSD 1)
# On OpenBSD, the compile time linker does not share it's configuration with
# the runtime linker. This will extract the library search paths from the