Skip to content
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

Preprocessor defines BUILDING_V8_SHARED=1 and BUILDING_UV_SHARED=1 #914

Closed
Flarna opened this issue Apr 28, 2016 · 1 comment
Closed

Preprocessor defines BUILDING_V8_SHARED=1 and BUILDING_UV_SHARED=1 #914

Flarna opened this issue Apr 28, 2016 · 1 comment

Comments

@Flarna
Copy link
Member

Flarna commented Apr 28, 2016

I tried the HelloWorld addon sample (using node 4.4.3 for windows) and found that node-gyp sets following defines in the generated VS solution (besides others):

BUILDING_V8_SHARED=1
BUILDING_UV_SHARED=1
BUILDING_NODE_EXTENSION

While BUILDING_NODE_EXTENSION is clear the other two seem to be strange because of following statement in v8.h:

// Setup for Windows DLL export/import. When building the V8 DLL the
// BUILDING_V8_SHARED needs to be defined. When building a program which uses
// the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8
// static library or building a program which uses the V8 static library neither
// BUILDING_V8_SHARED nor USING_V8_SHARED should be defined.
#if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
#error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\
  build configuration to ensure that at most one of these is set
#endif

#ifdef BUILDING_V8_SHARED
# define V8_EXPORT __declspec(dllexport)
#elif USING_V8_SHARED
# define V8_EXPORT __declspec(dllimport)
#else
# define V8_EXPORT
#endif  // BUILDING_V8_SHARED

In case I first include node.h this seems to be "repaired" via following statements in node.h:

#ifdef BUILDING_NODE_EXTENSION
# undef BUILDING_V8_SHARED
# undef BUILDING_UV_SHARED
# define USING_V8_SHARED 1
# define USING_UV_SHARED 1
#endif

But if I first include v8.h or other V8 files like v8-profiler.h the corrections done in node.h are missing.

I think that USING_V8_SHARED=1 and USING_UV_SHARED=1 should be set instead BUILDING_V8_SHARED=1 and BUILDING_UV_SHARED=1 for node extensions.

@bnoordhuis
Copy link
Member

#915

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants