Skip to content
Justin Walsh edited this page Feb 7, 2020 · 71 revisions

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
  1. set DEPOT_TOOLS_WIN_TOOLCHAIN=0 && set GYP_MSVS_VERSION=2019

  2. gclient config https://github.com/ncsoft/v8.git

  3. gclient sync --with_branch_heads -r 7.7.299.9999

  4. cd v8

  5. 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) )

  6. 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"

  7. ninja -C out/x64.release v8 v8_libbase v8_libplatform v8_libsampler

  • MacOS
  1. gclient config https://github.com/ncsoft/v8.git
  2. gclient sync --with_branch_heads -r 7.7.299.9999
  3. cd v8
  4. 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"
  5. ninja -C out/x64.release v8 v8_libbase v8_libplatform v8_libsampler
  6. cp out/native/obj.target/src/*.a {UnrealJS}/ThirdParty/v8/lib/Mac/x64/
  • Linux
  1. gclient config https://github.com/ncsoft/v8.git
  2. gclient sync --with_branch_heads -r 7.7.299.9999
  3. cd v8
  4. 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"
  5. ninja -C out/x64.release v8 v8_libbase v8_libplatform v8_libsampler
  6. 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
  7. cp out/x64.release/obj/**/*.a {UnrealJS}/ThirdParty/v8/lib/Linux/Release/
  • Android
  1. gclient config https://github.com/ncsoft/v8.git
  2. echo "target_os = ['android']" >> .gclient && gclient sync --with_branch_heads -r 7.7.299.9999
  3. cd v8
  4. 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\""
  5. ninja -C out/release v8 v8_libbase v8_libplatform v8_libsampler
  • iOS
  1. gclient config https://github.com/ncsoft/v8.git
  2. echo "target_os = ['ios']" >> .gclient && gclient sync --with_branch_heads -r 7.7.299.9999
  3. cd v8
  4. 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\""
  5. ninja -C out/release v8 v8_libbase v8_libplatform v8_libsampler
Clone this wiki locally
You can’t perform that action at this time.