summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-10-12 14:26:20 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-10-12 14:26:20 (GMT)
commitaad0e62060783539ef8ec4d09ad12ed9dacb5e7c (patch)
tree9f3318ad0e0774e8cec723819f611b6a83aa53f3 /Source/cmGeneratorTarget.h
parent83d2b6f378ddb462a105c2754f0b061f31709655 (diff)
parent1c1c2a1201682d17491026cb392c31ae5e63e1a5 (diff)
downloadCMake-aad0e62060783539ef8ec4d09ad12ed9dacb5e7c.zip
CMake-aad0e62060783539ef8ec4d09ad12ed9dacb5e7c.tar.gz
CMake-aad0e62060783539ef8ec4d09ad12ed9dacb5e7c.tar.bz2
Merge topic 'use-generator-target'
1c1c2a12 cmGeneratorTarget: Port ExpandLinkItems away from cmTarget. c66084f5 cmGeneratorTarget: Port GetImportLinkInterface away from cmTarget. 83c29e39 cmGeneratorTarget: Port ComputeLinkImplementationLibraries away from cmTarget. 19882554 cmGeneratorTarget: Port handleSystemIncludesDep away from cmTarget. c1f687b1 cmGeneratorTarget: Port GetLinkImplementationLibrariesInternal. a6e1f05c cmGeneratorTarget: Port ComputeLinkInterface away from cmTarget. 654002fe cmGeneratorTarget: Port ComputeLinkInterfaceLibraries away from cmTarget. 922c8901 cmGeneratorTarget: Port GetLinkInterface away from cmTarget. eaa5b9cb cmGeneratorTarget: Port cmTargetCollectLinkLanguages away from cmTarget. f539da12 cmGeneratorTarget: Port GetLinkInterfaceLibraries away from cmTarget. 1c5d70f9 cmGeneratorTarget: Port processILibs away from cmTarget. 064c2488 cmComputeLinkDepends: Port some API to cmGeneratorTarget. 3e428fdc cmGeneratorTarget: Move IsImportedSharedLibWithoutSOName from cmTarget. 110fd2fb cmGeneratorTarget: Move GetOutputTargetType from cmTarget. e7391699 cmGeneratorTarget: Move HasMacOSXRpathInstallNameDir from cmTarget. c5718217 cmGeneratorTarget: Move HaveInstallTreeRPATH from cmTarget. ...
Diffstat (limited to 'Source/cmGeneratorTarget.h')
-rw-r--r--Source/cmGeneratorTarget.h93
1 files changed, 87 insertions, 6 deletions
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index e8c5e04..799110c 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -109,19 +109,19 @@ public:
const std::string& config) const;
cmLinkInterface const* GetLinkInterface(const std::string& config,
- cmTarget const* headTarget) const;
+ const cmGeneratorTarget* headTarget) const;
void ComputeLinkInterface(const std::string& config,
cmOptionalLinkInterface& iface,
- cmTarget const* head) const;
+ const cmGeneratorTarget* head) const;
cmLinkInterfaceLibraries const*
GetLinkInterfaceLibraries(const std::string& config,
- cmTarget const* headTarget,
+ const cmGeneratorTarget* headTarget,
bool usage_requirements_only) const;
void ComputeLinkInterfaceLibraries(const std::string& config,
cmOptionalLinkInterface &iface,
- cmTarget const* head,
+ const cmGeneratorTarget* head,
bool usage_requirements_only) const;
/** Get the full path to the target according to the settings in its
@@ -207,6 +207,13 @@ public:
cmOptionalLinkImplementation& impl
) const;
+ cmLinkImplementationLibraries const*
+ GetLinkImplementationLibraries(const std::string& config) const;
+
+ void ComputeLinkImplementationLibraries(const std::string& config,
+ cmOptionalLinkImplementation& impl,
+ const cmGeneratorTarget* head) const;
+
// Compute the set of languages compiled by the target. This is
// computed every time it is called because the languages can change
// when source file properties are changed and we do not have enough
@@ -261,6 +268,13 @@ public:
*/
void TraceDependencies();
+ /** Get the directory in which this target will be built. If the
+ configuration name is given then the generator will add its
+ subdirectory for that configuration. Otherwise just the canonical
+ output directory is given. */
+ std::string GetDirectory(const std::string& config = "",
+ bool implib = false) const;
+
/** Get the directory in which to place the target compiler .pdb file.
If the configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical
@@ -271,6 +285,22 @@ public:
std::vector<cmSourceFile*> const*
GetSourceDepends(cmSourceFile const* sf) const;
+ /** Return whether this target uses the default value for its output
+ directory. */
+ bool UsesDefaultOutputDir(const std::string& config, bool implib) const;
+
+ // Cache target output paths for each configuration.
+ struct OutputInfo
+ {
+ std::string OutDir;
+ std::string ImpDir;
+ std::string PdbDir;
+ bool empty() const
+ { return OutDir.empty() && ImpDir.empty() && PdbDir.empty(); }
+ };
+
+ OutputInfo const* GetOutputInfo(const std::string& config) const;
+
/** Get the name of the pdb file for the target. */
std::string GetPDBName(const std::string& config="") const;
@@ -287,6 +317,8 @@ public:
typedef std::map<std::string, CompileInfo> CompileInfoMapType;
mutable CompileInfoMapType CompileInfoMap;
+ bool IsNullImpliedByLinkLibraries(const std::string &p) const;
+
/** Get the name of the compiler pdb file for the target. */
std::string GetCompilePDBName(const std::string& config="") const;
@@ -345,6 +377,12 @@ public:
/** Return true if builtin chrpath will work for this target */
bool IsChrpathUsed(const std::string& config) const;
+ /** Get the directory in which this targets .pdb files will be placed.
+ If the configuration name is given then the generator will add its
+ subdirectory for that configuration. Otherwise just the canonical
+ pdb output directory is given. */
+ std::string GetPDBDirectory(const std::string& config) const;
+
///! Return the preferred linker language for this target
std::string GetLinkerLanguage(const std::string& config = "") const;
@@ -369,6 +407,18 @@ public:
class TargetPropertyEntry;
+ bool HaveInstallTreeRPATH() const;
+
+ /** Whether this library has \@rpath and platform supports it. */
+ bool HasMacOSXRpathInstallNameDir(const std::string& config) const;
+
+ /** Whether this library defaults to \@rpath. */
+ bool MacOSXRpathInstallNameDirDefault() const;
+
+ /** Test for special case of a third-party shared library that has
+ no soname at all. */
+ bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
+
private:
friend class cmTargetTraceDependencies;
struct SourceEntry { std::vector<cmSourceFile*> Depends; };
@@ -393,6 +443,9 @@ private:
typedef std::map<std::string, LinkClosure> LinkClosureMapType;
mutable LinkClosureMapType LinkClosureMap;
+ // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
+ const char* GetOutputTargetType(bool implib) const;
+
struct CompatibleInterfacesBase
{
std::set<std::string> PropsBool;
@@ -438,7 +491,8 @@ private:
std::string const& config) const;
cmLinkInterface const*
- GetImportLinkInterface(const std::string& config, cmTarget const* head,
+ GetImportLinkInterface(const std::string& config,
+ const cmGeneratorTarget* head,
bool usage_requirements_only) const;
typedef std::map<std::string, std::vector<cmSourceFile*> >
@@ -450,9 +504,11 @@ private:
std::vector<TargetPropertyEntry*> CompileFeaturesEntries;
std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
std::vector<TargetPropertyEntry*> SourceEntries;
+ mutable std::set<std::string> LinkImplicitNullProperties;
void ExpandLinkItems(std::string const& prop, std::string const& value,
- std::string const& config, cmTarget const* headTarget,
+ std::string const& config,
+ const cmGeneratorTarget* headTarget,
bool usage_requirements_only,
std::vector<cmLinkItem>& items,
bool& hadHeadSensitiveCondition) const;
@@ -462,6 +518,22 @@ private:
void GetSourceFiles(std::vector<std::string>& files,
const std::string& config) const;
+ struct HeadToLinkImplementationMap:
+ public std::map<cmTarget const*, cmOptionalLinkImplementation> {};
+ typedef std::map<std::string,
+ HeadToLinkImplementationMap> LinkImplMapType;
+ mutable LinkImplMapType LinkImplMap;
+
+ cmLinkImplementationLibraries const*
+ GetLinkImplementationLibrariesInternal(const std::string& config,
+ const cmGeneratorTarget* head) const;
+ bool
+ ComputeOutputDir(const std::string& config,
+ bool implib, std::string& out) const;
+
+ typedef std::map<std::string, OutputInfo> OutputInfoMapType;
+ mutable OutputInfoMapType OutputInfoMap;
+
typedef std::pair<std::string, bool> OutputNameKey;
typedef std::map<OutputNameKey, std::string> OutputNameMapType;
mutable OutputNameMapType OutputNameMap;
@@ -473,10 +545,19 @@ private:
mutable bool DebugSourcesDone;
mutable bool LinkImplementationLanguageIsContextDependent;
+ bool ComputePDBOutputDir(const std::string& kind, const std::string& config,
+ std::string& out) const;
+
public:
std::vector<cmTarget const*> const&
GetLinkImplementationClosure(const std::string& config) const;
+ mutable std::map<std::string, std::string> MaxLanguageStandards;
+ std::map<std::string, std::string> const&
+ GetMaxLanguageStandards() const
+ {
+ return this->MaxLanguageStandards;
+ }
};
struct cmStrictTargetComparison {