0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-11-24 15:19:31 -05:00

Add depot_tools and v8

This commit is contained in:
Bert Belder 2019-10-18 12:36:58 -07:00
parent 5bca90b074
commit 8d2d3697f8
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461
11 changed files with 55 additions and 4 deletions

2
.gitignore vendored
View file

@ -1,2 +1,4 @@
/target
**/*.rs.bk
/goog/.cipd/
/goog/.gclient_entries

6
.gitmodules vendored Normal file
View file

@ -0,0 +1,6 @@
[submodule "depot_tools"]
path = goog/depot_tools
url = https://chromium.googlesource.com/chromium/tools/depot_tools
[submodule "v8"]
path = goog/v8
url = https://chromium.googlesource.com/v8/v8

View file

@ -7,4 +7,11 @@ fn main() {
.debug(true)
.file("src/lib.cpp")
.compile("v8-bindings");
println!("cargo:rustc-link-lib=static=v8_monolith");
println!("cargo:rustc-link-search=goog/v8/out/x64.release/obj");
if cfg!(target_os = "windows") {
println!("cargo:rustc-link-lib=dylib=winmm");
}
}

3
env.bat Normal file
View file

@ -0,0 +1,3 @@
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set PATH=%~dp0\goog\depot_tools;%PATH%
set RUSTFLAGS=-C target-feature=+crt-static -C linker=%~dp0goog\v8\third_party\llvm-build\Release+Asserts\bin\lld-link.exe

10
goog/.gclient Normal file
View file

@ -0,0 +1,10 @@
solutions = [
{ "name" : "v8",
"url" : "https://chromium.googlesource.com/v8/v8",
"deps_file" : "DEPS",
"managed" : True,
"custom_deps" : {
},
"custom_vars": {},
},
]

15
goog/args.gn Normal file
View file

@ -0,0 +1,15 @@
# Copy this file to v8/out/release.x64
is_component_build = false
is_debug = false
target_cpu = "x64"
treat_warnings_as_errors = false
use_custom_libcxx = false
use_jumbo_build = true
v8_enable_backtrace = true
v8_enable_disassembler = true
v8_enable_i18n_support = false
v8_enable_object_print = true
v8_enable_verify_heap = true
v8_monolithic = true
v8_use_external_startup_data = false

1
goog/depot_tools Submodule

@ -0,0 +1 @@
Subproject commit acf922ce48cfd1ecf88582d9dbecf14e8d1fe369

1
goog/v8 Submodule

@ -0,0 +1 @@
Subproject commit df131dbeccb600d8c4b1f4db015248e47796f14d

View file

@ -6,7 +6,7 @@
#include <type_traits>
#include <utility>
#include "../v8/include/v8-inspector.h"
#include "../goog/v8/include/v8-inspector.h"
namespace v8_inspector {
using Channel = V8Inspector::Channel;
}
@ -14,5 +14,11 @@ using Channel = V8Inspector::Channel;
template <class T>
using uninit_t = typename std::aligned_storage<sizeof(T), alignof(T)>::type;
// In C++17, this should be backed by std::launder().
template <class T>
auto launder(T ptr) {
return ptr;
}
#include "v8_inspector/channel.h"
#include "v8_inspector/string_buffer.h"

View file

@ -15,7 +15,8 @@ void v8_inspector__Channel__EXTENDER__flushProtocolNotifications(Channel& self);
namespace v8_inspector {
struct Channel__EXTENDER : public Channel {
using Channel::Channel;
static_assert(sizeof(std::unique_ptr<StringBuffer>) == sizeof(StringBuffer*));
static_assert(sizeof(std::unique_ptr<StringBuffer>) == sizeof(StringBuffer*),
"sizeof(T*) != sizeof(unique_ptr<T>)");
void sendResponse(int callId,
std::unique_ptr<StringBuffer> message) override {
@ -35,7 +36,7 @@ extern "C" {
using namespace v8_inspector;
void v8_inspector__Channel__EXTENDER__CTOR(uninit_t<Channel__EXTENDER>& buf) {
new (std::launder(&buf)) Channel__EXTENDER();
new (launder(&buf)) Channel__EXTENDER();
}
void v8_inspector__Channel__DTOR(Channel& self) {
self.~Channel();

1
v8
View file

@ -1 +0,0 @@
d:/deno2/third_party/v8