Explorar el Código

Merge topic 'linux-var'

62cd3904bf variable: Set LINUX variable on Linux target systems

Acked-by: Kitware Robot <[email protected]>
Merge-request: !7556
Craig Scott hace 3 años
padre
commit
cb2f1f644b

+ 1 - 0
Help/manual/cmake-variables.7.rst

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

+ 4 - 0
Help/release/dev/LINUX.rst

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

+ 6 - 0
Help/variable/LINUX.rst

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

+ 1 - 0
Modules/Platform/Linux.cmake

@@ -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 ":")

+ 1 - 0
Modules/Platform/kFreeBSD.cmake

@@ -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_]*")