aboutsummaryrefslogtreecommitdiff
path: root/docs/platform_overrides.md
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2025-01-05 21:40:39 -0300
committerHisham Muhammad <hisham@gobolinux.org>2025-01-05 21:40:39 -0300
commitf5c5db5a7378d97a6f261ffaa10c84e2005bfc4e (patch)
treec2f0cb86890fb90a85a7f091746543c7ff14ac5e /docs/platform_overrides.md
parent7fe5532c695711d23fd9d7e13a9e6235478171b6 (diff)
downloadluarocks-f5c5db5a7378d97a6f261ffaa10c84e2005bfc4e.tar.gz
luarocks-f5c5db5a7378d97a6f261ffaa10c84e2005bfc4e.tar.bz2
luarocks-f5c5db5a7378d97a6f261ffaa10c84e2005bfc4e.zip
docs: import Wiki docs into the main repo
Diffstat (limited to 'docs/platform_overrides.md')
-rw-r--r--docs/platform_overrides.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/platform_overrides.md b/docs/platform_overrides.md
new file mode 100644
index 00000000..ddda180f
--- /dev/null
+++ b/docs/platform_overrides.md
@@ -0,0 +1,20 @@
1# Platform overrides
2
3To specify platform-specific information in rockspecs, one should use the
4`platforms` field of top-level tables.
5
6In top-level tables, a field `platforms` is treated specially. If present,
7it may contain a table containing sub-tables representing different platforms.
8For example, `build.platforms.unix`, if present, as the name implies, would
9be a table containing specifics for building on Unix systems.
10
11The contents of platform tables override the contents of the top-level table
12where `platforms` is located. For example, in a Linux system, an entry
13`build.platforms.linux.foo` will override `build.foo`. Tables are
14scanned deeply, so if `build.foo` is a table, the contents of
15`build.platforms.linux.foo` will add to or replace the contents of
16`build.foo`, instead of just replacing the entire table. Therefore, you
17don't need to rewrite the entire `build` section in a platform table, only
18the fields should change.
19
20