Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5575b55

Browse files
Trottdanielleadams
authored andcommittedDec 13, 2021
build: skip documentation generation if no ICU
Closes: #41077 PR-URL: #41091 Fixes: #41077 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 7be562c commit 5575b55

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed
 

‎Makefile

+22-4
Original file line numberDiff line numberDiff line change
@@ -737,21 +737,39 @@ $(LINK_DATA): $(wildcard lib/*.js) tools/doc/apilinks.mjs | out/doc
737737
$(VERSIONS_DATA): CHANGELOG.md src/node_version.h tools/doc/versions.mjs
738738
$(call available-node, tools/doc/versions.mjs $@)
739739

740+
node_use_icu = $(call available-node,"-p" "typeof Intl === 'object'")
741+
740742
out/doc/api/%.json out/doc/api/%.html: doc/api/%.md tools/doc/generate.mjs \
741743
tools/doc/markdown.mjs tools/doc/html.mjs tools/doc/json.mjs \
742744
tools/doc/apilinks.mjs $(VERSIONS_DATA) | $(LINK_DATA) out/doc/api
743-
$(call available-node, $(gen-api))
745+
@if [ "$(shell $(node_use_icu))" != "true" ]; then \
746+
echo "Skipping documentation generation (no ICU)"; \
747+
else \
748+
$(call available-node, $(gen-api)) \
749+
fi
744750

745751
out/doc/api/all.html: $(apidocs_html) tools/doc/allhtml.mjs \
746752
tools/doc/apilinks.mjs | out/doc/api
747-
$(call available-node, tools/doc/allhtml.mjs)
753+
@if [ "$(shell $(node_use_icu))" != "true" ]; then \
754+
echo "Skipping HTML single-page doc generation (no ICU)"; \
755+
else \
756+
$(call available-node, tools/doc/allhtml.mjs) \
757+
fi
748758

749759
out/doc/api/all.json: $(apidocs_json) tools/doc/alljson.mjs | out/doc/api
750-
$(call available-node, tools/doc/alljson.mjs)
760+
@if [ "$(shell $(node_use_icu))" != "true" ]; then \
761+
echo "Skipping JSON single-file generation (no ICU)"; \
762+
else \
763+
$(call available-node, tools/doc/alljson.mjs) \
764+
fi
751765

752766
.PHONY: out/doc/api/stability
753767
out/doc/api/stability: out/doc/api/all.json tools/doc/stability.mjs | out/doc/api
754-
$(call available-node, tools/doc/stability.mjs)
768+
@if [ "$(shell $(node_use_icu))" != "true" ]; then \
769+
echo "Skipping stability indicator generation (no ICU)"; \
770+
else \
771+
$(call available-node, tools/doc/stability.mjs) \
772+
fi
755773

756774
.PHONY: docopen
757775
docopen: out/doc/api/all.html

0 commit comments

Comments
 (0)
Please sign in to comment.