From a365f18c9875acc6ecb7ff774895c0c822bacf08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 13 Nov 2024 22:55:40 +0100 Subject: [PATCH] Document how to create standalone executables --- docs/docs/cli.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/docs/cli.md b/docs/docs/cli.md index 1b895dc..fff81cb 100644 --- a/docs/docs/cli.md +++ b/docs/docs/cli.md @@ -75,3 +75,22 @@ options are: -s strip the source code, specify twice to also strip debug info -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! +:::