Flags
- You can add V8 flags in 'Edit - Project Settings - Plugins - UnrealJS'.
Jit less V8
- If you want to run Unreal.js from iOS or game console, you should use jit-less. Add --jitless to flags.
Build
Download depot_tools and set PATH (https://www.chromium.org/developers/how-tos/install-depot-tools)
- windows
-
set DEPOT_TOOLS_WIN_TOOLCHAIN=0 && set GYP_MSVS_VERSION=2019
-
gclient config https://github.com/ncsoft/v8.git
-
gclient sync --with_branch_heads -r 7.7.299.9999
-
cd v8
-
sed -i.bak 's|configs = [ ":static_crt" ]|configs = [ ":dynamic_crt" ]|' build/config/win/BUILD.gn
(Fix some google mistakes: open file src\build\config\win\BUILD.gn and change all :static_crt to :dynamic_crt (CRT - current run time) ) -
gn gen out/x64.release -args="v8_use_external_startup_data=false v8_use_snapshot=false v8_enable_i18n_support=false is_debug=false v8_static_library=true is_clang=false"
-
ninja -C out/x64.release v8 v8_libbase v8_libplatform v8_libsampler
- MacOS
gclient config https://github.com/ncsoft/v8.git
gclient sync --with_branch_heads -r 7.7.299.9999
cd v8
gn gen out/x64.release -args="v8_use_external_startup_data=false v8_use_snapshot=false v8_enable_i18n_support=false is_debug=false v8_static_library=true symbol_level=0 libcxx_abi_unstable=false"
ninja -C out/x64.release v8 v8_libbase v8_libplatform v8_libsampler
cp out/native/obj.target/src/*.a {UnrealJS}/ThirdParty/v8/lib/Mac/x64/
- Linux
gclient config https://github.com/ncsoft/v8.git
gclient sync --with_branch_heads -r 7.7.299.9999
cd v8
gn gen out/x64.release -args="v8_use_external_startup_data=false v8_use_snapshot=false v8_enable_i18n_support=false is_debug=false v8_static_library=true libcxx_abi_unstable=false"
ninja -C out/x64.release v8 v8_libbase v8_libplatform v8_libsampler
for lib in `find out/x64.release/obj/ -name '*.a'`; do ar -t $lib | xargs ar rvs $lib.new && mv -v $lib.new $lib; done
cp out/x64.release/obj/**/*.a {UnrealJS}/ThirdParty/v8/lib/Linux/Release/
- Android
gclient config https://github.com/ncsoft/v8.git
echo "target_os = ['android']" >> .gclient && gclient sync --with_branch_heads -r 7.7.299.9999
cd v8
gn gen out/release -args="v8_use_external_startup_data=false v8_use_snapshot=false v8_enable_i18n_support=false is_debug=false v8_static_library=true target_os=\"android\" target_cpu=\"arm64\""
ninja -C out/release v8 v8_libbase v8_libplatform v8_libsampler
- iOS
gclient config https://github.com/ncsoft/v8.git
echo "target_os = ['ios']" >> .gclient && gclient sync --with_branch_heads -r 7.7.299.9999
cd v8
gn gen out/release -args="v8_use_external_startup_data=false v8_use_snapshot=false v8_enable_i18n_support=false is_debug=false v8_static_library=true ios_enable_code_signing=false target_os=\"ios\" target_cpu=\"arm64\""
ninja -C out/release v8 v8_libbase v8_libplatform v8_libsampler