diff options
Diffstat (limited to '3rdparty/genie/src/actions/make/make_cpp.lua')
-rw-r--r-- | 3rdparty/genie/src/actions/make/make_cpp.lua | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/3rdparty/genie/src/actions/make/make_cpp.lua b/3rdparty/genie/src/actions/make/make_cpp.lua index 53ba7b487bc..fbb6ff02135 100644 --- a/3rdparty/genie/src/actions/make/make_cpp.lua +++ b/3rdparty/genie/src/actions/make/make_cpp.lua @@ -3,7 +3,7 @@ -- Generate a C/C++ project makefile. -- Copyright (c) 2002-2013 Jason Perkins and the Premake project -- - premake.make.linkoptions_after = false + premake.make.cpp = { } premake.make.override = { } local cpp = premake.make.cpp @@ -34,13 +34,13 @@ objdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1 end end - + for _, custombuildtask in ipairs(prj.custombuildtask or {}) do for _, buildtask in ipairs(custombuildtask or {}) do additionalobjdirs[_MAKE.esc(path.getdirectory(path.getrelative(prj.location,buildtask[2])))] = 1 end end - + _p('OBJDIRS := \\') _p('\t$(OBJDIR) \\') for dir, _ in pairs(objdirs) do @@ -162,7 +162,7 @@ -- per-file build rules cpp.fileRules(prj) - + -- per-dependency build rules cpp.dependencyRules(prj) @@ -185,14 +185,14 @@ end cmd = string.gsub(cmd, "%$%(<%)", "$<") cmd = string.gsub(cmd, "%$%(@%)", "$@") - + _p('\t$(SILENT) %s',cmd) - + end _p('') end end - + -- include the dependencies, built by GCC (with the -MMD flag) _p('-include $(OBJECTS:%%.o=%%.d)') _p('ifneq (,$(PCH))') @@ -411,11 +411,7 @@ -- $(LIBS) moved to end (http://sourceforge.net/p/premake/bugs/279/) local tool = iif(cfg.language == "C", "CC", "CXX") - if (premake.make.linkoptions_after) then - _p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(ALL_LDFLAGS)', tool) - else - _p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool) - end + _p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool) end end @@ -503,7 +499,7 @@ _p('\t$(SILENT) %s', task) _p('') end - + _p('') elseif (path.getextension(file) == ".rc") then _p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file)) @@ -517,7 +513,7 @@ end end end - + function cpp.dependencyRules(prj) for _, dependency in ipairs(prj.dependency or {}) do for _, dep in ipairs(dependency or {}) do @@ -536,7 +532,7 @@ end end end - + function cpp.buildcommand(iscfile, objext) local flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)') |