diff --git a/CHANGES.txt b/CHANGES.txt index 095c66e9..c3ab9d30 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -24,7 +24,7 @@ * Bug 3294459: vs10 x86_64 using incorrect debug format for minimal rebuild (learner) * Bug 3297634: Special characters in directory name Xcode3 (jdale) * Feature 3100194: English alais' for Optimize flags - +* 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 c55fcb04..caedd525 100644 --- a/src/tools/gcc.lua +++ b/src/tools/gcc.lua @@ -193,7 +193,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 21f454eb..7a346e6e 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 +