diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 5d30c5945..7ee40fc12 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -31,6 +31,8 @@ #include // for isspace +static bool cmLVS6G_IsFAT(const char* dir); + class cmLocalVisualStudio7GeneratorInternals { public: @@ -661,16 +663,21 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, fout << "\t\t\t\tInterfaceIdentifierFileName=\"$(InputName)_i.c\"\n"; fout << "\t\t\t\tProxyFileName=\"$(InputName)_p.c\"/>\n"; // end of Version >= 8 ) { - fout << "\t\t\t\n"; + // Check the filesystem type where the target will be written. + if(cmLVS6G_IsFAT(target.GetDirectory(configName))) + { + // Add a flag telling the manifest tool to use a workaround + // for FAT32 file systems, which can cause an empty manifest + // to be embedded into the resulting executable. See CMake + // bug #2617. + fout << "\t\t\t\n"; + } } this->OutputTargetRules(fout, configName, target, libName); @@ -2054,3 +2061,21 @@ GetTargetObjectFileDirectories(cmTarget* target, dir += this->GetGlobalGenerator()->GetCMakeCFGInitDirectory(); dirs.push_back(dir); } + +//---------------------------------------------------------------------------- +#include +static bool cmLVS6G_IsFAT(const char* dir) +{ + if(dir[0] && dir[1] == ':') + { + char volRoot[4] = "_:/"; + volRoot[0] = dir[0]; + char fsName[16]; + if(GetVolumeInformation(volRoot, 0, 0, 0, 0, 0, fsName, 16) && + strstr(fsName, "FAT") != 0) + { + return true; + } + } + return false; +}