ENH: closer

This commit is contained in:
Bill Hoffman 2005-02-01 17:17:12 -05:00
parent 7baa78034e
commit f403811a0c
2 changed files with 21 additions and 10 deletions

View File

@ -65,7 +65,6 @@ int cmGlobalXCodeGenerator::TryCompile(const char *,
*/ */
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(bindir); cmSystemTools::ChangeDirectory(bindir);
std::cerr << "ChangeDirectory " << bindir << "\n";
// Usage: xcodebuild [-project <projectname>] [-activetarget] // Usage: xcodebuild [-project <projectname>] [-activetarget]
// [-alltargets] [-target <targetname>]... [-activebuildstyle] // [-alltargets] [-target <targetname>]... [-activebuildstyle]
// [-buildstyle <buildstylename>] [-optionalbuildstyle <buildstylename>] // [-buildstyle <buildstylename>] [-optionalbuildstyle <buildstylename>]
@ -82,6 +81,8 @@ int cmGlobalXCodeGenerator::TryCompile(const char *,
makeCommand += targetName; makeCommand += targetName;
} }
makeCommand += " -buildstyle Development "; makeCommand += " -buildstyle Development ";
makeCommand += " SYMROOT=";
makeCommand += cmSystemTools::ConvertToOutputPath(bindir);
int retVal; int retVal;
int timeout = cmGlobalGenerator::s_TryCompileTimeout; int timeout = cmGlobalGenerator::s_TryCompileTimeout;
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output, &retVal, if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output, &retVal,
@ -92,8 +93,6 @@ int cmGlobalXCodeGenerator::TryCompile(const char *,
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd.c_str());
return 1; return 1;
} }
std::cerr << makeCommand << "\n";
std::cerr << "build worked " << retVal << "\n";;
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd.c_str());
return retVal; return retVal;
} }
@ -172,12 +171,19 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
cmXCodeObject* settings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); cmXCodeObject* settings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
buildFile->AddAttribute("settings", settings); buildFile->AddAttribute("settings", settings);
fileRef->AddAttribute("fileEncoding", this->CreateString("4")); fileRef->AddAttribute("fileEncoding", this->CreateString("4"));
std::string lang = const char* lang =
this->GetLanguageFromExtension(sf->GetSourceExtension().c_str()); this->GetLanguageFromExtension(sf->GetSourceExtension().c_str());
std::string sourcecode = "sourcecode"; std::string sourcecode = "sourcecode";
if(lang == "C") if(!lang)
{ {
sourcecode += ".c.c"; std::string ext = ".";
ext = sf->GetSourceExtension();
sourcecode += ext;
sourcecode += ext;
}
else if(strcmp(lang, "C") == 0)
{
sourcecode += ".c.c";
} }
// default to c++ // default to c++
else else
@ -199,6 +205,7 @@ void cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
std::vector<cmXCodeObject*>& targets, std::vector<cmXCodeObject*>& targets,
cmXCodeObject* mainGroupChildren) cmXCodeObject* mainGroupChildren)
{ {
m_CurrentMakefile = gen->GetMakefile();
cmTargets &tgts = gen->GetMakefile()->GetTargets(); cmTargets &tgts = gen->GetMakefile()->GetTargets();
for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++) for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++)
{ {
@ -289,8 +296,9 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateExecutable(cmTarget& cmtarget,
this->CreateString("/usr/local/bin")); this->CreateString("/usr/local/bin"));
buildSettings->AddAttribute("OPTIMIZATION_CFLAGS", buildSettings->AddAttribute("OPTIMIZATION_CFLAGS",
this->CreateString("")); this->CreateString(""));
std::cerr << m_CurrentMakefile->GetDefineFlags() << "\n";
buildSettings->AddAttribute("OTHER_CFLAGS", buildSettings->AddAttribute("OTHER_CFLAGS",
this->CreateString("")); this->CreateString(m_CurrentMakefile->GetDefineFlags()));
buildSettings->AddAttribute("OTHER_LDFLAGS", buildSettings->AddAttribute("OTHER_LDFLAGS",
this->CreateString("")); this->CreateString(""));
buildSettings->AddAttribute("OTHER_REZFLAGS", buildSettings->AddAttribute("OTHER_REZFLAGS",
@ -335,8 +343,9 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateStaticLibrary(cmTarget& cmtarget,
this->CreateString("STATIC")); this->CreateString("STATIC"));
buildSettings->AddAttribute("OPTIMIZATION_CFLAGS", buildSettings->AddAttribute("OPTIMIZATION_CFLAGS",
this->CreateString("")); this->CreateString(""));
std::cerr << m_CurrentMakefile->GetDefineFlags() << "\n";
buildSettings->AddAttribute("OTHER_CFLAGS", buildSettings->AddAttribute("OTHER_CFLAGS",
this->CreateString("")); this->CreateString(m_CurrentMakefile->GetDefineFlags()));
buildSettings->AddAttribute("OTHER_LDFLAGS", buildSettings->AddAttribute("OTHER_LDFLAGS",
this->CreateString("")); this->CreateString(""));
buildSettings->AddAttribute("OTHER_REZFLAGS", buildSettings->AddAttribute("OTHER_REZFLAGS",
@ -385,8 +394,9 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateSharedLibrary(cmTarget& cmtarget,
this->CreateString("DYNAMIC")); this->CreateString("DYNAMIC"));
buildSettings->AddAttribute("OPTIMIZATION_CFLAGS", buildSettings->AddAttribute("OPTIMIZATION_CFLAGS",
this->CreateString("")); this->CreateString(""));
std::cerr << m_CurrentMakefile->GetDefineFlags() << "\n" ;
buildSettings->AddAttribute("OTHER_CFLAGS", buildSettings->AddAttribute("OTHER_CFLAGS",
this->CreateString("")); this->CreateString(m_CurrentMakefile->GetDefineFlags()));
const char* libFlag = "-dynamiclib"; const char* libFlag = "-dynamiclib";
if(cmtarget.GetType() == cmTarget::MODULE_LIBRARY) if(cmtarget.GetType() == cmTarget::MODULE_LIBRARY)
{ {
@ -429,8 +439,8 @@ void cmGlobalXCodeGenerator::CreateXCodeObjects(cmLocalGenerator* ,
generators generators
) )
{ {
delete m_RootObject;
this->ClearXCodeObjects(); this->ClearXCodeObjects();
m_RootObject = 0;
cmXCodeObject* group = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); cmXCodeObject* group = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
group->AddAttribute("COPY_PHASE_STRIP", this->CreateString("NO")); group->AddAttribute("COPY_PHASE_STRIP", this->CreateString("NO"));
cmXCodeObject* developBuildStyle = this->CreateObject(cmXCodeObject::PBXBuildStyle); cmXCodeObject* developBuildStyle = this->CreateObject(cmXCodeObject::PBXBuildStyle);

View File

@ -93,6 +93,7 @@ private:
std::vector<cmXCodeObject*> m_XCodeObjects; std::vector<cmXCodeObject*> m_XCodeObjects;
cmXCodeObject* m_RootObject; cmXCodeObject* m_RootObject;
cmMakefile* m_CurrentMakefile;
}; };
#endif #endif