From 9167ce10a2587cd2606c92ecad77633a7529e59a Mon Sep 17 00:00:00 2001 From: J Reece Wilson Date: Fri, 23 Feb 2024 11:32:13 +0000 Subject: [PATCH] linux regression --- modules/gmake2/gmake2_cpp.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/gmake2/gmake2_cpp.lua b/modules/gmake2/gmake2_cpp.lua index 9d37f6b6..b30377ce 100644 --- a/modules/gmake2/gmake2_cpp.lua +++ b/modules/gmake2/gmake2_cpp.lua @@ -454,8 +454,12 @@ -- but had trouble linking to certain static libs; $(OBJECTS) moved up -- $(LDFLAGS) moved to end (http://sourceforge.net/p/premake/patches/107/) -- $(LIBS) moved to end (http://sourceforge.net/p/premake/bugs/279/) - - p.outln('LINKCMD = -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)') + if (os.host() == "windows") then + p.outln('LINKCMD = -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)') + else + local cc = iif(p.languages.isc(cfg.language), "CC", "CXX") + p.outln('LINKCMD = $(' .. cc .. ') -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)') + end end end @@ -666,8 +670,12 @@ _p('$(TARGET): %s | $(TARGETDIR)', targets) _p('\t$(PRELINKCMDS)') _p('\t@echo Linking %s', cfg.project.name) - _p('\t$(file > $(OBJDIR)/linkcmds.cli, $(LINKCMD))') - _p('\t$(' .. cc .. ') @$(OBJDIR)/linkcmds.cli') + if (os.host() == "windows") then + _p('\t$(file > $(OBJDIR)/linkcmds.cli, $(LINKCMD))') + _p('\t$(' .. cc .. ') @$(OBJDIR)/linkcmds.cli') + else + _p('\t$(SILENT) $(LINKCMD)') + end _p('\t$(POSTBUILDCMDS)') _p('') end