diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 3f2ae9e27..a243de5c7 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -6481,11 +6481,6 @@ void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget, } } } - if(thisTarget->LinkLanguagePropagatesToDependents()) - { - // Targets using this archive need its language runtime libraries. - iface.Languages = impl->Languages; - } } } } @@ -6497,9 +6492,14 @@ void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget, impl = thisTarget->GetLinkImplementation(config, headTarget); iface.ImplementationIsInterface = true; iface.WrongConfigLibraries = impl->WrongConfigLibraries; - if(thisTarget->LinkLanguagePropagatesToDependents()) + } + + if(thisTarget->LinkLanguagePropagatesToDependents()) + { + // Targets using this archive need its language runtime libraries. + if(cmTarget::LinkImplementation const* impl = + thisTarget->GetLinkImplementation(config, headTarget)) { - // Targets using this archive need its language runtime libraries. iface.Languages = impl->Languages; } } diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index bf6d62971..ef3b31772 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 3.0) project(testf C CXX Fortran) if(NOT DEFINED CMake_TEST_NESTED_MAKE_PROGRAM AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") set(CMake_TEST_NESTED_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}")