diff options
| author | lebao3105 <[email protected]> | 2026-01-18 17:30:10 +0700 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-01-23 23:16:32 +0800 |
| commit | 18ffb736a64aa3cd79310da253f9277d8b8ca279 (patch) | |
| tree | 50ae94d0c1ecb08a78e0f7e58c840617ad11aea0 | |
| parent | ba8452539e6a85d5e8cd1aaa9310a0fb5ba77c02 (diff) | |
feat: Add exceptions & objectdirs nameflags
| -rw-r--r-- | xmake/languages/pascal/load.lua | 9 | ||||
| -rw-r--r-- | xmake/languages/pascal/xmake.lua | 74 | ||||
| -rw-r--r-- | xmake/modules/core/tools/fpc.lua | 14 |
3 files changed, 67 insertions, 30 deletions
diff --git a/xmake/languages/pascal/load.lua b/xmake/languages/pascal/load.lua index a1cd1f6d0..e23e7696a 100644 --- a/xmake/languages/pascal/load.lua +++ b/xmake/languages/pascal/load.lua @@ -75,13 +75,20 @@ function _get_apis() , "toolchain.set_languages" -- target.set_xxx , "target.set_languages" + , "target.set_objectdirs" + , "target.set_exceptions" -- option.set_xxx , "option.set_languages" + , "option.set_objectdirs" + , "option.set_exceptions" -- package.set_xxx , "package.set_languages" + , "package.set_objectdirs" + , "package.set_exceptions" -- toolchain.set_xxx , "toolchain.set_languages" - + , "toolchain.set_objectdirs" + , "toolchain.set_exceptions" } apis.paths = { -- target.add_xxx diff --git a/xmake/languages/pascal/xmake.lua b/xmake/languages/pascal/xmake.lua index deb0231dd..75806b56b 100644 --- a/xmake/languages/pascal/xmake.lua +++ b/xmake/languages/pascal/xmake.lua @@ -34,66 +34,86 @@ language("pascal") object = { "config.includedirs" , "config.unitdirs" + , "target.linkdirs" + , "target.rpathdirs" + , "target.strip" , "target.symbols" , "target.warnings" , "target.defines" , "target.undefines" , "target.includedirs" , "target.unitdirs" - , "target.languagemode" + , "target.objectdirs" + , "target.exceptions" + , "target.languages" , "target.optimize:check" , "target.vectorexts:check" , "toolchain.includedirs" , "toolchain.unitdirs" - , "toolchain.languagemode" + , "toolchain.languages" , "toolchain.defines" , "toolchain.undefines" + , "toolchain.objectdirs" + , "toolchain.exceptions" + , "toolchain.linkdirs" + , "toolchain.rpathdirs" + , "toolchain.strip" } , binary = { - "config.linkdirs" - , "config.includedirs" + "config.includedirs" , "config.unitdirs" - , "config.defines" - , "config.undefines" , "target.linkdirs" , "target.rpathdirs" , "target.strip" , "target.symbols" + , "target.warnings" , "target.defines" , "target.undefines" , "target.includedirs" , "target.unitdirs" - , "target.languagemode" - , "toolchain.linkdirs" - , "toolchain.rpathdirs" - , "config.links" - , "target.links" - , "target.frameworks" - , "target.frameworkdirs" - , "toolchain.links" - , "config.syslinks" - , "target.syslinks" - , "toolchain.syslinks" + , "target.objectdirs" + , "target.exceptions" + , "target.languages" + , "target.optimize:check" + , "target.vectorexts:check" , "toolchain.includedirs" , "toolchain.unitdirs" - , "toolchain.languagemode" + , "toolchain.languages" , "toolchain.defines" , "toolchain.undefines" + , "toolchain.objectdirs" + , "toolchain.exceptions" + , "toolchain.linkdirs" + , "toolchain.rpathdirs" + , "toolchain.strip" } , shared = { - "config.linkdirs" + "config.includedirs" + , "config.unitdirs" , "target.linkdirs" + , "target.rpathdirs" , "target.strip" , "target.symbols" + , "target.warnings" + , "target.defines" + , "target.undefines" + , "target.includedirs" + , "target.unitdirs" + , "target.objectdirs" + , "target.exceptions" + , "target.languages" + , "target.optimize:check" + , "target.vectorexts:check" + , "toolchain.includedirs" + , "toolchain.unitdirs" + , "toolchain.languages" + , "toolchain.defines" + , "toolchain.undefines" + , "toolchain.objectdirs" + , "toolchain.exceptions" , "toolchain.linkdirs" - , "config.links" - , "target.links" - , "target.frameworks" - , "target.frameworkdirs" - , "toolchain.links" - , "config.syslinks" - , "target.syslinks" - , "toolchain.syslinks" + , "toolchain.rpathdirs" + , "toolchain.strip" } } diff --git a/xmake/modules/core/tools/fpc.lua b/xmake/modules/core/tools/fpc.lua index 49be3156d..79cc4d62a 100644 --- a/xmake/modules/core/tools/fpc.lua +++ b/xmake/modules/core/tools/fpc.lua @@ -104,7 +104,7 @@ end -- make the includedir flag function nf_includedir(self, includedir) - return {"-FI" .. path.translate(includedir)} + return {"-Fi" .. path.translate(includedir)} end -- make the unitdir flag @@ -134,7 +134,17 @@ function nf_language(self, language) extendedpascal = "-Mextendedpascal", delphiunicode = "-Mdelphiunicode", } - return mode[language] + return mode[language:lower()] +end + +-- make the exception flag +function nf_exception(self, exp) + return {exp:startswith("no-") 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 |
