VS: Fix Fortran target type selection with RC sources

The Intel Fortran `.vfproj` files do support both Fortran and the
Windows Resource compiler (`.rc)` files.  Prior to CMake 3.9 we did not
support that, but commit 2c9f35789d (VS: Decide project type by linker
lang as fallback, 2017-03-30, v3.9.0-rc1~340^2) accidentally enabled it.
It was then broken by commit d3d2c3cd49 (VS: Fix Fortran target type
selection when linking C++ targets, 2019-02-04, v3.14.0-rc1~13^2).

Restore support for Fortran+RC in VS projects and add a test case.

Fixes: #19002
This commit is contained in:
Brad King
2019-03-01 11:47:34 -05:00
parent 20a41aa589
commit 0b82f56ac6
3 changed files with 11 additions and 1 deletions

View File

@@ -834,6 +834,10 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
if (linkLang && *linkLang) {
languages.insert(linkLang);
}
// Intel Fortran .vfproj files do support the resource compiler.
languages.erase("RC");
return languages.size() == 1 && *languages.begin() == "Fortran";
}