Fix for bugs #9756, #9690 and #9755, header files were not included, and link_directories we incorrect
This commit is contained in:
parent
b8464a066e
commit
7c06e91c9c
@ -375,6 +375,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
|
|||||||
std::vector<cmSourceFile*> clCompile;
|
std::vector<cmSourceFile*> clCompile;
|
||||||
std::vector<cmSourceFile*> customBuild;
|
std::vector<cmSourceFile*> customBuild;
|
||||||
std::vector<cmSourceFile*> none;
|
std::vector<cmSourceFile*> none;
|
||||||
|
std::vector<cmSourceFile*> headers;
|
||||||
|
|
||||||
for(std::vector<cmSourceFile*>::const_iterator s = classes.begin();
|
for(std::vector<cmSourceFile*>::const_iterator s = classes.begin();
|
||||||
s != classes.end(); s++)
|
s != classes.end(); s++)
|
||||||
@ -385,6 +386,9 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
|
|||||||
this->Makefile->FindSourceGroup(source.c_str(), sourceGroups);
|
this->Makefile->FindSourceGroup(source.c_str(), sourceGroups);
|
||||||
groupsUsed.insert(&sourceGroup);
|
groupsUsed.insert(&sourceGroup);
|
||||||
const char* lang = sf->GetLanguage();
|
const char* lang = sf->GetLanguage();
|
||||||
|
bool header = (*s)->GetPropertyAsBool("HEADER_FILE_ONLY")
|
||||||
|
|| this->GlobalGenerator->IgnoreFile
|
||||||
|
((*s)->GetExtension().c_str());
|
||||||
if(!lang)
|
if(!lang)
|
||||||
{
|
{
|
||||||
lang = "None";
|
lang = "None";
|
||||||
@ -397,6 +401,10 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
|
|||||||
{
|
{
|
||||||
customBuild.push_back(sf);
|
customBuild.push_back(sf);
|
||||||
}
|
}
|
||||||
|
else if(header)
|
||||||
|
{
|
||||||
|
headers.push_back(sf);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
none.push_back(sf);
|
none.push_back(sf);
|
||||||
@ -419,6 +427,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
|
|||||||
"developer/msbuild/2003\">\n",
|
"developer/msbuild/2003\">\n",
|
||||||
0);
|
0);
|
||||||
this->WriteGroupSources("ClCompile", clCompile, sourceGroups);
|
this->WriteGroupSources("ClCompile", clCompile, sourceGroups);
|
||||||
|
this->WriteGroupSources("ClInclude", headers, sourceGroups);
|
||||||
this->WriteGroupSources("CustomBuild", customBuild, sourceGroups);
|
this->WriteGroupSources("CustomBuild", customBuild, sourceGroups);
|
||||||
|
|
||||||
this->WriteString("<ItemGroup>\n", 1);
|
this->WriteString("<ItemGroup>\n", 1);
|
||||||
@ -532,13 +541,13 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
|
|||||||
{
|
{
|
||||||
// if it is not a custom command then add it as a c/c++ file,
|
// if it is not a custom command then add it as a c/c++ file,
|
||||||
// TODO: need to check for idl or rc
|
// TODO: need to check for idl or rc
|
||||||
if(!(*source)->GetCustomCommand()
|
if(!(*source)->GetCustomCommand())
|
||||||
&& !(*source)->GetPropertyAsBool("HEADER_FILE_ONLY")
|
|
||||||
&& !this->GlobalGenerator->IgnoreFile
|
|
||||||
((*source)->GetExtension().c_str()))
|
|
||||||
{
|
{
|
||||||
|
bool header = (*source)->GetPropertyAsBool("HEADER_FILE_ONLY")
|
||||||
|
|| this->GlobalGenerator->IgnoreFile
|
||||||
|
((*source)->GetExtension().c_str());
|
||||||
const char* lang = (*source)->GetLanguage();
|
const char* lang = (*source)->GetLanguage();
|
||||||
if(lang && (strcmp(lang, "C") == 0 || strcmp(lang, "CXX") ==0))
|
if(header || lang && (strcmp(lang, "C") == 0 || strcmp(lang, "CXX") ==0))
|
||||||
{
|
{
|
||||||
std::string sourceFile = (*source)->GetFullPath();
|
std::string sourceFile = (*source)->GetFullPath();
|
||||||
sourceFile = cmSystemTools::RelativePath(
|
sourceFile = cmSystemTools::RelativePath(
|
||||||
@ -546,7 +555,14 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
|
|||||||
sourceFile.c_str());
|
sourceFile.c_str());
|
||||||
this->ConvertToWindowsSlash(sourceFile);
|
this->ConvertToWindowsSlash(sourceFile);
|
||||||
// output the source file
|
// output the source file
|
||||||
|
if(header)
|
||||||
|
{
|
||||||
|
this->WriteString("<ClInclude Include=\"", 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
this->WriteString("<ClCompile Include=\"", 2);
|
this->WriteString("<ClCompile Include=\"", 2);
|
||||||
|
}
|
||||||
(*this->BuildFileStream ) << sourceFile << "\"";
|
(*this->BuildFileStream ) << sourceFile << "\"";
|
||||||
// ouput any flags specific to this source file
|
// ouput any flags specific to this source file
|
||||||
if(this->OutputSourceSpecificFlags(*source))
|
if(this->OutputSourceSpecificFlags(*source))
|
||||||
@ -1080,11 +1096,12 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
|
|||||||
// first just full path
|
// first just full path
|
||||||
linkDirs += sep;
|
linkDirs += sep;
|
||||||
linkDirs += *d;
|
linkDirs += *d;
|
||||||
|
sep = ";";
|
||||||
linkDirs += sep;
|
linkDirs += sep;
|
||||||
// next path with configuration type Debug, Release, etc
|
// next path with configuration type Debug, Release, etc
|
||||||
linkDirs += *d;
|
linkDirs += *d;
|
||||||
linkDirs += "/$(Configuration)";
|
linkDirs += "/$(Configuration)";
|
||||||
sep = ";";
|
linkDirs += sep;
|
||||||
}
|
}
|
||||||
linkDirs += "%(AdditionalLibraryDirectories)";
|
linkDirs += "%(AdditionalLibraryDirectories)";
|
||||||
linkOptions.AddFlag("AdditionalLibraryDirectories", linkDirs.c_str());
|
linkOptions.AddFlag("AdditionalLibraryDirectories", linkDirs.c_str());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user