diff options
| author | ruki <[email protected]> | 2017-09-05 15:15:51 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-09-05 15:15:51 +0800 |
| commit | 3df59e7a2ed5c0c5cf6951695434a33784179567 (patch) | |
| tree | 65096ff735a417728c5103a63e95e44156aca84b | |
| parent | 139980737053985860b0e7127f8ac7f18736b624 (diff) | |
fix link shared target bug with rpath
| -rw-r--r-- | xmake/actions/build/kinds/shared.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/xmake/actions/build/kinds/shared.lua b/xmake/actions/build/kinds/shared.lua index e7281da75..549afd9a4 100644 --- a/xmake/actions/build/kinds/shared.lua +++ b/xmake/actions/build/kinds/shared.lua @@ -29,7 +29,7 @@ import("core.tool.compiler") import("object") -- is modified? -function _is_modified(target, depfile, buildinfo, linker_instance) +function _is_modified(target, depfile, buildinfo, program, linkflags) -- this target and it's deps are not modified? local modified = buildinfo.rebuild or buildinfo.modified[target:name()] diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 5ee0cf38c..16a8bc9b2 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -280,11 +280,11 @@ end function linkargv(self, objectfiles, targetkind, targetfile, flags) -- add rpath for dylib (macho), .e.g -install_name @rpath/file.dylib + local flags_rpath = nil if targetkind == "shared" and targetfile:endswith(".dylib") then - table.insert(flags, "-install_name") - table.insert(flags, "@rpath/" .. path.filename(targetfile)) + flags_rpath = {"-install_name", "@rpath/" .. path.filename(targetfile)} end - return self:program(), table.join("-o", targetfile, objectfiles, flags) + return self:program(), table.join("-o", targetfile, objectfiles, flags, flags_rpath) end -- link the target file |
