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:
authorJason Perkins <starkos@industriousone.com>2013-08-08 22:13:20 +0400
committerJason Perkins <starkos@industriousone.com>2013-08-08 22:13:20 +0400
commitdb24115c65633e5d34fd89b7093ba18336c00072 (patch)
treeae46d59e64333eb300b62f0b5ad00c58eb7164cc
parentfc3d38a1670e9f549a1b60d8290a906b2b2b388e (diff)
Swapped $(LIBS) and $(ALL_LDFLAGS) in makefile linking step (Ben Henning)
See http://sourceforge.net/p/premake/bugs/279/
-rw-r--r--src/actions/make/make_cpp.lua12
-rw-r--r--tests/test_gmake_cpp.lua6
2 files changed, 11 insertions, 7 deletions
diff --git a/src/actions/make/make_cpp.lua b/src/actions/make/make_cpp.lua
index 0efd321..479e36d 100644
--- a/src/actions/make/make_cpp.lua
+++ b/src/actions/make/make_cpp.lua
@@ -267,11 +267,15 @@
_p(' LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)')
end
else
+
-- this was $(TARGET) $(LDFLAGS) $(OBJECTS)
- -- but had trouble linking to certain static libs so $(OBJECTS) moved up
- -- then $(LDFLAGS) moved to end
- -- https://sourceforge.net/tracker/?func=detail&aid=3430158&group_id=71616&atid=531880
- _p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(ALL_LDFLAGS)', iif(cfg.language == "C", "CC", "CXX"))
+ -- 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/)
+
+ local tool = iif(cfg.language == "C", "CC", "CXX")
+ _p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)
+
end
end
diff --git a/tests/test_gmake_cpp.lua b/tests/test_gmake_cpp.lua
index 2844567..dde8033 100644
--- a/tests/test_gmake_cpp.lua
+++ b/tests/test_gmake_cpp.lua
@@ -85,7 +85,7 @@ ifeq ($(config),debug)
ALL_LDFLAGS += $(LDFLAGS) -s
LDDEPS +=
LIBS += $(LDDEPS)
- LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(ALL_LDFLAGS)
+ LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
@@ -119,7 +119,7 @@ ifeq ($(config),debugps3)
ALL_LDFLAGS += $(LDFLAGS) -s
LDDEPS +=
LIBS += $(LDDEPS)
- LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(ALL_LDFLAGS)
+ LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
@@ -150,7 +150,7 @@ ifeq ($(config),debug64)
ALL_LDFLAGS += $(LDFLAGS) -s -m64 -L/usr/lib64
LDDEPS +=
LIBS += $(LDDEPS)
- LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(ALL_LDFLAGS)
+ LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS