Skip to content

Commit

Permalink
build: don't clean obj.target directory if it doesn't exist
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
joyeecheung authored and targos committed Oct 2, 2024
1 parent 36931aa commit 82d8051
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,10 @@ coverage-clean:
$(RM) -r node_modules
$(RM) -r gcovr
$(RM) -r coverage/tmp
$(FIND) out/$(BUILDTYPE)/obj.target \( -name "*.gcda" -o -name "*.gcno" \) \
-type f -exec $(RM) {} \;
@if [ -d "out/Release/obj.target" ]; then \
$(FIND) out/$(BUILDTYPE)/obj.target \( -name "*.gcda" -o -name "*.gcno" \) \
-type f -exec $(RM) {};\
fi

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

.PHONY: coverage-test
coverage-test: coverage-build
$(FIND) out/$(BUILDTYPE)/obj.target -name "*.gcda" -type f -exec $(RM) {} \;
@if [ -d "out/Release/obj.target" ]; then \
$(FIND) out/$(BUILDTYPE)/obj.target -name "*.gcda" -type f -exec $(RM) {}; \
fi
-NODE_V8_COVERAGE=coverage/tmp \
TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) $(COVTESTS)
$(MAKE) coverage-report-js
Expand Down

0 comments on commit 82d8051

Please sign in to comment.