-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added compatibility with MSVC on Windows #2
Conversation
Added translations for some new API types from V8 5.5+ Changed v8-glue.cc to avoid C99 features that MSVC does not support
Current coverage is 89.41% (diff: 100%)@@ master #2 diff @@
==========================================
Files 10 10
Lines 652 652
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 583 583
Misses 69 69
Partials 0 0
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remove the v8_platform line and we're good
if cfg!(all(windows, target_env="msvc")) { | ||
println!("cargo:rustc-link-lib=dylib=v8.dll"); | ||
println!("cargo:rustc-link-lib=static=v8_base"); | ||
println!("cargo:rustc-link-lib=static=v8_platform"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I don't think v8_platform is needed. We don't link it in the Linux static build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it may be from using GN to build v8 on windows, but it built both. I can link them together though so I'll go ahead and remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So v8_platform
is needed if you don't implement your own, which we do through the PlatformFunctions
API towards Rust.
@@ -899,11 +900,11 @@ ValueRef v8_Object_CallAsFunction(RustContext c, ObjectRef self, ContextRef cont | |||
v8::HandleScope scope(c.isolate); | |||
v8::TryCatch try_catch(c.isolate); | |||
v8::Context::Scope context_scope(wrap(c.isolate, context)); | |||
v8::Local<v8::Value> argv_wrapped[argc]; | |||
std::vector<v8::Local<v8::Value>> argv_wrapped(argc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be so nice to not heap allocate here but I guess we have no choice with portable C++ so 👍
Removed build step linking v8_platform.lib on windows to match linking on linux
Added translations for some new API types from V8 5.5+
Changed v8-glue.cc to avoid C99 features that MSVC does not support