Skip to content

Commit 3cd5e88

Browse files
committed
Add Delphi Pascal binding (using FPC)
1 parent dedf4b5 commit 3cd5e88

15 files changed

Lines changed: 1060 additions & 0 deletions

File tree

.version.ys

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ vo =: v-old.str/replace(/\./ '\\.')
2323
- Meta
2424
- fortran/fpm.toml
2525
- csharp/YAMLStar.csproj
26+
- delphi/src/yamlstar.pas
2627
- go/yamlstar.go
2728
- nodejs/lib/yamlstar/index.js
2829
- perl/lib/YAMLStar.pm
@@ -38,6 +39,7 @@ vo =: v-old.str/replace(/\./ '\\.')
3839
- java/Makefile
3940
- clojure/ReadMe.md
4041
- example/clojure/ReadMe.md
42+
- example/delphi/ReadMe.md
4143
- example/java/ReadMe.md
4244
- example/go/ReadMe.md
4345
- example/python/ReadMe.md

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ MAKES-DISTCLEAN += \
2525
BINDING-LANGS := \
2626
clojure \
2727
csharp \
28+
delphi \
2829
fortran \
2930
go \
3031
java \

delphi/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.o
2+
*.ppu
3+
test/test_yamlstar

delphi/License

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../License

delphi/Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
include ../common/init.mk
2+
include $(COMMON)/common.mk
3+
include $(COMMON)/binding.mk
4+
5+
MAKES-CLEAN := \
6+
*.o \
7+
*.ppu \
8+
src/*.o \
9+
src/*.ppu \
10+
test/*.o \
11+
test/*.ppu \
12+
test/test_yamlstar \
13+
14+
DEPS := \
15+
$(LIBYAMLSTAR-SO) \
16+
17+
FPC := $(shell command -v fpc 2>/dev/null)
18+
19+
test: $(DEPS)
20+
@if [ -z "$(FPC)" ]; then \
21+
echo "Error: Free Pascal Compiler (fpc) not found."; \
22+
echo "Please install FPC: https://www.freepascal.org/"; \
23+
exit 1; \
24+
fi
25+
fpc -Fusrc -Fl$(LIBYS)/lib -otest/test_yamlstar test/test_yamlstar.pas
26+
LD_LIBRARY_PATH=$(LIBYS)/lib test/test_yamlstar
27+
28+
build: $(DEPS)
29+
@if [ -z "$(FPC)" ]; then \
30+
echo "Error: Free Pascal Compiler (fpc) not found."; \
31+
echo "Please install FPC: https://www.freepascal.org/"; \
32+
exit 1; \
33+
fi
34+
fpc -Fusrc -Fl$(LIBYS)/lib src/yamlstar.pas
35+
36+
# Delphi/FPC has no standard package registry.
37+
# The binding is distributed via GitHub releases alongside the shared library.
38+
release::
39+
../util/release-delphi

0 commit comments

Comments
 (0)