@auto_js/v8_exports 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CMakeLists.txt CHANGED
@@ -114,6 +114,9 @@ else()
114
114
  message(FATAL_ERROR "Missing '${V8_INCLUDE_DIR}/v8.h'")
115
115
  endif()
116
116
  message(STATUS "Using v8 headers from '${V8_INCLUDE_DIR}'")
117
+
118
+ # nodejs v8 is linked as a shared library
119
+ target_compile_definitions(${google_v8} PRIVATE USING_V8_SHARED)
117
120
  endif()
118
121
 
119
122
  # These need to be public, for version detection. I was hoping I could do it with constexpr but
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auto_js/v8_exports",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "C++ module exports for v8",
5
5
  "author": "https://github.com/laverdet/",
6
6
  "homepage": "https://github.com/laverdet/isolated-vm/tree/experimental/packages/third_party/v8",
package/v8.cc CHANGED
@@ -1,6 +1,16 @@
1
1
  module;
2
+ // Pull in `V8_EXPORT`
3
+ #include "v8config.h"
4
+
5
+ // Redefine `V8_EXPORT` with weak attribute
6
+ #if USING_V8_SHARED
7
+ #undef V8_EXPORT
8
+ #include "v8_js/extern.h"
9
+ #endif
10
+
11
+ // Continue with the rest of the include chain
2
12
  #include "v8.h"
3
- #include "v8/version.h"
13
+ #include "v8_js/version.h"
4
14
  #ifdef INCLUDE_V8_PLATFORM
5
15
  #include "libplatform/libplatform.h"
6
16
  #include "v8-platform.h"
@@ -61,6 +71,9 @@ using v8::V8FatalErrorCallback;
61
71
 
62
72
  // v8-isolate.h
63
73
  using v8::Isolate;
74
+ using v8::IsolateGroup;
75
+ using v8::MemoryPressureLevel;
76
+ using v8::ResourceConstraints;
64
77
 
65
78
  // v8-local-handle.h
66
79
  using v8::EscapableHandleScope;
package/v8_js/extern.h ADDED
@@ -0,0 +1,9 @@
1
+ #if __linux__
2
+ #define V8_EXPORT __attribute__((weak))
3
+ #elif __APPLE__
4
+ #define V8_EXPORT __attribute__((weak))
5
+ #elif _WIN64
6
+ #define V8_EXPORT __declspec(dllimport) __attribute__((weak))
7
+ #else
8
+ #define V8_EXPORT
9
+ #endif
File without changes