项目作者: devikkim

项目描述 :
This repository is guide for v8 using android
高级语言:
项目地址: git://github.com/devikkim/ComplieV8ForAndroid.git
创建时间: 2018-11-19T05:09:26Z
项目社区:https://github.com/devikkim/ComplieV8ForAndroid

开源协议:

下载


ComplieV8ForAndroid

This repository is guide for v8 using android

Set dependencies (on Linux:ubuntu)

  1. get depot tools more :
    ```
    git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

export PATH=pwd/depot_tools:”$PATH”

  1. 2. make sure you have these packages installed (Linux only)

sudo apt-get install curl libc6-dev-i386 g++-multilib

  1. ### Compile v8 on linux (ubuntu)
  2. 1. install v8 (checkout version)

fetch v8
cd v8
git pull
git checkout

  1. 2. download android tools

echo “target_os = [‘android’]” >> ../.gclient && gclient sync

  1. 3. check v8gen.py list

tools/dev/v8gen.py list

  1. > example :

arm.debug
arm.optdebug
arm.release
arm64.debug
arm64.optdebug
arm64.release
ia32.debug
ia32.optdebug
ia32.release
x64.debug
x64.optdebug
x64.release

  1. 6. generate compilation target

tools/dev/v8gen.py gen

  1. 4. change `out.gn/<one_of_list>/args.gn`

vi out.gn//args.gn

  1. > example :

args.gn file

v8_use_snapshot = true
v8_use_external_startup_data = false
is_official_build = true
is_debug = false
symbol_level = 0
target_cpu = “arm”
v8_target_cpu = “arm”
v8_enable_i18n_support = false
target_os = “android”
v8_android_log_stdout = true

  1. 5. compile target

ninja -C out.gn/ -j 4

  1. 6. create lib files

cd out.gn//obj
mkdir libs
cd libs
ar -rcsD libv8_base.a ../v8_base/.o
ar -rcsD libv8_base.a ../v8_libbase/
.o
ar -rcsD libv8_base.a ../v8_libsampler/.o
ar -rcsD libv8_base.a ../v8_libplatform/
.o
ar -rcsD libv8_base.a ../src/inspector/inspector/.o
ar -rcsD libv8_snapshot.a ../v8_snapshot/
.o
ar -rcsD libv8_nosnapshot.a ../v8_nosnapshot/.o
ar -rcsD libv8_external_snapshot.a ../v8_external_snapshot/
.o

  1. > Maybe not all of the above files are created. But it does not matter. Only the `libv8_base.a` and `libv8_nosnapshot.a` files need to be created.
  2. 7. source headers, for inspector compilation.
  3. copy v8 compliation header files

mkdir -p src/base/platform
cp -R ../../../../src/.h ./src
cp -R ../../../../src/base/
.h ./src/base
cp -R ../../../../src/base/platform/*.h ./src/base/platform
cp -R ../../../../include ./
```

  1. Make sure the file has been created in path/to/v8/out.gn/<one_of_list>/obj/libs/