From 16acef9777032c8cd2cb3ce52b6dd93e1b966113 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 21 Jul 2017 11:19:39 +0800 Subject: fix gcc rpathdir --- xmake/core/tool/builder.lua | 2 +- xmake/modules/core/tools/gcc.lua | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua index bec875325..b1269f9ef 100644 --- a/xmake/core/tool/builder.lua +++ b/xmake/core/tool/builder.lua @@ -173,7 +173,7 @@ function builder:_addflags_from_targetdeps(results, target, flagname) elseif flagname == "rpathdirs" and targetkind == "binary" then -- add dependent rpathdirs (need absolute path) - table.insert(results, path.directory(path.absolute(dep:targetfile(), xmake._PROJECT_DIR))) + table.insert(results, path.directory(path.absolute(dep:targetfile(), os.projectdir()))) elseif flagname == "includedirs" then diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 7665f827e..8bcf58799 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -233,7 +233,8 @@ end -- make the rpathdir flag function nf_rpathdir(self, dir) - if self:has_flags("-Wl,-rpath=" .. dir) then + local flag = "-Wl,-rpath=" .. dir + if self:has_flags(flag) then return flag end end -- cgit v1.3.1