|
1 | | -{ |
2 | | - "targets": [ |
3 | | - { |
4 | | - "target_name": "hamlib", |
5 | | - "sources": [ |
6 | | - "src/hamlib.cpp", |
7 | | - "src/decoder.cpp", |
8 | | - "src/addon.cpp" |
9 | | - ], |
10 | | - "include_dirs": [ |
11 | | - "include", |
12 | | - "<!@(node -p \"require('node-addon-api').include\")" |
13 | | - ], |
14 | | - "dependencies": [ |
15 | | - "<!(node -p \"require('node-addon-api').gyp\")" |
16 | | - ], |
17 | | - "defines": [ |
18 | | - "NAPI_DISABLE_CPP_EXCEPTIONS" |
19 | | - ], |
20 | | - "cflags!": [ "-fno-exceptions" ], |
21 | | - "cflags_cc!": [ "-fno-exceptions" ], |
22 | | - "conditions": [ |
23 | | - # Linux configuration |
| 1 | +{ |
| 2 | + "targets": [ |
| 3 | + { |
| 4 | + "target_name": "hamlib", |
| 5 | + "sources": [ |
| 6 | + "src/hamlib.cpp", |
| 7 | + "src/decoder.cpp", |
| 8 | + "src/addon.cpp" |
| 9 | + ], |
| 10 | + "include_dirs": [ |
| 11 | + "include", |
| 12 | + "<!@(node -p \"require('node-addon-api').include\")" |
| 13 | + ], |
| 14 | + "dependencies": [ |
| 15 | + "<!(node -p \"require('node-addon-api').gyp\")" |
| 16 | + ], |
| 17 | + "defines": [ |
| 18 | + "NAPI_DISABLE_CPP_EXCEPTIONS" |
| 19 | + ], |
| 20 | + "cflags!": [ "-fno-exceptions" ], |
| 21 | + "cflags_cc!": [ "-fno-exceptions" ], |
| 22 | + "conditions": [ |
| 23 | + # Linux configuration |
24 | 24 | ["OS==\"linux\"", { |
25 | 25 | "include_dirs": [ |
26 | 26 | "/usr/include", |
|
32 | 32 | "-lhamlib" |
33 | 33 | ], |
34 | 34 | "ldflags": [ |
35 | | - "-Wl,-rpath,\\$ORIGIN" |
| 35 | + "-Wl,-rpath,$$ORIGIN" |
36 | 36 | ] |
37 | 37 | }], |
38 | | - # macOS configuration |
| 38 | + # macOS configuration |
39 | 39 | ["OS==\"mac\"", { |
40 | 40 | "include_dirs": [ |
41 | 41 | "/usr/local/include", |
|
55 | 55 | "-Wl,-rpath,@loader_path" |
56 | 56 | ] |
57 | 57 | }], |
58 | | - # Windows configuration |
59 | | - ["OS==\"win\"", { |
60 | | - "defines": [ |
61 | | - "WIN32_LEAN_AND_MEAN", |
62 | | - "_WIN32_WINNT=0x0600" |
63 | | - ], |
64 | | - "conditions": [ |
65 | | - ["target_arch==\"x64\"", { |
66 | | - "conditions": [ |
67 | | - # Check if we're in MinGW environment (HAMLIB_ROOT is set to /mingw64) |
68 | | - ["\"<!(node -e \"console.log(process.env.HAMLIB_ROOT || '')\")\"==\"/mingw64\"", { |
69 | | - "include_dirs": [ |
70 | | - "/mingw64/include" |
71 | | - ], |
72 | | - "library_dirs": [ |
73 | | - "/mingw64/lib" |
74 | | - ], |
75 | | - "libraries": [ |
76 | | - "-lhamlib", |
77 | | - "-lws2_32", |
78 | | - "-lwinmm" |
79 | | - ], |
80 | | - "cflags": [ |
81 | | - "-I/mingw64/include" |
82 | | - ], |
83 | | - "ldflags": [ |
84 | | - "-L/mingw64/lib", |
85 | | - "-static-libgcc", |
86 | | - "-static-libstdc++" |
87 | | - ] |
88 | | - }, { |
89 | | - # Traditional Windows build with Visual C++ |
| 58 | + # Windows configuration |
| 59 | + ["OS==\"win\"", { |
| 60 | + "defines": [ |
| 61 | + "WIN32_LEAN_AND_MEAN", |
| 62 | + "_WIN32_WINNT=0x0600" |
| 63 | + ], |
| 64 | + "conditions": [ |
| 65 | + ["target_arch==\"x64\"", { |
| 66 | + "conditions": [ |
| 67 | + # Check if we're in MinGW environment (HAMLIB_ROOT is set to /mingw64) |
| 68 | + ["\"<!(node -e \"console.log(process.env.HAMLIB_ROOT || '')\")\"==\"/mingw64\"", { |
| 69 | + "include_dirs": [ |
| 70 | + "/mingw64/include" |
| 71 | + ], |
| 72 | + "library_dirs": [ |
| 73 | + "/mingw64/lib" |
| 74 | + ], |
| 75 | + "libraries": [ |
| 76 | + "-lhamlib", |
| 77 | + "-lws2_32", |
| 78 | + "-lwinmm" |
| 79 | + ], |
| 80 | + "cflags": [ |
| 81 | + "-I/mingw64/include" |
| 82 | + ], |
| 83 | + "ldflags": [ |
| 84 | + "-L/mingw64/lib", |
| 85 | + "-static-libgcc", |
| 86 | + "-static-libstdc++" |
| 87 | + ] |
| 88 | + }, { |
| 89 | + # Traditional Windows build with Visual C++ |
90 | 90 | "include_dirs": [ |
91 | 91 | # Try environment variable in different formats |
92 | 92 | "<!(node -e \"console.log((process.env.HAMLIB_ROOT || 'C:/hamlib') + '/include')\")", |
|
147 | 147 | }] |
148 | 148 | ] |
149 | 149 | }] |
150 | | - ] |
151 | | - }] |
152 | | - ] |
153 | | - } |
154 | | - ] |
| 150 | + ] |
| 151 | + }] |
| 152 | + ] |
| 153 | + } |
| 154 | + ] |
155 | 155 | } |
0 commit comments