OpenRCT2/src/thirdparty/duktape
Michał Janiszewski 8bd9d9c551
Update duktape to v2.7.0 (#18485)
A somewhat bloated change due to duktape changing code style
2022-11-11 09:06:05 +01:00
..
README.md Update duktape to v2.7.0 (#18485) 2022-11-11 09:06:05 +01:00
duk_config.h Embed our own duktape library 2022-01-18 18:29:27 +00:00
duk_source_meta.json Update duktape to v2.7.0 (#18485) 2022-11-11 09:06:05 +01:00
duktape.cpp Update duktape to v2.7.0 (#18485) 2022-11-11 09:06:05 +01:00
duktape.h Update duktape to v2.7.0 (#18485) 2022-11-11 09:06:05 +01:00

README.md

Duktape

Duktape is geared around compile time switches to minimise code size and memory footprint. Because of this, we can not rely on shared libraries, as we have no control on what switches it may have been compiled with. It also can cause inconsistent behaviour of plugins across multiple platforms, depending on what version of Duktape is installed on the system.

#14853 is the primary issue that was solved by embedding our own copy of duktape.

This directory contains a pre-configured copy of duktape v2.7.0 with the following switches enabled:

  • DUK_USE_CPP_EXCEPTIONS for C++ exception handling.
  • DUK_USE_DATE_NOW_WINDOWS for Windows Vista compatibility.
  • DUK_USE_INTERRUPT_COUNTER for aborting long or non-terminating scripts.

duktape is configured with a command such as:

python2 duktape-2.7.0/tools/configure.py --output-directory src/thirdparty/duktape \
    -DDUK_USE_CPP_EXCEPTIONS \
    -DDUK_USE_DATE_NOW_WINDOWS \
    -DDUK_USE_INTERRUPT_COUNTER \
    -DDUK_USE_EXEC_TIMEOUT_CHECK=duk_exec_timeout_check

Then manually apply configuration fixup for duk_exec_timeout_check (e.g. compare repo version of duk_config.h with the one freshly generated) and rename resulting duktape.c file to duktape.cpp

See Configuring Duktape for build for more information.