Skip to content
Skills Library
Programming · Building & coding

xmake-pascal

/xmake-pascal

Use when building Pascal projects with xmake — `.pas`/`.pp`/`.lpr` sources, FreePascal (`fpc`) / Delphi toolchain, binary and shared-library targets.

Licence
Apache-2.0
Last repository change
24.08.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 24.08.2026, without references to retired models or APIs.

Licence

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. 1. Minimal project
  2. 2. Target kinds
  3. 3. Flags
  4. 4. Toolchain
  5. Pitfalls
  6. When to branch out
Original SKILL.md headings · 59 lines, 160 words
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).

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.