Skip to content

Commit

Permalink
new gyp required for electron v20 and v21 - see comments within
Browse files Browse the repository at this point in the history
  • Loading branch information
TimelordUK committed Oct 4, 2022
1 parent 9f68c16 commit 6b90f15
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions binding.gyp
Expand Up @@ -4,15 +4,18 @@
'OS=="mac"', {
'variables': {
'arch%': '<!(uname -m)',
"cflags_cpp" : "gnu++17",
}
},
'OS=="linux"', {
'variables': {
'arch%': '<!(uname -m)',
"cflags_cpp" : "-std=c++17",
'arch%': '<!(uname -m)',
}
},
'OS=="win"', {
'variables': {
"cflags_cpp" : "-std:=c++17",
'arch%': '<!(echo %PROCESSOR_ARCHITECTURE%)'
}
}
Expand Down Expand Up @@ -74,15 +77,26 @@
'actions': [
{
'action_name': 'print_variables',
'action': ['echo', 'arch: <(arch) | link_path: <(link_path) | msodbcsql <(msodbcsql) | fileset <(fileset)'],

'action': ['echo', 'cflags_cpp <(cflags_cpp) | arch: <(arch) | link_path: <(link_path) | msodbcsql <(msodbcsql) | fileset <(fileset)'],
'inputs': [],
'outputs': [
"<!@(node -p \"'<(fileset)'.split(' ')[0]\")"
],
#'outputs': ['src/ConnectionHandles.cpp']
}
],
#
# currently for electron v20+ manually set the package.json
# for node_modules/prebuild dependencies to else code will not
# compile - need to raise PR for prebuild
# cat .\package.json | grep gyp
# "node-gyp": "^9.1.0",
# "nw-gyp": "^3.6.3",
# prebuilds\msnodesqlv8-v2.6.0-electron-v103-win32-x64.tar.gz
# also patch nan with https://github.com/VerteDinde/nan/tree/deprecate_accessor_signature
# whilst the PR is pending - this is only needed for electron v20 and
# above
#
'conditions': [
['target < "13.0"', {
'defines': [
Expand Down Expand Up @@ -112,10 +126,8 @@
'defines': [
'LINUX_BUILD',
'UNICODE'
],
'cflags_cc': [
'-std=c++17'
],
'cflags_cc': ['<(cflags_cpp)'],
'include_dirs': [
'/usr/include/',
'/opt/microsoft/<(msodbcsql)/include/',
Expand All @@ -132,10 +144,10 @@
'defines': [
'LINUX_BUILD',
'UNICODE'
],
'cflags_cc': [
'-std=c++17'
],
'xcode_settings': {
'CLANG_CXX_LANGUAGE_STANDARD': '<(cflags_cpp)'
},
'include_dirs': [
'/usr/local/opt/<(msodbcsql)/include/',
'/usr/local/opt/<(msodbcsql)/include/<(msodbcsql)/',
Expand Down

0 comments on commit 6b90f15

Please sign in to comment.