// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <windows.h>
-
#include "../include/v8.h"
+#ifdef WIN32
+#include <windows.h>
+
extern "C" {
BOOL WINAPI DllMain(HANDLE hinstDLL,
DWORD dwReason,
return TRUE;
}
}
+#endif
{
'dependencies': ['v8_nosnapshot'],
}],
- ['OS=="win" and component=="shared_library"', {
+ ['component=="shared_library"', {
'type': '<(component)',
'sources': [
+ # Note: on non-Windows we still build this file so that gyp
+ # has some sources to link into the component.
'../../src/v8dll-main.cc',
],
- 'defines': [
- 'BUILDING_V8_SHARED'
+ 'conditions': [
+ ['OS=="win"', {
+ 'defines': [
+ 'BUILDING_V8_SHARED',
+ ],
+ 'direct_dependent_settings': {
+ 'defines': [
+ 'USING_V8_SHARED',
+ ],
+ },
+ }, {
+ 'defines': [
+ 'V8_SHARED',
+ ],
+ 'direct_dependent_settings': {
+ 'defines': [
+ 'V8_SHARED',
+ ],
+ },
+ }],
],
- 'direct_dependent_settings': {
- 'defines': [
- 'USING_V8_SHARED',
- ],
- },
},
{
'type': 'none',
'target_name': 'v8_snapshot',
'type': '<(library)',
'conditions': [
- ['OS=="win" and component=="shared_library"', {
- 'defines': [
- 'BUILDING_V8_SHARED',
+ ['component=="shared_library"', {
+ 'conditions': [
+ ['OS=="win"', {
+ 'defines': [
+ 'BUILDING_V8_SHARED',
+ ],
+ 'direct_dependent_settings': {
+ 'defines': [
+ 'USING_V8_SHARED',
+ ],
+ },
+ }, {
+ 'defines': [
+ 'V8_SHARED',
+ ],
+ 'direct_dependent_settings': {
+ 'defines': [
+ 'V8_SHARED',
+ ],
+ },
+ }],
],
}],
],
'cflags': ['-m32'],
'ldflags': ['-m32'],
}],
- ['OS=="win" and component=="shared_library"', {
+ ['component=="shared_library"', {
'defines': [
'BUILDING_V8_SHARED',
+ 'V8_SHARED',
],
}],
]
'libraries': [ '-lwinmm.lib' ],
},
}],
- ['OS=="win" and component=="shared_library"', {
+ ['component=="shared_library"', {
'defines': [
- 'BUILDING_V8_SHARED'
+ 'BUILDING_V8_SHARED',
+ 'V8_SHARED',
],
}],
],