Skip to content

Commit

Permalink
Merge pull request #922 from Blizzard/gmake2-pch-fix
Browse files Browse the repository at this point in the history
gmake2 bug fix.  When generating gmake file with pch headers
  • Loading branch information
tvandijck authored Oct 16, 2017
2 parents 3708b49 + 9be9113 commit 0ee416a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion modules/gmake2/gmake2_cpp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,11 @@
local cmd = iif(p.languages.isc(cfg.language), "$(CC) -x c-header $(ALL_CFLAGS)", "$(CXX) -x c++-header $(ALL_CXXFLAGS)")
_p('\t$(SILENT) %s -o "$@" -MF "$(@:%%.gch=%%.d)" -c "$<"', cmd)
_p('$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR)')
_p('\t$(SILENT) touch "$@"')
_p('\tifeq (posix,$(SHELLTYPE))')
_p('\t\t$(SILENT) touch "$@"')
_p('\telse')
_p('\t\t$(SILENT) echo $null >> "$@"')
_p('\tendif')
_p('else')
_p('$(OBJECTS): | $(OBJDIR)')
_p('endif')
Expand Down
12 changes: 10 additions & 2 deletions modules/gmake2/tests/test_gmake2_pch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ $(GCH): $(PCH) | $(OBJDIR)
@echo $(notdir $<)
$(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<"
$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR)
$(SILENT) touch "$@"
ifeq (posix,$(SHELLTYPE))
$(SILENT) touch "$@"
else
$(SILENT) echo $null >> "$@"
endif
else
$(OBJECTS): | $(OBJDIR)
endif
Expand All @@ -125,7 +129,11 @@ $(GCH): $(PCH) | $(OBJDIR)
@echo $(notdir $<)
$(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<"
$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR)
$(SILENT) touch "$@"
ifeq (posix,$(SHELLTYPE))
$(SILENT) touch "$@"
else
$(SILENT) echo $null >> "$@"
endif
else
$(OBJECTS): | $(OBJDIR)
endif
Expand Down

0 comments on commit 0ee416a

Please sign in to comment.