Intro
Because I had wanted to know how JavaScript worked, I tried to build and use V8.I used Ubuntu19.10 what installed on Mac mini.
Because its Mac OS already hadn't been updated.
Install and build V8
After installing Ubuntu, I installed git, vim, Python(ver.2.7.17) for building V8.sudo apt install git vim python
Most of all software for building V8, I installed after a while by following the documents.
But these had been needed at the begining of building.
build V8
Most of all steps had been on the documents.But because I forgot some of them, So I got some errors :P
1. clone depot_tools and add installed path.
depot_tools tutorial(7)
2. make a directory for installing v8 and move to there
"mkdir ~/v8" & "cd ~/v8"
3. "fetch v8"
Checking out the V8 source code - v8
4. update files
"git pull --rebase origin" & "gclient sync"
5. install dependencies with "./build/install-build-deps.sh"
Building V8 from source - v8
6. add the alias for gm and v8gen.
"alias gm=~/v8/v8/tools/dev/gm.py" & "alias v8gen=~/v8/v8/tools/dev/v8gen.py"
Building V8 with GN - v8
7. build v8 with gm
"gm x64.release" & "gm x64.release.check"
Because I had forgotten step 5, so I failed building v8.
After buiding v8, I built the hello-world.cc by the document.
Getting started with embedding V8 - v8
Finally I could get this message.
Hello, World! 3 + 4 = 7
Good :)
process.cc and shell.cc also could be built by the same way.
Install cquery
Next, I installed VSCode and cquery.GUI and IDE setup - V8
VSCode
I just downloaded the deb file and installed.Visual Studio Code - Code Editing. Redefined
cquery
Before install cquery, I had had to install some software.sudo apt install clang clang-tools llvm llvm-6.0-tools libclang-6.0-dev libncurses5Most important was libncurses5.
Before I had installed it, I got an error when I executed cmake command.
... CMake Error at cmake/FindClang.cmake:95 (message): Error retrieving Clang resource directory with Clang executable. Output: /home/example/cquery/build/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang++: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory Call Stack (most recent call first): CMakeLists.txt:108 (find_package) -- Configuring incomplete, errors occurred! ...Building cquery · cquery-project/cquery Wiki · GitHub
android - clang: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory - Stack Overflow
add cquery settings to VSCode
To use cquery for v8, I added settings to VSCode.1. I opened v8 folder by VSCode.
2. I opened settings by ctrl + ,
3. I opened settings.json by "Open Settings(JSON)"
4. I added below and saved
settings.json
{
"cquery.launch.command": "~/cquery/build/release/bin/cquery",
"cquery.cacheDirectory": "~/v8/v8/.vscode/cquery_cached_index/",
"cquery.completion.include.blacklist": [".*/.vscache/.*", "/tmp.*", "build/.*"],
}
Next time, I would read samples or write some codes to try.
コメント
コメントを投稿