Skip to content
Snippets Groups Projects
Commit 43c94281 authored by Brad King's avatar Brad King
Browse files

Ninja: Honor the LINK_DEPENDS target property (#14796)

parent 863b0a8e
No related branches found
No related tags found
No related merge requests found
......@@ -209,6 +209,15 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
result.push_back(this->ConvertToNinjaPath(this->ModuleDefinitionFile));
}
// Add user-specified dependencies.
if (const char* linkDepends = this->Target->GetProperty("LINK_DEPENDS"))
{
std::vector<std::string> linkDeps;
cmSystemTools::ExpandListArgument(linkDepends, linkDeps);
std::transform(linkDeps.begin(), linkDeps.end(),
std::back_inserter(result), MapToNinjaPath());
}
return result;
}
......
......@@ -34,7 +34,7 @@ if(WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
set(_cmake_options "-DCMAKE_EXE_LINKER_FLAGS=")
endif()
if("${CMAKE_GENERATOR}" MATCHES "Make")
if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
set(TEST_LINK_DEPENDS ${BuildDepends_BINARY_DIR}/Project/linkdep.txt)
file(WRITE ${TEST_LINK_DEPENDS} "1")
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment