交叉编译 - 在Mac上为Android安装V8

时间:2017-04-19 08:43:39

标签: android macos android-ndk cross-compiling v8

有关此问题的一些问题。但答案没有帮助。我尝试为Android生成D8。 The v8 guide说gyp已被弃用。我的步骤在这里:

  1. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    1. export PATH =' pwd' / depot_tools:" $ PATH"
    2. 下载ndk-r14b
    3. fetch v8
    4. cd v8
    5. echo" target_os = [' android']" >> ../.gclient&& gclient sync --nohooks
    6. tools / dev / v8gen.py arm.release
    7. gn gen out.gn/arm.release --args =' android_ndk_root =" / path / android-ndk-r14b" android_ndk_version =" R 14" v8_static_library = true android_sdk_root =" / path / android-sdk-r25" target_os =" android" target_cpu =" arm" v8_target_cpu =" arm" is_component_build = false'
    8. ninja -C out.gn/arm.release d8
  2. 编译会引发一些错误。

    In file included from ../../third_party/icu/source/common/unicode/unistr.h:33:0,
                     from ../../third_party/icu/source/common/unicode/locid.h:36,
                     from ../../third_party/icu/source/i18n/unicode/dcfmtsym.h:36,
                     from ../../third_party/icu/source/i18n/unicode/decimfmt.h:38,
                     from ../../third_party/icu/source/i18n/digitlst.h:32,
                     from ../../third_party/icu/source/i18n/visibledigits.cpp:18:
    ../../third_party/icu/source/common/unicode/std_string.h:35:18: fatal error: string: No such file or directory
     #include <string>
                      ^
    compilation terminated.
    [6/939] CC obj/third_party/icu/icui18n/utmscale.o
    ninja: build stopped: subcommand failed.
    

    我该如何解决?

1 个答案:

答案 0 :(得分:0)

你忘记了

android_ndk_major_version=14