MINGW-packages/mingw-w64-nodejs/0008-Link-with-municode-and-extern-wmain-for-Unicode.patch
2024-01-13 14:51:57 +08:00

59 lines
1.7 KiB
Diff

From 3b353a4dbc0e96a35d18dde94a787945f1c5c58a Mon Sep 17 00:00:00 2001
From: Alethea Rose <alethea@alethearose.com>
Date: Wed, 15 Feb 2017 19:11:53 -0500
Subject: [PATCH 08/23] Link with -municode and extern wmain for Unicode
---
node.gyp | 9 +++++++++
node.gypi | 1 +
2 files changed, 10 insertions(+)
diff --git a/node.gyp b/node.gyp
index 811d15b0..d60ea49e 100644
--- a/node.gyp
+++ b/node.gyp
@@ -545,6 +545,9 @@
'msvs_disabled_warnings!': [4244],
'conditions': [
+ [ 'OS=="win"', {
+ 'ldflags': [ '-municode' ],
+ }],
[ 'error_on_warn=="true"', {
'cflags': ['-Werror'],
'xcode_settings': {
@@ -1219,6 +1222,9 @@
[ 'OS in "linux mac"', {
'defines': ['NODE_JS2C_USE_STRING_LITERALS'],
}],
+ [ 'OS=="win"', {
+ 'ldflags': [ '-municode' ],
+ }],
[ 'debug_node=="true"', {
'cflags!': [ '-O3' ],
'cflags': [ '-g', '-O0' ],
@@ -1266,6 +1272,9 @@
['node_write_snapshot_as_array_literals=="true"', {
'defines': [ 'NODE_MKSNAPSHOT_USE_ARRAY_LITERALS=1' ],
}],
+ [ 'OS=="win"', {
+ 'ldflags': [ '-municode' ],
+ }],
[ 'node_use_openssl=="true"', {
'defines': [
'HAVE_OPENSSL=1',
diff --git a/node.gypi b/node.gypi
index 95133818..39d6c081 100644
--- a/node.gypi
+++ b/node.gypi
@@ -68,6 +68,7 @@
# but we still inherit it from uv.h.
'NOMINMAX',
'_UNICODE=1',
+ 'UNICODE',
],
'msvs_precompiled_header': 'tools/msvs/pch/node_pch.h',
'msvs_precompiled_source': 'tools/msvs/pch/node_pch.cc',
--
2.17.0.windows.1