Merge branch 'gfortran-compressed-modules' into release
This commit is contained in:
commit
3ec3b8a926
|
@ -765,7 +765,11 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
|
||||||
const char* compilerId)
|
const char* compilerId)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
gnu:
|
gnu >= 4.9:
|
||||||
|
A mod file is an ascii file compressed with gzip.
|
||||||
|
Compiling twice produces identical modules.
|
||||||
|
|
||||||
|
gnu < 4.9:
|
||||||
A mod file is an ascii file.
|
A mod file is an ascii file.
|
||||||
<bar.mod>
|
<bar.mod>
|
||||||
FORTRAN module created from /path/to/foo.f90 on Sun Dec 30 22:47:58 2007
|
FORTRAN module created from /path/to/foo.f90 on Sun Dec 30 22:47:58 2007
|
||||||
|
@ -820,6 +824,14 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
|
||||||
* are left behind.
|
* are left behind.
|
||||||
*/
|
*/
|
||||||
if (strcmp(compilerId, "GNU") == 0 )
|
if (strcmp(compilerId, "GNU") == 0 )
|
||||||
|
{
|
||||||
|
// GNU Fortran 4.9 and later compress .mod files with gzip
|
||||||
|
// but also do not include a date so we can fall through to
|
||||||
|
// compare them without skipping any prefix.
|
||||||
|
unsigned char hdr[2];
|
||||||
|
bool okay = finModFile.read(reinterpret_cast<char*>(hdr), 2)? true:false;
|
||||||
|
finModFile.seekg(0);
|
||||||
|
if(!(okay && hdr[0] == 0x1f && hdr[1] == 0x8b))
|
||||||
{
|
{
|
||||||
const char seq[1] = {'\n'};
|
const char seq[1] = {'\n'};
|
||||||
const int seqlen = 1;
|
const int seqlen = 1;
|
||||||
|
@ -838,6 +850,7 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if(strcmp(compilerId, "Intel") == 0)
|
else if(strcmp(compilerId, "Intel") == 0)
|
||||||
{
|
{
|
||||||
const char seq[2] = {'\n', '\0'};
|
const char seq[2] = {'\n', '\0'};
|
||||||
|
|
Loading…
Reference in New Issue