summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/TinyCC-C.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Compiler/TinyCC-C.cmake')
-rw-r--r--Modules/Compiler/TinyCC-C.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/Compiler/TinyCC-C.cmake b/Modules/Compiler/TinyCC-C.cmake
index bb27ead..4a48c0a 100644
--- a/Modules/Compiler/TinyCC-C.cmake
+++ b/Modules/Compiler/TinyCC-C.cmake
@@ -1 +1,8 @@
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
+
+# no optimization in tcc:
+SET (CMAKE_C_FLAGS_INIT "")
+SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
+SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-DNDEBUG")
+SET (CMAKE_C_FLAGS_RELEASE_INIT "-DNDEBUG")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g")
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx4
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx8
-rw-r--r--Source/cmMakefileTargetGenerator.cxx6
-rw-r--r--Source/cmNinjaTargetGenerator.cxx2
-rw-r--r--Source/cmTarget.cxx50
-rw-r--r--Source/cmTarget.h14
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx2
13 files changed, 95 insertions, 78 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index d77e47b..e53f35e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -14,9 +14,12 @@
#include "cmTarget.h"
#include "cmMakefile.h"
#include "cmLocalGenerator.h"
+#include "cmComputeLinkInformation.h"
#include "cmGlobalGenerator.h"
#include "cmSourceFile.h"
+#include <assert.h>
+
//----------------------------------------------------------------------------
cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t)
{
@@ -27,6 +30,15 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t)
this->LookupObjectLibraries();
}
+cmGeneratorTarget::~cmGeneratorTarget()
+{
+ for(std::map<cmStdString, cmComputeLinkInformation*>::iterator i
+ = LinkInformation.begin(); i != LinkInformation.end(); ++i)
+ {
+ delete i->second;
+ }
+}
+
//----------------------------------------------------------------------------
int cmGeneratorTarget::GetType() const
{
@@ -277,3 +289,29 @@ void cmGeneratorTarget::GenerateTargetManifest(const char* config)
gg->AddToManifest(config? config:"", f);
}
}
+
+//----------------------------------------------------------------------------
+cmComputeLinkInformation*
+cmGeneratorTarget::GetLinkInformation(const char* config)
+{
+ // Lookup any existing information for this configuration.
+ std::map<cmStdString, cmComputeLinkInformation*>::iterator
+ i = this->LinkInformation.find(config?config:"");
+ if(i == this->LinkInformation.end())
+ {
+ // Compute information for this configuration.
+ cmComputeLinkInformation* info =
+ new cmComputeLinkInformation(this->Target, config);
+ if(!info || !info->Compute())
+ {
+ delete info;
+ info = 0;
+ }
+
+ // Store the information for this configuration.
+ std::map<cmStdString, cmComputeLinkInformation*>::value_type
+ entry(config?config:"", info);
+ i = this->LinkInformation.insert(entry).first;
+ }
+ return i->second;
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 12aa971..fefdfb1 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -14,6 +14,7 @@
#include "cmStandardIncludes.h"
+class cmComputeLinkInformation;
class cmCustomCommand;
class cmGlobalGenerator;
class cmLocalGenerator;
@@ -25,6 +26,7 @@ class cmGeneratorTarget
{
public:
cmGeneratorTarget(cmTarget*);
+ ~cmGeneratorTarget();
int GetType() const;
const char *GetName() const;
@@ -61,6 +63,10 @@ public:
/** Add the target output files to the global generator manifest. */
void GenerateTargetManifest(const char* config);
+ std::map<cmStdString, cmComputeLinkInformation*> LinkInformation;
+
+ cmComputeLinkInformation* GetLinkInformation(const char* config);
+
private:
void ClassifySources();
void LookupObjectLibraries();
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index e8ab38f..5ac9070 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2625,7 +2625,8 @@ void cmGlobalXCodeGenerator
}
// Compute the link library and directory information.
- cmComputeLinkInformation* pcli = cmtarget->GetLinkInformation(configName);
+ cmGeneratorTarget* gtgt = this->GetGeneratorTarget(cmtarget);
+ cmComputeLinkInformation* pcli = gtgt->GetLinkInformation(configName);
if(!pcli)
{
continue;
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 5f9b658..347ad3e 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -16,6 +16,7 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmake.h"
+#include "cmGeneratorTarget.h"
#include <assert.h>
@@ -26,7 +27,8 @@ cmInstallTargetGenerator
std::vector<std::string> const& configurations,
const char* component, bool optional):
cmInstallGenerator(dest, configurations, component), Target(&t),
- ImportLibrary(implib), FilePermissions(file_permissions), Optional(optional)
+ ImportLibrary(implib), FilePermissions(file_permissions),
+ Optional(optional), GeneratorTarget(0)
{
this->ActionsPerConfig = true;
this->NamelinkMode = NamelinkModeNone;
@@ -484,6 +486,17 @@ void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os,
this->AddStripRule(os, indent, file);
}
+void cmInstallTargetGenerator::CreateGeneratorTarget()
+{
+ if (!this->GeneratorTarget)
+ {
+ this->GeneratorTarget = this->Target->GetMakefile()
+ ->GetLocalGenerator()
+ ->GetGlobalGenerator()
+ ->GetGeneratorTarget(this->Target);
+ }
+}
+
//----------------------------------------------------------------------------
void
cmInstallTargetGenerator
@@ -507,10 +520,13 @@ cmInstallTargetGenerator
return;
}
+ this->CreateGeneratorTarget();
+
// Build a map of build-tree install_name to install-tree install_name for
// shared libraries linked to this target.
std::map<cmStdString, cmStdString> install_name_remap;
- if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config))
+ if(cmComputeLinkInformation* cli =
+ this->GeneratorTarget->GetLinkInformation(config))
{
std::set<cmTarget*> const& sharedLibs = cli->GetSharedLibrariesLinked();
for(std::set<cmTarget*>::const_iterator j = sharedLibs.begin();
@@ -608,9 +624,12 @@ cmInstallTargetGenerator
return;
}
+ this->CreateGeneratorTarget();
+
// Get the link information for this target.
// It can provide the RPATH.
- cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config);
+ cmComputeLinkInformation* cli =
+ this->GeneratorTarget->GetLinkInformation(config);
if(!cli)
{
return;
@@ -639,9 +658,12 @@ cmInstallTargetGenerator
return;
}
+ this->CreateGeneratorTarget();
+
// Get the link information for this target.
// It can provide the RPATH.
- cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config);
+ cmComputeLinkInformation* cli =
+ this->GeneratorTarget->GetLinkInformation(config);
if(!cli)
{
return;
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h