用Cmake构建v8引擎

时间:2016-12-08 13:39:45

标签: c++ cmake v8 embedded-v8

抱歉英语错误)请帮忙。我尝试从“Hellow world”示例构建v8引擎。它将嵌入我的基础项目中,因此我需要使用Cmake构建它(系统是macOS Sierra)。我编译了v8引擎(构建库默认存储在out目录中),我有以下文件系统结构:

screen file system

如示例中所示,后来大多数使用此make表达式构建:

[Thu Dec 08 08:55:41.970435 2016] [mpm_prefork:notice] [pid 25213] AH00169: caught SIGTERM, shutting down
[Thu Dec 08 08:55:42.995218 2016] [mpm_prefork:notice] [pid 30673] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Thu Dec 08 08:55:42.995313 2016] [core:notice] [pid 30673] AH00094: Command line: '/usr/sbin/apache2'
[Thu Dec 08 08:58:17.074621 2016] [mpm_prefork:notice] [pid 30673] AH00169: caught SIGTERM, shutting down
[Thu Dec 08 08:58:18.087459 2016] [mpm_prefork:notice] [pid 30738] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Thu Dec 08 08:58:18.087522 2016] [core:notice] [pid 30738] AH00094: Command line: '/usr/sbin/apache2'
[Thu Dec 08 09:28:16.914107 2016] [mpm_prefork:notice] [pid 30738] AH00169: caught SIGTERM, shutting down

另外,请查看我的CMakeLists.txt文件:

screen CMakeLists.txt

在构建时,我有以下错误输出:

g++ -I. hello_world.cpp -o hello_world -Wl,--start-group out/x64.release/obj.target/{tools/gyp/libv8_{base,libbase,external_snapshot,libplatform},third_party/icu/libicu{uc,i18n,data}}.a -Wl,--end-group -lrt -ldl -pthread -std=c++0x

1 个答案:

答案 0 :(得分:0)

我解决了问题,为了将来我写下我的步骤,如何在macOS上构建V8:

  1. 构建没有快照的v8引擎和本机平台的共享库:sudo make library = shared snapshot = off native;

  2. 使用clang编译(gcc throw错误,如“未定义的架构符号......”等)但是mac上的clang编译得很好;

  3. 从带有*。/ dylib的./out目录文件复制到usr / local / lib