Skip to content

Commit 467ac3a

Browse files
joyeecheungRafaelGSS
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 8a4f8a9 commit 467ac3a

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
@@ -241,8 +241,10 @@ coverage-clean:
241241
$(RM) -r node_modules
242242
$(RM) -r gcovr
243243
$(RM) -r coverage/tmp
244-
$(FIND) out/$(BUILDTYPE)/obj.target \( -name "*.gcda" -o -name "*.gcno" \) \
245-
-type f -exec $(RM) {} \;
244+
@if [ -d "out/Release/obj.target" ]; then \
245+
$(FIND) out/$(BUILDTYPE)/obj.target \( -name "*.gcda" -o -name "*.gcno" \) \
246+
-type f -exec $(RM) {};\
247+
fi
246248

247249
.PHONY: coverage
248250
# Build and test with code coverage reporting. HTML coverage reports will be
@@ -266,7 +268,9 @@ coverage-build-js:
266268

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

0 commit comments

Comments
 (0)