diff options
| author | ruki <[email protected]> | 2021-09-02 23:47:31 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-09-02 23:47:31 +0800 |
| commit | ef248c45a806beb1347f3080cb521c4141da4682 (patch) | |
| tree | ed80c83b0b5864f2f69a5c4ffc2c7a846270b0bf | |
| parent | 13acaccc305ef18631601d1d23bfae1c9faef490 (diff) | |
improve rpath for fpc
| -rw-r--r-- | tests/projects/pascal/shared/src/foo.pas | 2 | ||||
| -rw-r--r-- | tests/projects/pascal/shared/src/main.pas | 2 | ||||
| -rw-r--r-- | xmake/modules/core/tools/fpc.lua | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/tests/projects/pascal/shared/src/foo.pas b/tests/projects/pascal/shared/src/foo.pas index 2d12d39f5..d1952cf21 100644 --- a/tests/projects/pascal/shared/src/foo.pas +++ b/tests/projects/pascal/shared/src/foo.pas @@ -1,4 +1,4 @@ -library subs; +library foo; function SubStr(CString: PChar;FromPos,ToPos: Longint): PChar; cdecl; diff --git a/tests/projects/pascal/shared/src/main.pas b/tests/projects/pascal/shared/src/main.pas index 9ee983a12..ccf2e179b 100644 --- a/tests/projects/pascal/shared/src/main.pas +++ b/tests/projects/pascal/shared/src/main.pas @@ -1,7 +1,7 @@ uses strings; function SubStr(const CString: PChar; FromPos, ToPos: longint): PChar; - cdecl; external 'subs'; + cdecl; external 'foo'; var s: PChar; diff --git a/xmake/modules/core/tools/fpc.lua b/xmake/modules/core/tools/fpc.lua index 0f2d3025f..de5b349c6 100644 --- a/xmake/modules/core/tools/fpc.lua +++ b/xmake/modules/core/tools/fpc.lua @@ -76,8 +76,8 @@ end -- make the rpathdir flag function nf_rpathdir(self, dir) dir = path.translate(dir) - if self:has_flags("-k,-rpath=" .. dir, "ldflags") then - return {"-k,-rpath=" .. (dir:gsub("@[%w_]+", function (name) + if self:has_flags("-k-rpath=" .. dir, "ldflags") then + return {"-k-rpath=" .. (dir:gsub("@[%w_]+", function (name) local maps = {["@loader_path"] = "$ORIGIN", ["@executable_path"] = "$ORIGIN"} return maps[name] end))} |
