Commit dabd1779 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'ninja-framework-POST_BUILD'

20278872 Ninja: Fix POST_BUILD commands on macOS Frameworks
parents 03622ee2 20278872
...@@ -652,7 +652,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() ...@@ -652,7 +652,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
std::string postBuildCmdLine = localGen.BuildCommandLine(postBuildCmdLines); std::string postBuildCmdLine = localGen.BuildCommandLine(postBuildCmdLines);
cmNinjaVars symlinkVars; cmNinjaVars symlinkVars;
if (targetOutput == targetOutputReal) { bool const symlinkNeeded =
(targetOutput != targetOutputReal && !gt.IsFrameworkOnApple());
if (!symlinkNeeded) {
vars["POST_BUILD"] = postBuildCmdLine; vars["POST_BUILD"] = postBuildCmdLine;
} else { } else {
vars["POST_BUILD"] = ":"; vars["POST_BUILD"] = ":";
...@@ -694,7 +696,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() ...@@ -694,7 +696,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
commandLineLengthLimit, &usedResponseFile); commandLineLengthLimit, &usedResponseFile);
this->WriteLinkRule(usedResponseFile); this->WriteLinkRule(usedResponseFile);
if (targetOutput != targetOutputReal && !gt.IsFrameworkOnApple()) { if (symlinkNeeded) {
if (targetType == cmState::EXECUTABLE) { if (targetType == cmState::EXECUTABLE) {
globalGen.WriteBuild( globalGen.WriteBuild(
this->GetBuildFileStream(), this->GetBuildFileStream(),
......
...@@ -51,6 +51,11 @@ install(TARGETS foo bar ...@@ -51,6 +51,11 @@ install(TARGETS foo bar
# duplicate install rules for the pieces of the framework. # duplicate install rules for the pieces of the framework.
) )
# test that framework post-build commands run
add_custom_command(TARGET foo POST_BUILD COMMAND ${CMAKE_COMMAND} -E touch foo-post-build)
add_custom_target(fooCustom ALL COMMAND ${CMAKE_COMMAND} -E copy foo-post-build foo-custom)
add_dependencies(fooCustom foo)
# Make a static library and apply the framework properties to it to verify # Make a static library and apply the framework properties to it to verify
# that everything still builds correctly, but it will not actually produce # that everything still builds correctly, but it will not actually produce
# a framework... The framework properties only apply when the library type # a framework... The framework properties only apply when the library type
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment