Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt1
-rw-r--r--src/actions/make/make_cpp.lua4
-rw-r--r--tests/actions/make/test_make_pch.lua8
3 files changed, 13 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 8ce5a0c..2d61fe1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -33,6 +33,7 @@
* Patch 3035550: Make/Distcc outputs dependencies to wrong location
* Patch 3138574: NoImportLib ignored in Windows makefiles dependencies (rjmyst3)
* Patch 3367641: Remove warnings in Xcode 4
+* Patch 3372345: Gmake action's PCHs don't work with Mingw (Martin Ridgers)
-------
diff --git a/src/actions/make/make_cpp.lua b/src/actions/make/make_cpp.lua
index 0e5570a..2a4dc22 100644
--- a/src/actions/make/make_cpp.lua
+++ b/src/actions/make/make_cpp.lua
@@ -280,7 +280,11 @@
_p('ifneq (,$(PCH))')
_p('$(GCH): $(PCH)')
_p('\t@echo $(notdir $<)')
+ _p('ifeq (posix,$(SHELLTYPE))')
_p('\t-$(SILENT) cp $< $(OBJDIR)')
+ _p('else')
+ _p('\t$(SILENT) xcopy /D /Y /Q "$(subst /,\\,$<)" "$(subst /,\\,$(OBJDIR))" 1>nul')
+ _p('endif')
cpp.buildcommand(prj.language == "C")
_p('endif')
_p('')
diff --git a/tests/actions/make/test_make_pch.lua b/tests/actions/make/test_make_pch.lua
index 2315f31..f52bf3e 100644
--- a/tests/actions/make/test_make_pch.lua
+++ b/tests/actions/make/test_make_pch.lua
@@ -68,7 +68,11 @@
ifneq (,$(PCH))
$(GCH): $(PCH)
@echo $(notdir $<)
+ifeq (posix,$(SHELLTYPE))
-$(SILENT) cp $< $(OBJDIR)
+else
+ $(SILENT) xcopy /D /Y /Q "$(subst /,\,$<)" "$(subst /,\,$(OBJDIR))" 1>nul
+endif
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
endif
]]
@@ -83,7 +87,11 @@ endif
ifneq (,$(PCH))
$(GCH): $(PCH)
@echo $(notdir $<)
+ifeq (posix,$(SHELLTYPE))
-$(SILENT) cp $< $(OBJDIR)
+else
+ $(SILENT) xcopy /D /Y /Q "$(subst /,\,$<)" "$(subst /,\,$(OBJDIR))" 1>nul
+endif
$(SILENT) $(CC) $(CFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
endif
]]