aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--local.mk2
-rw-r--r--mk/precompiled-headers.mk27
3 files changed, 4 insertions, 26 deletions
diff --git a/.gitignore b/.gitignore
index 4711fa7fa..b087cd8d5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,7 +5,6 @@ perl/Makefile.config
/aclocal.m4
/autom4te.cache
/precompiled-headers.h.gch
-/precompiled-headers.h.pch
/config.*
/configure
/stamp-h1
diff --git a/local.mk b/local.mk
index b1ca832a6..fe314b902 100644
--- a/local.mk
+++ b/local.mk
@@ -11,6 +11,6 @@ GLOBAL_CXXFLAGS += -Wno-deprecated-declarations
$(foreach i, config.h $(wildcard src/lib*/*.hh), \
$(eval $(call install-file-in, $(i), $(includedir)/nix, 0644)))
-$(GCH) $(PCH): src/libutil/util.hh config.h
+$(GCH): src/libutil/util.hh config.h
GCH_CXXFLAGS = -I src/libutil
diff --git a/mk/precompiled-headers.mk b/mk/precompiled-headers.mk
index bfee35a2c..cdd3daecd 100644
--- a/mk/precompiled-headers.mk
+++ b/mk/precompiled-headers.mk
@@ -10,33 +10,12 @@ $(GCH): precompiled-headers.h
@mkdir -p "$(dir $@)"
$(trace-gen) $(CXX) -x c++-header -o $@ $< $(GLOBAL_CXXFLAGS) $(GCH_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) $(GCH_CXXFLAGS)
-
-clean-files += $(GCH) $(PCH)
+clean-files += $(GCH)
ifeq ($(PRECOMPILE_HEADERS), 1)
- ifeq ($(findstring clang++,$(CXX)), clang++)
-
- GLOBAL_CXXFLAGS_PCH += -include-pch $(PCH) -Winvalid-pch
-
- GLOBAL_ORDER_AFTER += $(PCH)
-
- else ifeq ($(findstring g++,$(CXX)), g++)
-
- GLOBAL_CXXFLAGS_PCH += -include $(buildprefix)precompiled-headers.h -Winvalid-pch
-
- GLOBAL_ORDER_AFTER += $(GCH)
-
- else
-
- $(error Don't know how to precompile headers on $(CXX))
+ GLOBAL_CXXFLAGS_PCH += -include $(buildprefix)precompiled-headers.h -Winvalid-pch
- endif
+ GLOBAL_ORDER_AFTER += $(GCH)
endif