Skip to content

allow node-gyp to use open source toolchains on windows #3166

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions addon.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
'node_engine_include_dir%': 'deps/v8/include',
'node_host_binary%': 'node',
'node_with_ltcg%': 'true',
'os_type%': '<!(node -p "require(\'os\').type()")',
},
'target_defaults': {
'type': 'loadable_module',
Expand Down Expand Up @@ -165,23 +166,44 @@
]
}
}
}],
# Detect MSYS2/MinGW vs MSVC based on os.type()
[ 'os_type.startswith("MINGW")', {
# MSYS2/MinGW/GCC libraries
'libraries': [
'-lkernel32',
'-luser32',
'-lgdi32',
'-lwinspool',
'-lcomdlg32',
'-ladvapi32',
'-lshell32',
'-lole32',
'-loleaut32',
'-luuid',
'-lodbc32',
'-lDelayImp',
'-lnode',
],
}, {
# MSVC libraries (Windows_NT)
'libraries': [
'-lkernel32.lib',
'-luser32.lib',
'-lgdi32.lib',
'-lwinspool.lib',
'-lcomdlg32.lib',
'-ladvapi32.lib',
'-lshell32.lib',
'-lole32.lib',
'-loleaut32.lib',
'-luuid.lib',
'-lodbc32.lib',
'-lDelayImp.lib',
'-l"<(node_lib_file)"'
],
}]
],
'libraries': [
'-lkernel32.lib',
'-luser32.lib',
'-lgdi32.lib',
'-lwinspool.lib',
'-lcomdlg32.lib',
'-ladvapi32.lib',
'-lshell32.lib',
'-lole32.lib',
'-loleaut32.lib',
'-luuid.lib',
'-lodbc32.lib',
'-lDelayImp.lib',
'-l"<(node_lib_file)"'
],
'msvs_disabled_warnings': [
# warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>'
# needs to have dll-interface to be used by
Expand Down
Loading
Loading