Skip to content

Commit

Permalink
Fix VALID_CHARSETS test
Browse files Browse the repository at this point in the history
The `VALID_CHARSETS` test assumes it is running in a dev virtual
environment, which is not necessarily true; for example, when running
`make hb-shape` to build HarfBuzz in CI. Now it only checks validity
when `CHARSET` is defined.
  • Loading branch information
dscorbett committed Sep 14, 2024
1 parent 656c756 commit ae6efa5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ INTERMEDIATE_FONTS = $(addprefix $(INTERMEDIATE_PREFIX),$(FONTS))
SUBSET_PREFIX = subset-
HB_PROGRAMS = hb-shape hb-view

VALID_CHARSETS = $(shell PYTHONPATH="sources:$$PYTHONPATH" python3 -c 'import charsets; print(" ".join(charsets.Charset))')
ifneq ($(strip $(filter-out $(VALID_CHARSETS),$(CHARSET))),)
$(error One or more invalid values: $(CHARSET); must be one of: $(VALID_CHARSETS))
ifdef CHARSET
VALID_CHARSETS = $(shell PYTHONPATH="sources:$$PYTHONPATH" python3 -c 'import charsets; print(" ".join(charsets.Charset))')
ifneq ($(strip $(filter-out $(VALID_CHARSETS),$(CHARSET))),)
$(error One or more invalid values: $(CHARSET); must be one of: $(VALID_CHARSETS))
endif
endif

VALID_WEIGHTS = Regular Bold
Expand Down

0 comments on commit ae6efa5

Please sign in to comment.