Skip to content

Commit

Permalink
Fix precompiled-headers generation
Browse files Browse the repository at this point in the history
It's now regenerated when util.hh changes, and is ordered after
config.h to fix a race.
  • Loading branch information
edolstra committed Dec 5, 2019
1 parent 5e449b4 commit 50d483a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions mk/precompiled-headers.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 50d483a

Please sign in to comment.