diff --git a/src/actions/make/make_cpp.lua b/src/actions/make/make_cpp.lua index 7d58dfd6..3d664bab 100644 --- a/src/actions/make/make_cpp.lua +++ b/src/actions/make/make_cpp.lua @@ -467,13 +467,18 @@ -- add a conditional configuration to the project script. local pch = cfg.pchheader + local found = false for _, incdir in ipairs(cfg.includedirs) do local testname = path.join(incdir, pch) if os.isfile(testname) then pch = project.getrelative(cfg.project, testname) + found = true break end end + if not found then + pch = project.getrelative(cfg.project, path.getabsolute(pch)) + end _x(' PCH = %s', pch) _p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')