Closed isegal closed 8 years ago
Hi Ivgeni,
Thanks for the PR. At this moment I can't build v8pp with V8 version 5.2+ to check your changes. It seems I have to update v8-build script.
Anyway, I think there should be support for older V8 versions in the project, at least for some time. Could you please add a compile time condition to switch between WeakCallbackData
and WeakCallbackInfo
depending on V8 version? I've seen defines for V8 version parts in v8-version.h
header.
No problem. Interesting find: It appears they have introduced the renamed type a year ago in https://github.com/v8/v8/commit/60c1ad026d084b62fc963330af0b4802346eab7d and supported both for a while. You might not need a conditional check with your current version. Let me know if that is not the case and I'll re submit.
In case for when you want to move to a newer v8, I found there were a couple of minor changes in their build system. Below are examples that work on my machines with latest v8.
(Assuming you execute script from one level above v8 that has depot_tools in the same directory)
For Mac:
export PATH=pwd
/depot_tools:"$PATH"
gclient sync --with_branch_heads
cd v8
gypfiles/gyp_v8 -Dtarget_arch=x64 -Dsnapshot=on
xcodebuild -project gypfiles/all.xcodeproj -configuration Release
For Windows: set DEPOT_TOOLS_WIN_TOOLCHAIN=0 set GYP_MSVS_VERSION=2015 call gclient sync call python v8\gypfiles\gyp_v8 -Dtarget_arch=x64 cd v8 "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.com" /build Release src\v8.sln
The sln file appears to have moved to src\ devenv.com" /build Release src\v8.sln
@isegal, thanks! You were absolutely right - WeakCallbackInfo
had been declared in V8 a time ago. I changed v8pp to use it instead of WeakCallbackData
.
I also fixed a couple of bugs there and tested it on Windows the project with V8 5.2 and 4.8 versions.
I had to add compile time selection for the weak callback, because v8::WeakCallbackInfo
was added in V8 4.3.28.
Resolved with prerpocessor defines
As of https://github.com/v8/v8/commit/82dcb2beeeb85369902c76e48374caed4fac58fb V8 has removed a deprecated WeakCallbackData. This commit replaces the deprecated type with WeakCallbackInfo. This fixes the compilation error with newer versions of V8.