summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-05-18 10:12:18 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-06-02 10:00:51 (GMT)
commit0e9f4bc00c6b26f254e74063e4026ac33b786513 (patch)
treee12a3e2c39e38d11bdfef151289810bce99c16f3 /Source/cmTarget.cxx
parent5361270c6e9898b7ea10854ae101301772cd9b7d (diff)
downloadCMake-0e9f4bc00c6b26f254e74063e4026ac33b786513.zip
CMake-0e9f4bc00c6b26f254e74063e4026ac33b786513.tar.gz
CMake-0e9f4bc00c6b26f254e74063e4026ac33b786513.tar.bz2
Introduce target property <LANG>_VISIBILITY_PRESET
This is initialized by CMAKE_<LANG>_VISIBILITY_PRESET. The target property is used as the operand to the -fvisibility= compile option with GNU compilers and clang.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index eb746b1..c34c3ab 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -924,6 +924,24 @@ void cmTarget::DefineProperties(cmake *cm)
"(such as \"lib\") on a library name.");
cm->DefineProperty
+ ("C_VISIBILITY_PRESET", cmProperty::TARGET,
+ "Value for symbol visibility compile flags",
+ "The C_VISIBILITY_PRESET property determines the value passed used in "
+ "a visibility related compile option, such as -fvisibility=. This "
+ "property only has an affect for libraries and executables with "
+ "exports. This property is initialized by the value of the variable "
+ "CMAKE_C_VISIBILITY_PRESET if it is set when a target is created.");
+
+ cm->DefineProperty
+ ("CXX_VISIBILITY_PRESET", cmProperty::TARGET,
+ "Value for symbol visibility compile flags",
+ "The CXX_VISIBILITY_PRESET property determines the value passed used in "
+ "a visibility related compile option, such as -fvisibility=. This "
+ "property only has an affect for libraries and executables with "
+ "exports. This property is initialized by the value of the variable "
+ "CMAKE_CXX_VISIBILITY_PRESET if it is set when a target is created.");
+
+ cm->DefineProperty
("POSITION_INDEPENDENT_CODE", cmProperty::TARGET,
"Whether to create a position-independent target",
"The POSITION_INDEPENDENT_CODE property determines whether position "
@@ -1560,6 +1578,9 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->InsertInclude(*it);
}
+ this->SetPropertyDefault("C_VISIBILITY_PRESET", 0);
+ this->SetPropertyDefault("CXX_VISIBILITY_PRESET", 0);
+
if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY
|| this->TargetTypeValue == cmTarget::MODULE_LIBRARY)
{