From 50d483a2c1c77bef1bab742eb8708626a61dc00e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 5 Dec 2019 20:26:24 +0100 Subject: [PATCH] Fix precompiled-headers generation It's now regenerated when util.hh changes, and is ordered after config.h to fix a race. --- local.mk | 2 ++ mk/precompiled-headers.mk | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/local.mk b/local.mk index 921ea91cd..01ca8a295 100644 --- a/local.mk +++ b/local.mk @@ -10,3 +10,5 @@ GLOBAL_CXXFLAGS += -I . -I src -I src/libutil -I src/libstore -I src/libmain -I $(foreach i, config.h $(call rwildcard, src/lib*, *.hh), \ $(eval $(call install-file-in, $(i), $(includedir)/nix, 0644))) + +$(GCH) $(PCH): src/libutil/util.hh config.h diff --git a/mk/precompiled-headers.mk b/mk/precompiled-headers.mk index 779389b26..1a727ba1b 100644 --- a/mk/precompiled-headers.mk +++ b/mk/precompiled-headers.mk @@ -8,14 +8,14 @@ GCH = $(buildprefix)precompiled-headers.h.gch $(GCH): precompiled-headers.h @rm -f $@ @mkdir -p "$(dir $@)" - $(trace-gen) $(CXX) -x c++-header -o $@ $^ $(GLOBAL_CXXFLAGS) + $(trace-gen) $(CXX) -x c++-header -o $@ $< $(GLOBAL_CXXFLAGS) PCH = $(buildprefix)precompiled-headers.h.pch $(PCH): precompiled-headers.h @rm -f $@ @mkdir -p "$(dir $@)" - $(trace-gen) $(CXX) -x c++-header -o $@ $^ $(GLOBAL_CXXFLAGS) + $(trace-gen) $(CXX) -x c++-header -o $@ $< $(GLOBAL_CXXFLAGS) clean-files += $(GCH) $(PCH)