Skip to content

Commit 528c608

Browse files
committed
Check if pg_config exists on windows.
1 parent d51994c commit 528c608

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

binding.gyp

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,29 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'sources': [
6-
'src/binding.cc'
7-
],
85
'conditions' : [
9-
['OS=="win"', {
10-
'include_dirs': ['<!@(pg_config --includedir)'],
11-
'libraries' : ['libpq.lib'],
12-
'msvs_settings': {
13-
'VCLinkerTool' : {
14-
'AdditionalLibraryDirectories' : [
15-
'<!@(pg_config --libdir)\\'
16-
]
17-
},
6+
['OS=="win" and "<!@(cmd /C where /Q pg_config || echo n)"!="n"',
7+
{
8+
'sources': ['src/binding.cc'],
9+
'include_dirs': ['<!@(pg_config --includedir)'],
10+
'libraries' : ['libpq.lib'],
11+
'msvs_settings': {
12+
'VCLinkerTool' : {
13+
'AdditionalLibraryDirectories' : [
14+
'<!@(pg_config --libdir)\\'
15+
]
16+
},
17+
}
1818
}
19-
}, { # OS!="win"
20-
'include_dirs': ['<!@(pg_config --includedir)'],
21-
'libraries' : ['-lpq -L<!@(pg_config --libdir)']
22-
}]
19+
],
20+
21+
['OS!="win"',
22+
{
23+
'sources': ['src/binding.cc'],
24+
'include_dirs': ['<!@(pg_config --includedir)'],
25+
'libraries' : ['-lpq -L<!@(pg_config --libdir)']
26+
}
27+
]
2328
]
2429
}
2530
]

0 commit comments

Comments
 (0)