diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-12-03 17:15:14 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-12-05 01:12:52 +0100 |
commit | dd9503dc1937e1469b2a6f8e145e80acbf2c7cbb (patch) | |
tree | 3d99772bd543ddda07ff17a7ef6247e982488574 /platform/javascript/os_javascript.cpp | |
parent | 1e7bd3d08be6559ae14b0d25234cfc01298fe450 (diff) | |
download | redot-engine-dd9503dc1937e1469b2a6f8e145e80acbf2c7cbb.tar.gz |
[HTML5] Make GDNative support feature-based.
This is suboptimal as it requires adding an extra compile flag, but
rewriting how feature tags work is beyond the scope of this work.
Diffstat (limited to 'platform/javascript/os_javascript.cpp')
-rw-r--r-- | platform/javascript/os_javascript.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index b3ef3fe573..ebfcd7293e 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -128,12 +128,24 @@ int OS_JavaScript::get_process_id() const { } bool OS_JavaScript::_check_internal_feature_support(const String &p_feature) { - if (p_feature == "HTML5" || p_feature == "web") + if (p_feature == "HTML5" || p_feature == "web") { return true; + } #ifdef JAVASCRIPT_EVAL_ENABLED - if (p_feature == "JavaScript") + if (p_feature == "JavaScript") { + return true; + } +#endif +#ifndef NO_THREADS + if (p_feature == "threads") { return true; + } +#endif +#if WASM_GDNATIVE + if (p_feature == "wasm32") { + return true; + } #endif return false; |