Skip to content

Commit

Permalink
Second try: this should work multiplatform.
Browse files Browse the repository at this point in the history
  • Loading branch information
aleyush committed Apr 19, 2013
1 parent 528c608 commit 552a844
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions binding.gyp
Expand Up @@ -3,28 +3,34 @@
{
'target_name': 'binding',
'conditions' : [
['OS=="win" and "<!@(cmd /C where /Q pg_config || echo n)"!="n"',
{
'sources': ['src/binding.cc'],
'include_dirs': ['<!@(pg_config --includedir)'],
'libraries' : ['libpq.lib'],
'msvs_settings': {
'VCLinkerTool' : {
'AdditionalLibraryDirectories' : [
'<!@(pg_config --libdir)\\'
]
},
}
}
],

['OS!="win"',
{
'sources': ['src/binding.cc'],
'include_dirs': ['<!@(pg_config --includedir)'],
'libraries' : ['-lpq -L<!@(pg_config --libdir)']
}
]
['OS=="win"', {
'conditions' : [
['"<!@(cmd /C where /Q pg_config || echo n)"!="n"',
{
'sources': ['src/binding.cc'],
'include_dirs': ['<!@(pg_config --includedir)'],
'libraries' : ['libpq.lib'],
'msvs_settings': {
'VCLinkerTool' : {
'AdditionalLibraryDirectories' : [
'<!@(pg_config --libdir)\\'
]
},
}
}
]
]
}, { # OS!="win"
'conditions' : [
['"y"!="n"', # ToDo: add pg_config existance condition that works on linux
{
'sources': ['src/binding.cc'],
'include_dirs': ['<!@(pg_config --includedir)'],
'libraries' : ['-lpq -L<!@(pg_config --libdir)']
}
]
]
}]
]
}
]
Expand Down

0 comments on commit 552a844

Please sign in to comment.