Files
MINGW-packages/mingw-w64-nodejs/0101-node-buildflags-fixes.patch
2024-07-27 18:03:33 +08:00

182 lines
5.4 KiB
Diff

diff --git a/common.gypi b/common.gypi
index fc45ca43..c79f163e 100644
--- a/common.gypi
+++ b/common.gypi
@@ -152,7 +152,7 @@
'cflags': [ '-fPIC' ],
'ldflags': [ '-fPIC' ]
}],
- ['clang==1', {
+ ['OS == "msvc" and clang==1', {
'msbuild_toolset': 'ClangCL',
}],
],
@@ -243,7 +243,7 @@
'cflags': [ '-fPIC', '-I<(android_ndk_path)/sources/android/cpufeatures' ],
'ldflags': [ '-fPIC' ]
}],
- ['clang==1', {
+ ['OS == "msvc" and clang==1', {
'msbuild_toolset': 'ClangCL',
}],
],
@@ -482,6 +482,9 @@
'NOMINMAX',
],
}],
+ ['OS == "win" and OS != "msvc"', {
+ 'ldflags': [ '-pthread' ],
+ }],
[ 'OS in "linux freebsd openbsd solaris aix os400"', {
'cflags': [ '-pthread' ],
'ldflags': [ '-pthread' ],
diff --git a/deps/llhttp/llhttp.gyp b/deps/llhttp/llhttp.gyp
index c7b8800a..b6703471 100644
--- a/deps/llhttp/llhttp.gyp
+++ b/deps/llhttp/llhttp.gyp
@@ -10,6 +10,11 @@
{
'target_name': 'llhttp',
'type': 'static_library',
+ 'conditions': [
+ [ 'target_arch!="arm64"', {
+ 'cflags_c': [ '-mssse3' ],
+ }],
+ ],
'include_dirs': [ '.', 'include' ],
'direct_dependent_settings': {
'include_dirs': [ 'include' ],
diff --git a/deps/ngtcp2/ngtcp2.gyp b/deps/ngtcp2/ngtcp2.gyp
index 0f2929b7..07dca184 100644
--- a/deps/ngtcp2/ngtcp2.gyp
+++ b/deps/ngtcp2/ngtcp2.gyp
@@ -109,6 +109,7 @@
'defines': ['HAVE_UNISTD_H']
}],
['OS=="win"', {
+ 'cflags_c': [ '-mssse3' ],
'defines': [
'WIN32',
'_WINDOWS',
diff --git a/deps/simdutf/simdutf.gyp b/deps/simdutf/simdutf.gyp
index ca8cd2fa..3a51b363 100644
--- a/deps/simdutf/simdutf.gyp
+++ b/deps/simdutf/simdutf.gyp
@@ -16,6 +16,11 @@
'sources': [
'<@(simdutf_sources)',
],
+ 'conditions': [
+ ['clang==0 and OS!="msvc"', {
+ 'cflags_cc': [ '-Wno-template-id-cdtor' ],
+ }]
+ ],
},
]
}
diff --git a/deps/uv/uv.gyp b/deps/uv/uv.gyp
index 6c86c3fa..4e439dbb 100644
--- a/deps/uv/uv.gyp
+++ b/deps/uv/uv.gyp
@@ -193,6 +193,17 @@
},
'conditions': [
[ 'OS=="win"', {
+ 'conditions': [
+ ['OS!="msvc"', {
+ 'type': 'static_library',
+ }],
+ ['OS!="msvc" and clang==0', {
+ 'cflags_c': [
+ '-Wno-cast-function-type',
+ '-Wno-maybe-uninitialized'
+ ],
+ }],
+ ],
'defines': [
'_WIN32_WINNT=0x0602',
'_GNU_SOURCE',
diff --git a/node.gyp b/node.gyp
index 2a8e6a66..b1b17fad 100644
--- a/node.gyp
+++ b/node.gyp
@@ -465,14 +465,14 @@
# Putting these explicitly here so not to depend on `common.gypi`.
# `common.gypi` need to be more general because it is used to build userland native addons.
# Refs: https://github.com/nodejs/node-gyp/issues/1118
- 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
+ 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-Wno-unused-variable', '-Wno-deprecated-declarations', ],
'xcode_settings': {
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-W',
'-Wno-unused-parameter',
- '-Werror=undefined-inline',
+ '-Wno-undefined-inline',
'-Werror=extra-semi',
],
},
@@ -582,6 +582,9 @@
'WARNING_CFLAGS': [ '-Werror' ],
},
}],
+ [ 'OS=="win" and OS!="msvc"', {
+ 'sources': [ 'src/res/node.rc' ],
+ }],
[ 'node_intermediate_lib_type=="static_library" and '
'node_shared=="true" and OS in "aix os400"', {
# For AIX, shared lib is linked by static lib and .exp. In the
@@ -592,7 +595,7 @@
}, {
'dependencies': [ '<(node_lib_target_name)' ],
'conditions': [
- ['OS=="win" and node_shared=="true"', {
+ ['OS=="msvc" and node_shared=="true"', {
'dependencies': ['generate_node_def'],
'msvs_settings': {
'VCLinkerTool': {
@@ -626,7 +629,7 @@
'-Wl,--no-whole-archive',
],
}],
- [ 'OS=="win"', {
+ [ 'OS=="msvc"', {
'sources': [ 'src/res/node.rc' ],
}],
],
@@ -1442,7 +1445,7 @@
},
]
}], # end aix section
- ['OS=="win" and node_shared=="true"', {
+ ['OS=="msvc" and node_shared=="true"', {
'targets': [
{
'target_name': 'gen_node_def',
diff --git a/node.gypi b/node.gypi
index ccce1243..64a61ad6 100644
--- a/node.gypi
+++ b/node.gypi
@@ -27,7 +27,10 @@
'conditions': [
[ 'clang==1', {
- 'cflags': [ '-Werror=undefined-inline', '-Werror=extra-semi']
+ 'cflags': [ '-Wno-undefined-inline', '-Werror=extra-semi' ]
+ }],
+ [ 'clang==0', {
+ 'cflags_cc': [ '-Wno-template-id-cdtor' ]
}],
[ '"<(_type)"=="executable"', {
'msvs_settings': {
@@ -66,7 +69,7 @@
'_UNICODE=1',
],
'conditions': [
- ['clang==0', {
+ ['OS=="msvc" and clang==0', {
'msvs_precompiled_header': 'tools/msvs/pch/node_pch.h',
'msvs_precompiled_source': 'tools/msvs/pch/node_pch.cc',
'sources': [