Skip to content

Commit ceeeb34

Browse files
committed
Add C/C++ code, configure node-gyp & scripts
1 parent 81790ad commit ceeeb34

17 files changed

+2943
-63
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.idea/
22
node_modules/
33
build/
4+
key.txt
5+
*.node

binding.gyp

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
'target_defaults': {
3+
'defines': [
4+
'CBC=1',
5+
'AES256=1'
6+
]
7+
},
8+
'targets': [
9+
{
10+
'target_name': 'main',
11+
'sources': [
12+
'src/encryption/main.cpp',
13+
'src/encryption/encoding/base64.c',
14+
'src/encryption/aes/aes.c'
15+
],
16+
'includes': [
17+
'./common.gypi'
18+
]
19+
},
20+
{
21+
'target_name': 'renderer',
22+
'sources': [
23+
'src/encryption/main.cpp',
24+
'src/encryption/encoding/base64.c',
25+
'src/encryption/aes/aes.c'
26+
],
27+
'includes': [
28+
'./common.gypi'
29+
],
30+
'defines':[
31+
'_TARGET_ELECTRON_RENDERER_'
32+
]
33+
},
34+
]
35+
}

common.gypi

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
'cflags!': ['-fno-exceptions'],
3+
'cflags_cc!': ['-fno-exceptions'],
4+
'include_dirs': [
5+
"<!(node -p \"require('node-addon-api').include_dir\")"
6+
],
7+
'conditions': [
8+
['OS=="mac"', {
9+
'cflags+': ['-fvisibility=hidden'],
10+
'xcode_settings': {
11+
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
12+
'CLANG_CXX_LIBRARY': 'libc++',
13+
'MACOSX_DEPLOYMENT_TARGET': '10.7',
14+
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
15+
}
16+
}],
17+
['OS=="win"', {
18+
'msvs_settings': {
19+
'VCCLCompilerTool': {
20+
'ExceptionHandling': 1,
21+
'AdditionalOptions': ['/source-charset:utf-8']
22+
},
23+
},
24+
'defines':[
25+
'_HAS_EXCEPTIONS=1',
26+
'NOMINMAX'
27+
]
28+
}]
29+
]
30+
}

0 commit comments

Comments
 (0)