variable: Set LINUX variable on Linux target systems

Fixes: #23840
This commit is contained in:
Cristian Adam
2022-08-10 15:54:05 +02:00
committed by Craig Scott
parent 1493ed10a1
commit 62cd3904bf
5 changed files with 13 additions and 0 deletions

View File

@@ -322,6 +322,7 @@ Variables that Describe the System
/variable/CYGWIN
/variable/GHSMULTI
/variable/IOS
/variable/LINUX
/variable/MINGW
/variable/MSVC
/variable/MSVC10

View File

@@ -0,0 +1,4 @@
Variables
---------
* The :variable:`LINUX` variable is set to true when the target system is Linux.

6
Help/variable/LINUX.rst Normal file
View File

@@ -0,0 +1,6 @@
LINUX
-----
.. versionadded:: 3.25
Set to true when the target system is Linux.

View File

@@ -1,3 +1,4 @@
set(LINUX 1)
set(CMAKE_DL_LIBS "dl")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")

View File

@@ -1,4 +1,5 @@
# kFreeBSD looks just like Linux.
include(Platform/Linux)
unset(LINUX)
set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-kfreebsd-gnu[a-z0-9_]*")