BUG: fix for bug 4239, NODEFAULTLIB flag support in ide
This commit is contained in:
parent
266ce704d2
commit
cca67d7f8e
|
@ -366,6 +366,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] =
|
||||||
{"GenerateManifest", "MANIFEST", "enable manifest generation", "TRUE"},
|
{"GenerateManifest", "MANIFEST", "enable manifest generation", "TRUE"},
|
||||||
{"LinkIncremental", "INCREMENTAL:NO", "link incremental", "1"},
|
{"LinkIncremental", "INCREMENTAL:NO", "link incremental", "1"},
|
||||||
{"LinkIncremental", "INCREMENTAL:YES", "link incremental", "2"},
|
{"LinkIncremental", "INCREMENTAL:YES", "link incremental", "2"},
|
||||||
|
{"IgnoreDefaultLibraryNames", "NODEFAULTLIB:", "USER_VALUE", ""},
|
||||||
{0,0,0,0 }
|
{0,0,0,0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -625,6 +626,36 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
|
||||||
this->OutputBuildTool(fout, configName, libName, target);
|
this->OutputBuildTool(fout, configName, libName, target);
|
||||||
fout << "\t\t</Configuration>\n";
|
fout << "\t\t</Configuration>\n";
|
||||||
}
|
}
|
||||||
|
void cmLocalVisualStudio7Generator::ReplaceFlagSetMap(std::string& flags,
|
||||||
|
cmVS7FlagTable* flagTable,
|
||||||
|
std::map<cmStdString,
|
||||||
|
cmStdString>& flagMap,
|
||||||
|
std::string& option,
|
||||||
|
std::string::size_type pos)
|
||||||
|
{
|
||||||
|
std::string value = flagTable->value;
|
||||||
|
if(strcmp(flagTable->comment, "USER_VALUE") == 0)
|
||||||
|
{
|
||||||
|
std::string::size_type len = flags.find(" ", pos);
|
||||||
|
if(len != flags.npos)
|
||||||
|
{
|
||||||
|
len -= option.size();
|
||||||
|
}
|
||||||
|
value = flags.substr(pos+option.size(), len);
|
||||||
|
std::string fullflag = option;
|
||||||
|
fullflag += value;
|
||||||
|
// remove everything
|
||||||
|
cmSystemTools::ReplaceString(flags, fullflag.c_str(), "");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmSystemTools::ReplaceString(flags, option.c_str(), "");
|
||||||
|
}
|
||||||
|
// now put value into flag map
|
||||||
|
|
||||||
|
flagMap[flagTable->IDEName] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void cmLocalVisualStudio7Generator::FillFlagMapFromCommandFlags(
|
void cmLocalVisualStudio7Generator::FillFlagMapFromCommandFlags(
|
||||||
std::map<cmStdString, cmStdString>& flagMap,
|
std::map<cmStdString, cmStdString>& flagMap,
|
||||||
|
@ -639,21 +670,21 @@ void cmLocalVisualStudio7Generator::FillFlagMapFromCommandFlags(
|
||||||
// first do the - version
|
// first do the - version
|
||||||
option = "-";
|
option = "-";
|
||||||
option += flagTable->commandFlag;
|
option += flagTable->commandFlag;
|
||||||
while(flags.find(option) != flags.npos)
|
std::string::size_type pos = flags.find(option);
|
||||||
|
while(pos != flags.npos)
|
||||||
{
|
{
|
||||||
// replace the flag
|
this->ReplaceFlagSetMap(flags, flagTable, flagMap,
|
||||||
cmSystemTools::ReplaceString(flags, option.c_str(), "");
|
option, pos);
|
||||||
// now put value into flag map
|
pos = flags.find(option);
|
||||||
flagMap[flagTable->IDEName] = flagTable->value;
|
|
||||||
}
|
}
|
||||||
// now do the / version
|
// now do the / version
|
||||||
option[0] = '/';
|
option[0] = '/';
|
||||||
while(flags.find(option) != flags.npos)
|
pos = flags.find(option);
|
||||||
|
while(pos != flags.npos)
|
||||||
{
|
{
|
||||||
// replace the flag
|
this->ReplaceFlagSetMap(flags, flagTable, flagMap,
|
||||||
cmSystemTools::ReplaceString(flags, option.c_str(), "");
|
option, pos);
|
||||||
// now put value into flag map
|
pos = flags.find(option);
|
||||||
flagMap[flagTable->IDEName] = flagTable->value;
|
|
||||||
}
|
}
|
||||||
// move to next flag
|
// move to next flag
|
||||||
flagTable++;
|
flagTable++;
|
||||||
|
@ -737,7 +768,6 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
||||||
this->FillFlagMapFromCommandFlags
|
this->FillFlagMapFromCommandFlags
|
||||||
(flagMap, &cmLocalVisualStudio7GeneratorLinkFlagTable[0],
|
(flagMap, &cmLocalVisualStudio7GeneratorLinkFlagTable[0],
|
||||||
extraLinkOptions);
|
extraLinkOptions);
|
||||||
|
|
||||||
switch(target.GetType())
|
switch(target.GetType())
|
||||||
{
|
{
|
||||||
case cmTarget::STATIC_LIBRARY:
|
case cmTarget::STATIC_LIBRARY:
|
||||||
|
|
|
@ -65,6 +65,12 @@ public:
|
||||||
void SetPlatformName(const char* n) { this->PlatformName = n;}
|
void SetPlatformName(const char* n) { this->PlatformName = n;}
|
||||||
virtual void ConfigureFinalPass();
|
virtual void ConfigureFinalPass();
|
||||||
private:
|
private:
|
||||||
|
void ReplaceFlagSetMap(std::string& flags,
|
||||||
|
cmVS7FlagTable* flagTable,
|
||||||
|
std::map<cmStdString,
|
||||||
|
cmStdString>& flagMap,
|
||||||
|
std::string& option,
|
||||||
|
std::string::size_type pos);
|
||||||
void FillFlagMapFromCommandFlags(std::map<cmStdString,
|
void FillFlagMapFromCommandFlags(std::map<cmStdString,
|
||||||
cmStdString>& flagMap,
|
cmStdString>& flagMap,
|
||||||
cmVS7FlagTable* flagTable,
|
cmVS7FlagTable* flagTable,
|
||||||
|
|
Loading…
Reference in New Issue