diff options
author | Brad King <brad.king@kitware.com> | 2008-03-31 14:59:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-03-31 14:59:02 (GMT) |
commit | 8605551920bd0a904c146173d46fafbc2bba0b2b (patch) | |
tree | d819a1947609fcfcf5478e8fa100777ff7ace2bf /Source/cmLocalVisualStudio7Generator.cxx | |
parent | 5b3e62c7bc11eab36548f9c61717a05a02655979 (diff) | |
download | CMake-8605551920bd0a904c146173d46fafbc2bba0b2b.zip CMake-8605551920bd0a904c146173d46fafbc2bba0b2b.tar.gz CMake-8605551920bd0a904c146173d46fafbc2bba0b2b.tar.bz2 |
ENH: Improve speed of manifest tool on VS8 and VS9.
- Detect filesystem type where target will be linked
- Use FAT32 workaround only when fs is FAT or FAT32
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 5d30c59..7ee40fc 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -31,6 +31,8 @@ #include <ctype.h> // 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 <Tool Name=VCMIDLTool - - // If we are building a version 8 project file, 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. + + // Check if we need the FAT32 workaround. if ( this->Version >= 8 ) { - fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n" - << "\t\t\t\tUseFAT32Workaround=\"true\"\n" - << "\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<Tool\n\t\t\t\tName=\"VCManifestTool\"\n" + << "\t\t\t\tUseFAT32Workaround=\"true\"\n" + << "\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 <windows.h> +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; +} |