Skip to content

Commit 82d8051

Browse files
joyeecheungtargos
authored andcommitted
build: don't clean obj.target directory if it doesn't exist
This can happen to ninja builds, which would then throw an error instead of being a noop if the command is executed. PR-URL: #54337 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
1 parent 36931aa commit 82d8051

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,10 @@ coverage-clean:
240240
$(RM) -r node_modules
241241
$(RM) -r gcovr
242242
$(RM) -r coverage/tmp
243-
$(FIND) out/$(BUILDTYPE)/obj.target \( -name "*.gcda" -o -name "*.gcno" \) \
244-
-type f -exec $(RM) {} \;
243+
@if [ -d "out/Release/obj.target" ]; then \
244+
$(FIND) out/$(BUILDTYPE)/obj.target \( -name "*.gcda" -o -name "*.gcno" \) \
245+
-type f -exec $(RM) {};\
246+
fi
245247

246248
.PHONY: coverage
247249
# Build and test with code coverage reporting. HTML coverage reports will be
@@ -265,7 +267,9 @@ coverage-build-js:
265267

266268
.PHONY: coverage-test
267269
coverage-test: coverage-build
268-
$(FIND) out/$(BUILDTYPE)/obj.target -name "*.gcda" -type f -exec $(RM) {} \;
270+
@if [ -d "out/Release/obj.target" ]; then \
271+
$(FIND) out/$(BUILDTYPE)/obj.target -name "*.gcda" -type f -exec $(RM) {}; \
272+
fi
269273
-NODE_V8_COVERAGE=coverage/tmp \
270274
TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) $(COVTESTS)
271275
$(MAKE) coverage-report-js

0 commit comments

Comments
 (0)