xmake-pascal
/xmake-pascal
Use when building Pascal projects with xmake — `.pas`/`.pp`/`.lpr` sources, FreePascal (`fpc`) / Delphi toolchain, binary and shared-library targets.
- Author
- xmake-io ↗
- Repository
- xmake-skills ↗
- Licence
- Apache-2.0
- Last repository change
- 24.08.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 24.08.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
Use when building Pascal projects with xmake — `.pas`/`.pp`/`.lpr` sources, FreePascal (`fpc`) / Delphi toolchain, binary and shared-library targets.
Original author description
Use when building Pascal projects with xmake — `.pas`/`.pp`/`.lpr` sources, FreePascal (`fpc`) / Delphi toolchain, binary and shared-library targets.
How it works
- 1. Minimal project
- 2. Target kinds
- 3. Flags
- 4. Toolchain
- Pitfalls
- When to branch out
SKILL.md preview
---
name: xmake-pascal
description: Use when building Pascal projects with xmake — `.pas`/`.pp`/`.lpr` sources, FreePascal (`fpc`) / Delphi toolchain, binary and shared-library targets.
---
# Building Pascal with Xmake
Xmake supports Pascal (via FreePascal `fpc`) since v2.5.8.
## 1. Minimal project
```lua
add_rules("mode.debug", "mode.release")
target("hello")
set_kind("binary")
add_files("src/main.pas")
```
Recognized extensions: `.pas`, `.pp`, `.lpr`.
## 2. Target kinds
```lua
target("app") set_kind("binary")
target("mylib") set_kind("shared") -- .so / .dll
target("staticlib") set_kind("static") -- .a / .lib
```
Shared library example:
```lua
target("mylib")
set_kind("shared")
add_files("src/lib.pas")
```
## 3. Flags
```lua
target("app")
add_files("src/*.pas")
add_pcflags("-O3", "-Xs") -- fpc flags (strip symbols)
```
## 4. Toolchain
```bash
xmake f --toolchain=fpc # FreePascal
xmake f --toolchain=fpc --sdk=/opt/fpc-3.2
```
## Pitfalls
- **Project file format.** `.lpr` is the standard program entry for Lazarus projects — use it as the `add_files` entry, not unit files.
- **Unit dependency ordering.** `fpc` handles unit deps itself; don't enumerate dependencies manually unless you have a reason.
- **Cross-compile.** FreePascal supports many targets but the config is fpc-specific; see FreePascal docs for `-T<target>` / `-P<arch>`.
## When to branch out
- Target basics → `xmake-targets`
- Cross-compile → `xmake-cross-compilation`
Versions
The database has no other skills named xmake-pascal.
Database snapshot: 13.11.2026 · package version 9e4eaeb68181 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 98delphi-xe7
Use when writing, reviewing or fixing Delphi / Object Pascal code that must compile with Delphi XE7 (CompilerVersion 28.0) — any .pas, .dpr or .dfm in a VCL desktop application. Covers what XE7 can and cannot compile, memory and lifetime, strings and binary data, exceptions,… - 100xmake-nim
Use when building Nim projects with xmake — binary/library targets with `.nim` sources, choosing the C backend (the default) vs C++, and mixing Nim with C. - 100xmake-go
Use when building Go projects with xmake — binary/library targets with `.go` sources, go module integration, cross-compiling Go programs for other OS/arch, and mixing Go with C via cgo. - 90delphi
Delphi开发专家助手。当用户需要进行Delphi桌面应用开发、Object Pascal编程、VCL/FMX框架、数据库应用或Windows应用开发时调用。 - 100delphi
Expert Delphi / Object Pascal assistance covering VCL, FireMonkey, RTL, and enterprise desktop software. Use when maintaining or modernizing Windows desktop and cross-platform native applications. - 100delphi-build
Use when configuring Delphi builds: dcc32/dcc64 flags, .dproj search paths, MSBuild targets, conditional defines. Do NOT use for FPC/Lazarus (use fpc-build) or runtime config (use mormot2-deploy).