summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/fpc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-01-24 00:55:36 +0800
committerruki <[email protected]>2026-01-24 00:55:36 +0800
commitdf870ffd7cf1b7c4cb5df311f437ffef03678178 (patch)
tree9d9c3850454f431321866fad080d6c01658ecd3e /xmake/modules/core/tools/fpc.lua
parent0e9aa3375f073fd9987867574854f0445d6a3971 (diff)
improve fpc
Diffstat (limited to 'xmake/modules/core/tools/fpc.lua')
-rw-r--r--xmake/modules/core/tools/fpc.lua20
1 files changed, 8 insertions, 12 deletions
diff --git a/xmake/modules/core/tools/fpc.lua b/xmake/modules/core/tools/fpc.lua
index b6d7e80c2..f207061dc 100644
--- a/xmake/modules/core/tools/fpc.lua
+++ b/xmake/modules/core/tools/fpc.lua
@@ -107,11 +107,6 @@ function nf_includedir(self, includedir)
return {"-Fi" .. path.translate(includedir)}
end
--- make the unitdir flag
-function nf_unitdir(self, unitdir)
- return {"-Fu" .. path.translate(unitdir)}
-end
-
-- make the define flag
function nf_define(self, macro)
return {"-d" .. macro}
@@ -144,14 +139,15 @@ function nf_exception(self, exp)
return {exp == "off" and "-Sx-" or "-Sx"}
end
--- make the objectdir flag
-function nf_objectdir(self, objectdir)
- return {"-FU" .. path.translate(objectdir)}
-end
-
-- make the build arguments list
-function buildargv(self, sourcefiles, targetkind, targetfile, flags)
- return self:program(), table.join(flags, "-o" .. targetfile, sourcefiles)
+function buildargv(self, sourcefiles, targetkind, targetfile, flags, opt)
+ opt = opt or {}
+ local extraflags = {}
+ local objectdir = opt.target and opt.target:objectdir()
+ if objectdir then
+ table.insert(extraflags, "-FU" .. path.translate(objectdir))
+ end
+ return self:program(), table.join(flags, extraflags, "-o" .. targetfile, sourcefiles)
end
-- build the target file