summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/fpc.lua
diff options
context:
space:
mode:
authorlebao3105 <[email protected]>2026-01-13 23:13:02 +0700
committerruki <[email protected]>2026-01-23 23:16:31 +0800
commitf73e850fdce6d46aa05cab820060fa0c0f48f9d8 (patch)
tree3843020e19f4b240b5d6ee7691c2548df2b0920f /xmake/modules/core/tools/fpc.lua
parent865ed17e98b3fa230b342138e3aaa6e9e5093cda (diff)
Improved Free Pascal Compiler support
Diffstat (limited to 'xmake/modules/core/tools/fpc.lua')
-rw-r--r--xmake/modules/core/tools/fpc.lua36
1 files changed, 35 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/fpc.lua b/xmake/modules/core/tools/fpc.lua
index 18298cd6c..15216ce96 100644
--- a/xmake/modules/core/tools/fpc.lua
+++ b/xmake/modules/core/tools/fpc.lua
@@ -102,6 +102,41 @@ function nf_frameworkdir(self, frameworkdir)
return {"-k-F", path.translate(frameworkdir)}
end
+-- make the includedir flag
+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}
+end
+
+-- make the undefine flag
+function nf_undefine(self, macro)
+ return {"-u" .. macro}
+end
+
+-- make the language flag
+function nf_languagemode(self, language)
+ local table = {
+ pascal = "-Mfpc",
+ fpc = "-Mfpc",
+ objfpc = "-Mobjfpc",
+ delphi = "-Mdelphi",
+ macpas = "-Mmacpas",
+ isopas = "-Miso",
+ extendedpascal = "-Mextendedpascal",
+ delphiunicode = "-Mdelphiunicode",
+ }
+ return table[language]
+end
+
-- make the build arguments list
function buildargv(self, sourcefiles, targetkind, targetfile, flags)
return self:program(), table.join(flags, "-o" .. targetfile, sourcefiles)
@@ -112,4 +147,3 @@ function build(self, sourcefiles, targetkind, targetfile, flags)
os.mkdir(path.directory(targetfile))
os.runv(buildargv(self, sourcefiles, targetkind, targetfile, flags))
end
-