Skip to content

Commit

Permalink
Add C/C++ code, configure node-gyp & scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeyax committed May 7, 2022
1 parent 81790ad commit ceeeb34
Show file tree
Hide file tree
Showing 17 changed files with 2,943 additions and 63 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea/
node_modules/
build/
key.txt
*.node
35 changes: 35 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
'target_defaults': {
'defines': [
'CBC=1',
'AES256=1'
]
},
'targets': [
{
'target_name': 'main',
'sources': [
'src/encryption/main.cpp',
'src/encryption/encoding/base64.c',
'src/encryption/aes/aes.c'
],
'includes': [
'./common.gypi'
]
},
{
'target_name': 'renderer',
'sources': [
'src/encryption/main.cpp',
'src/encryption/encoding/base64.c',
'src/encryption/aes/aes.c'
],
'includes': [
'./common.gypi'
],
'defines':[
'_TARGET_ELECTRON_RENDERER_'
]
},
]
}
30 changes: 30 additions & 0 deletions common.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
'cflags!': ['-fno-exceptions'],
'cflags_cc!': ['-fno-exceptions'],
'include_dirs': [
"<!(node -p \"require('node-addon-api').include_dir\")"
],
'conditions': [
['OS=="mac"', {
'cflags+': ['-fvisibility=hidden'],
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
}
}],
['OS=="win"', {
'msvs_settings': {
'VCCLCompilerTool': {
'ExceptionHandling': 1,
'AdditionalOptions': ['/source-charset:utf-8']
},
},
'defines':[
'_HAS_EXCEPTIONS=1',
'NOMINMAX'
]
}]
]
}
Loading

0 comments on commit ceeeb34

Please sign in to comment.