2020-09-21 14:28:51 +03:00
|
|
|
PRECOMPILE_HEADERS ?= 0
|
2019-11-06 17:54:18 +02: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 17:50:07 +03:00
|
|
|
$(trace-gen) $(CXX) -c -x c++-header -o $@ $< $(GLOBAL_CXXFLAGS) $(GCH_CXXFLAGS)
|
2019-11-06 17:54:18 +02:00
|
|
|
|
2020-10-06 14:27:09 +03:00
|
|
|
clean-files += $(GCH)
|
2019-11-06 17:54:18 +02:00
|
|
|
|
|
|
|
ifeq ($(PRECOMPILE_HEADERS), 1)
|
|
|
|
|
2020-10-06 14:27:09 +03:00
|
|
|
GLOBAL_CXXFLAGS_PCH += -include $(buildprefix)precompiled-headers.h -Winvalid-pch
|
2019-11-06 17:54:18 +02:00
|
|
|
|
2020-10-06 14:27:09 +03:00
|
|
|
GLOBAL_ORDER_AFTER += $(GCH)
|
2019-11-06 17:54:18 +02:00
|
|
|
|
|
|
|
endif
|