on xenial help sign in
Serialize two make targets that want to cp to the same target file

Whitout it, running while [ true ]; do rm -f qmldir; make -j4 all; if [ $? -ne 0 ]; then break; fi; done in builddir/tests/mocks/Unity eventually fails. (LP: #1660576) Approved by: Michael Terry, Unity8 CI Bot

commit78786af859bfa2bc5d79e0901683c80bd0fcb860 authorAlbert Astals Cid <albert.astals@canonical.com> dateThu 16 Feb 2017, 13:46 (10 years ago) parentf78a46aa311aa4
1 file changed+6
tests/mocks/Unity/CMakeLists.txt+6
tests/mocks/Unity/CMakeLists.txt+6
@@ -73,3 +73,9 @@ add_unity8_mock(Unity 0.2 Unity TARGETS FakeUnityQml)
7373
7474# and one copy in a separate directory for autopilot
7575add_unity8_mock(Unity 0.2 Unity PREFIX scopefakes TARGETS FakeUnityQml)
76+
77+# Since on build both copy the same file to the same location (not great)
78+# make sure one depends on the other, otherwise when running with make -jX
79+# we can get errors of cp complaining the file has been created while it
80+# was trying to create it
81+add_dependencies(scopefakes-MockUnity-qmlfiles mocks-MockUnity-qmlfiles)