Avoid C++ linker language in VS Fortran project

In Visual Studio project files we pass compiler flags to the whole
target based on the linker language, which works for MS tools and
combinations of C and C++.  For the Intel Fortran plugin though the
generated .vfproj files should never contain C or C++ options.

We generate .vfproj files only for targets consisting only of Fortran
code.  Now that the linker language is computed transitively through
linking it is possible that the linker language is C++ for an otherwise
Fortran-only project.  This commit forces Fortran as the linker language
for the purpose of specifying target-wide flags in .vfproj files.

See issue #9719.
This commit is contained in:
Brad King 2009-10-19 15:21:01 -04:00
parent 91eeb6d941
commit 0140d293de
1 changed files with 2 additions and 1 deletions

View File

@ -588,7 +588,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
std::string flags;
if(strcmp(configType, "10") != 0)
{
const char* linkLanguage = target.GetLinkerLanguage(configName);
const char* linkLanguage = (this->FortranProject? "Fortran":
target.GetLinkerLanguage(configName));
if(!linkLanguage)
{
cmSystemTools::Error