summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
Diffstat (limited to 'samples')
-rw-r--r--samples/BUILD.gn7
-rw-r--r--samples/pdfium_test.cc9
-rw-r--r--samples/samples.gyp7
3 files changed, 20 insertions, 3 deletions
diff --git a/samples/BUILD.gn b/samples/BUILD.gn
index 7f2f41fa82..6bd2a81359 100644
--- a/samples/BUILD.gn
+++ b/samples/BUILD.gn
@@ -15,6 +15,11 @@ executable("pdfium_test") {
]
deps = [
"//third_party/pdfium",
+ "//v8:v8_libplatform",
+ ]
+ include_dirs = [
+ "//v8",
+ "//v8/include",
]
}
@@ -27,4 +32,4 @@ executable("pdfium_diff") {
deps = [
"//third_party/pdfium",
]
-} \ No newline at end of file
+}
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index a813c9c0b3..4f6e832e0c 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -20,8 +20,10 @@
#include "../fpdfsdk/include/fpdftext.h"
#include "../fpdfsdk/include/fpdfview.h"
#include "../core/include/fxcrt/fx_system.h"
-#include "v8/include/v8.h"
#include "image_diff_png.h"
+#include "v8/include/v8.h"
+#include "v8/include/libplatform/libplatform.h"
+
#ifdef _WIN32
#define snprintf _snprintf
@@ -573,6 +575,9 @@ int main(int argc, const char* argv[]) {
}
v8::V8::InitializeICU();
+ v8::Platform* platform = v8::platform::CreateDefaultPlatform();
+ v8::V8::InitializePlatform(platform);
+ v8::V8::Initialize();
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
v8::StartupData natives;
@@ -606,6 +611,8 @@ int main(int argc, const char* argv[]) {
}
FPDF_DestroyLibrary();
+ v8::V8::ShutdownPlatform();
+ delete platform;
return 0;
}
diff --git a/samples/samples.gyp b/samples/samples.gyp
index e559790476..c972142ed2 100644
--- a/samples/samples.gyp
+++ b/samples/samples.gyp
@@ -7,8 +7,13 @@
'type': 'executable',
'dependencies': [
'../pdfium.gyp:pdfium',
+ '<(DEPTH)/v8/tools/gyp/v8.gyp:v8_libplatform',
+ ],
+ 'include_dirs': [
+ '<(DEPTH)',
+ '<(DEPTH)/v8',
+ '<(DEPTH)/v8/include',
],
- 'include_dirs': ['<(DEPTH)'],
},
'targets': [
{