summaryrefslogtreecommitdiff
path: root/Source/cmDocumentVariables.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-30 10:59:37 -0400
committerBrad King <brad.king@kitware.com>2009-07-30 10:59:37 -0400
commitfcab87c9f802965318bee033c2fa3ff27cfbfec7 (patch)
tree75000cee15b4ecd1c233c7c7c259fa15bffb6994 /Source/cmDocumentVariables.cxx
parentfd633b33cff397b110cc69f82fd522cdf905952a (diff)
downloadcmake-fcab87c9f802965318bee033c2fa3ff27cfbfec7.tar.gz
Do not always propagate linker language preference
The commit "Consider link dependencies for link language" taught CMake to propagate linker language preference from languages compiled into libraries linked by a target. It turns out this should only be done for some languages, such as C++, because normally the language of the program entry point (main) should be used. We introduce variable CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES to tell CMake whether a language should propagate its linker preference across targets. Currently it is true only for C++.
Diffstat (limited to 'Source/cmDocumentVariables.cxx')
-rw-r--r--Source/cmDocumentVariables.cxx21
1 files changed, 17 insertions, 4 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index fa762f6ae1..d13a9d314e 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1202,11 +1202,24 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Variables for Languages");
cm->DefineProperty
+ ("CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES", cmProperty::VARIABLE,
+ "True if CMAKE_<LANG>_LINKER_PREFERENCE propagates across targets.",
+ "This is used when CMake selects a linker language for a target. "
+ "Languages compiled directly into the target are always considered. "
+ "A language compiled into static libraries linked by the target is "
+ "considered if this variable is true.", false,
+ "Variables for Languages");
+
+ cm->DefineProperty
("CMAKE_<LANG>_LINKER_PREFERENCE", cmProperty::VARIABLE,
- "Determine if a language should be used for linking.",
- "If this is \"Preferred\" then if there is a mixed "
- "language shared library or executable, then this "
- "languages linker command will be used.",false,
+ "Preference value for linker language selection.",
+ "The \"linker language\" for executable, shared library, and module "
+ "targets is the language whose compiler will invoke the linker. "
+ "The LINKER_LANGUAGE target property sets the language explicitly. "
+ "Otherwise, the linker language is that whose linker preference value "
+ "is highest among languages compiled and linked into the target. "
+ "See also the CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES variable.",
+ false,
"Variables for Languages");
cm->DefineProperty