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
path: root/src/tools
diff options
context:
space:
mode:
authorJason Perkins <starkos@industriousone.com>2011-04-11 22:33:49 +0400
committerJason Perkins <starkos@industriousone.com>2011-04-11 22:33:49 +0400
commite650d20fc6b8ef0911b77b70498900c2149d10bf (patch)
tree4b49c4466ecabfeaf2929e6b5934f57e7bbfbf5b /src/tools
parentc0fa50f0a8cc256140b03f5ddad05a90f9fa2abb (diff)
parentb5fb32446ca74fdef8b119a7235da821ca3adab8 (diff)
Merged changes from stable
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/gcc.lua20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/tools/gcc.lua b/src/tools/gcc.lua
index 7adb9a0..c55fcb0 100644
--- a/src/tools/gcc.lua
+++ b/src/tools/gcc.lua
@@ -184,7 +184,25 @@
function premake.gcc.getlinkflags(cfg)
local result = { }
- for _, value in ipairs(premake.getlinks(cfg, "all", "basename")) do
+
+ for _, value in ipairs(premake.getlinks(cfg, "siblings", "object")) do
+ if (value.kind == "StaticLib") then
+ -- don't use "-lname" when linking static libraries
+ -- instead use path/Name.ext so as not to link with a SharedLib of the same name
+ -- if one is present.
+ local pathstyle = premake.getpathstyle(value)
+ local namestyle = premake.getnamestyle(value)
+ local linktarget = premake.gettarget(value, "link", pathstyle, namestyle, cfg.system)
+ table.insert(result, linktarget.fullpath)
+ else
+ --premake does not support creating frameworks so this is just a SharedLib link
+ --link using -lname
+ table.insert(result, '-l' .. _MAKE.esc(value.linktarget.basename))
+ end
+ end
+
+ -- "-llib" is fine for system dependencies
+ for _, value in ipairs(premake.getlinks(cfg, "system", "basename")) do
if path.getextension(value) == ".framework" then
table.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value)))
else