2020-09-21 11:28:51 +00:00
|
|
|
PRECOMPILE_HEADERS ?= 0
|
2019-11-06 15:54:18 +00:00
|
|
|
|
|
|
|
print-var-help += \
|
|
|
|
echo " PRECOMPILE_HEADERS ($(PRECOMPILE_HEADERS)): Whether to use precompiled headers to speed up the build";
|
|
|
|
|
|
|
|
GCH = $(buildprefix)precompiled-headers.h.gch
|
|
|
|
|
|
|
|
$(GCH): precompiled-headers.h
|
|
|
|
@rm -f $@
|
|
|
|
@mkdir -p "$(dir $@)"
|
2024-06-12 14:50:07 +00:00
|
|
|
$(trace-gen) $(CXX) -c -x c++-header -o $@ $< $(GLOBAL_CXXFLAGS) $(GCH_CXXFLAGS)
|
2019-11-06 15:54:18 +00:00
|
|
|
|
2020-10-06 11:27:09 +00:00
|
|
|
clean-files += $(GCH)
|
2019-11-06 15:54:18 +00:00
|
|
|
|
|
|
|
ifeq ($(PRECOMPILE_HEADERS), 1)
|
|
|
|
|
2020-10-06 11:27:09 +00:00
|
|
|
GLOBAL_CXXFLAGS_PCH += -include $(buildprefix)precompiled-headers.h -Winvalid-pch
|
2019-11-06 15:54:18 +00:00
|
|
|
|
2020-10-06 11:27:09 +00:00
|
|
|
GLOBAL_ORDER_AFTER += $(GCH)
|
2019-11-06 15:54:18 +00:00
|
|
|
|
|
|
|
endif
|