diff options
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rw-r--r-- | src/tools/gcc.lua | 3 | ||||
-rw-r--r-- | tests/actions/make/test_make_linking.lua | 16 |
3 files changed, 19 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 73e655b..cfe0bd4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,7 +14,7 @@ * Patch 3043933 Allow gmake to use static lib when shared lib of same name exists (Jonathan Derque) * Bug 3294459: vs10 x86_64 using incorrect debug format for minimal rebuild (learner) * Bug 3297634: Special characters in directory name Xcode3 (jdale) - +* Bug 3308203: Incorrect relative paths for gmake sibling static libraries (Adam) ------- 4.3 ------- diff --git a/src/tools/gcc.lua b/src/tools/gcc.lua index 9713c2e..f9984f9 100644 --- a/src/tools/gcc.lua +++ b/src/tools/gcc.lua @@ -183,7 +183,8 @@ 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) + local rebasedpath = path.rebase(linktarget.fullpath, value.location, cfg.location) + table.insert(result, rebasedpath) else --premake does not support creating frameworks so this is just a SharedLib link --link using -lname diff --git a/tests/actions/make/test_make_linking.lua b/tests/actions/make/test_make_linking.lua index 5404bc1..0869e2d 100644 --- a/tests/actions/make/test_make_linking.lua +++ b/tests/actions/make/test_make_linking.lua @@ -93,4 +93,20 @@ test.string_contains(buffer,format_exspected) end + function T.link_suite.projectLinksToStaticPremakeMadeLibrary_projectDifferInDirectoryHeights_linksUsingCorrectRelativePath() + firstProject = project 'firstProject' + kind 'StaticLib' + language 'C' + + linksToFirstProject = project 'linksToFirstProject' + kind 'ConsoleApp' + language 'C' + links{'firstProject'} + location './foo/bar' + + local buffer = get_buffer(linksToFirstProject) + local format_exspected = 'LIBS %+%= ../../libfirstProject.a' + test.string_contains(buffer,format_exspected) + end + |