Document how to create standalone executables

This commit is contained in:
Saúl Ibarra Corretgé 2024-11-13 22:55:40 +01:00
parent 559029baad
commit a365f18c98

View file

@ -75,3 +75,22 @@ options are:
-s strip the source code, specify twice to also strip debug info -s strip the source code, specify twice to also strip debug info
-S n set the maximum stack size to 'n' bytes (default=262144) -S n set the maximum stack size to 'n' bytes (default=262144)
``` ```
Here is an example on how to create a standalone executable that embeds QuickJS
and the `examples/hello.js` JavaScript file:
```bash
# Make sure you are in the QuickJS source directory.
$ cc hello.c cutils.c libbf.c libregexp.c libunicode.c quickjs.c quickjs-libc.c -I. -o hello
```
The resulting binary `hello` will be in the current directory.
```bash
$ ./hello
Hello World
```
:::note
We have plans to make this process easier, stay tuned!
:::