AIX: Add platform id variables 'AIX' and 'CMAKE_HOST_AIX'
This allows projects to use `if(AIX)` blocks instead of spelling out `if(CMAKE_SYSTEM_NAME STREQUAL "AIX")`. We already have similar variables for many other platforms.
This commit is contained in:
parent
8137cf2822
commit
ff03db6657
@ -323,6 +323,7 @@ Variables that Describe the System
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
/variable/AIX
|
||||
/variable/ANDROID
|
||||
/variable/APPLE
|
||||
/variable/BORLAND
|
||||
@ -331,6 +332,7 @@ Variables that Describe the System
|
||||
/variable/CMAKE_CL_64
|
||||
/variable/CMAKE_COMPILER_2005
|
||||
/variable/CMAKE_HOST_APPLE
|
||||
/variable/CMAKE_HOST_AIX
|
||||
/variable/CMAKE_HOST_BSD
|
||||
/variable/CMAKE_HOST_EXECUTABLE_SUFFIX
|
||||
/variable/CMAKE_HOST_LINUX
|
||||
|
@ -41,6 +41,9 @@ Commands
|
||||
Variables
|
||||
---------
|
||||
|
||||
* The :variable:`AIX` and :variable:`CMAKE_HOST_AIX` variables are
|
||||
now set to true when the target or host system is AIX, respectively.
|
||||
|
||||
* Linker flag variables learned to support the ``LINKER:`` prefix:
|
||||
|
||||
* :variable:`CMAKE_EXE_LINKER_FLAGS`
|
||||
|
6
Help/variable/AIX.rst
Normal file
6
Help/variable/AIX.rst
Normal file
@ -0,0 +1,6 @@
|
||||
AIX
|
||||
---
|
||||
|
||||
.. versionadded:: 4.0
|
||||
|
||||
Set to true when the target system is AIX.
|
6
Help/variable/CMAKE_HOST_AIX.rst
Normal file
6
Help/variable/CMAKE_HOST_AIX.rst
Normal file
@ -0,0 +1,6 @@
|
||||
CMAKE_HOST_AIX
|
||||
--------------
|
||||
|
||||
.. versionadded:: 4.0
|
||||
|
||||
Set to true when the host system is AIX.
|
@ -17,6 +17,7 @@ unset(MSYS)
|
||||
unset(WIN32)
|
||||
unset(BSD)
|
||||
unset(LINUX)
|
||||
unset(AIX)
|
||||
|
||||
# The CMAKE_EFFECTIVE_SYSTEM_NAME is used to load compiler and compiler
|
||||
# wrapper configuration files. By default it equals to CMAKE_SYSTEM_NAME
|
||||
|
@ -1 +1,2 @@
|
||||
set(AIX 1)
|
||||
set(UNIX 1)
|
||||
|
@ -325,6 +325,11 @@ void cmStateSnapshot::SetDefaultDefinitions()
|
||||
this->SetDefinition("CMAKE_HOST_LINUX", "1");
|
||||
#endif
|
||||
|
||||
#if defined(_AIX)
|
||||
this->SetDefinition("AIX", "1");
|
||||
this->SetDefinition("CMAKE_HOST_AIX", "1");
|
||||
#endif
|
||||
|
||||
this->SetDefinition("CMAKE_MAJOR_VERSION",
|
||||
std::to_string(cmVersion::GetMajorVersion()));
|
||||
this->SetDefinition("CMAKE_MINOR_VERSION",
|
||||
|
Loading…
Reference in New Issue
Block a user