[Cmake-commits] CMake branch, master, updated. 2f25602234fd7ac5a8e3d9295b30364b184d6ac4
cmake-commits at cmake.org
cmake-commits at cmake.org
Sat May 1 14:39:57 EDT 2010
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via 2f25602234fd7ac5a8e3d9295b30364b184d6ac4 (commit)
via 3901e0408c77c3a072ebd7f3276e2ebdf47bf5eb (commit)
from 42c40884d2ef3440c81d2ed13521573f24b12cf3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2f25602234fd7ac5a8e3d9295b30364b184d6ac4
commit 2f25602234fd7ac5a8e3d9295b30364b184d6ac4
Author: Alex Neundorf <neundorf at kde.org>
Date: Sat May 1 14:30:47 2010 +0200
-remove trailing whitespace
Alex
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3901e0408c77c3a072ebd7f3276e2ebdf47bf5eb
commit 3901e0408c77c3a072ebd7f3276e2ebdf47bf5eb
Author: Alex Neundorf <neundorf at kde.org>
Date: Sat May 1 14:29:13 2010 +0200
-improve crosscompiling from Linux to iphone (#10526)
Patch by Karol Krizka
Alex
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index f4c0064..f352172 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -423,3 +423,17 @@ void cmFindCommon::AddTrailingSlashes(std::vector<std::string>& paths)
}
}
}
+
+//----------------------------------------------------------------------------
+void cmFindCommon::SetMakefile(cmMakefile* makefile)
+{
+ cmCommand::SetMakefile(makefile);
+
+ // If we are building for Apple (OSX or also iphone), make sure
+ // that frameworks and bundles are searched first.
+ if(this->Makefile->IsOn("APPLE"))
+ {
+ this->SearchFrameworkFirst = true;
+ this->SearchAppBundleFirst = true;
+ }
+}
diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h
index 08d2158..2ffbd00 100644
--- a/Source/cmFindCommon.h
+++ b/Source/cmFindCommon.h
@@ -61,6 +61,8 @@ protected:
PathType pathType);
void AddPathInternal(std::string const& in_path, PathType pathType);
+ void SetMakefile(cmMakefile* makefile);
+
bool NoDefaultPath;
bool NoCMakePath;
bool NoCMakeEnvironmentPath;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 851e34f..fd3508e 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -712,9 +712,7 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
std::string langFlags;
this->AddLanguageFlags(langFlags, llang, 0);
-#ifdef __APPLE__
this->AddArchitectureFlags(langFlags, &target, llang, 0);
-#endif /* __APPLE__ */
vars.LanguageCompileFlags = langFlags.c_str();
cmCustomCommandLines commandLines;
@@ -1272,8 +1270,8 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
#endif
for(i = includes.begin(); i != includes.end(); ++i)
{
-#ifdef __APPLE__
- if(cmSystemTools::IsPathToFramework(i->c_str()))
+ if(this->Makefile->IsOn("APPLE")
+ && cmSystemTools::IsPathToFramework(i->c_str()))
{
std::string frameworkDir = *i;
frameworkDir += "/../";
@@ -1288,7 +1286,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
}
continue;
}
-#endif
+
std::string include = *i;
if(!flagUsed || repeatFlag)
{
@@ -1766,12 +1764,17 @@ void cmLocalGenerator::OutputLinkLibraries(std::ostream& fout,
//----------------------------------------------------------------------------
-#ifdef __APPLE__
void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
cmTarget* target,
const char *lang,
const char* config)
{
+ // Only add Mac OS X specific flags on Darwin platforms (OSX and iphone):
+ if(!this->Makefile->IsOn("APPLE"))
+ {
+ return;
+ }
+
if(this->EmitUniversalBinaryFlags)
{
std::vector<std::string> archs;
@@ -1828,7 +1831,6 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
}
}
}
-#endif /* __APPLE__ */
//----------------------------------------------------------------------------
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index becdfff..4c2fc22 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -133,10 +133,8 @@ public:
std::vector<cmLocalGenerator*>& GetChildren() { return this->Children; };
-#ifdef __APPLE__
void AddArchitectureFlags(std::string& flags, cmTarget* target,
const char *lang, const char* config);
-#endif /* __APPLE__ */
void AddLanguageFlags(std::string& flags, const char* lang,
const char* config);
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index e7c4a7d..93c981a 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -229,10 +229,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
// Add language feature flags.
this->AddFeatureFlags(flags, linkLanguage);
-#ifdef __APPLE__
this->LocalGenerator->AddArchitectureFlags(flags, this->Target,
linkLanguage, this->ConfigName);
-#endif /* __APPLE__ */
// Add target-specific linker flags.
this->LocalGenerator->AppendFlags
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index f351174..d3e6e11 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -682,10 +682,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
std::string langFlags;
this->AddFeatureFlags(langFlags, linkLanguage);
-#ifdef __APPLE__
this->LocalGenerator->AddArchitectureFlags(langFlags, this->Target,
linkLanguage, this->ConfigName);
-#endif /* __APPLE__ */
// remove any language flags that might not work with the
// particular os
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index dd45950..124d2bd 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -294,10 +294,8 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
// Add language feature flags.
this->AddFeatureFlags(flags, lang);
-#ifdef __APPLE__
this->LocalGenerator->AddArchitectureFlags(flags, this->Target,
lang, this->ConfigName);
-#endif /* __APPLE__ */
// Fortran-specific flags computed for this target.
if(*l == "Fortran")
@@ -1439,11 +1437,15 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(const char* main_output,
//----------------------------------------------------------------------------
std::string cmMakefileTargetGenerator::GetFrameworkFlags()
{
-#ifndef __APPLE__
- return std::string();
-#else
- std::set<cmStdString> emitted;
+ if(!this->Makefile->IsOn("APPLE"))
+ {
+ return std::string();
+ }
+
+ std::set<cmStdString> emitted;
+#ifdef __APPLE__ /* don't insert this when crosscompiling e.g. to iphone */
emitted.insert("/System/Library/Frameworks");
+#else
std::vector<std::string> includes;
this->LocalGenerator->GetIncludeDirectories(includes);
std::vector<std::string>::iterator i;
-----------------------------------------------------------------------
Summary of changes:
Source/cmFindCommon.cxx | 14 ++++++++++++++
Source/cmFindCommon.h | 2 ++
Source/cmLocalGenerator.cxx | 16 +++++++++-------
Source/cmLocalGenerator.h | 2 --
Source/cmMakefileExecutableTargetGenerator.cxx | 2 --
Source/cmMakefileLibraryTargetGenerator.cxx | 2 --
Source/cmMakefileTargetGenerator.cxx | 14 ++++++++------
7 files changed, 33 insertions(+), 19 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list