Skip to content

Commit

Permalink
chore(build): fix Windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Sep 7, 2024
1 parent b3f78e6 commit f8b08e7
Showing 1 changed file with 29 additions and 16 deletions.
45 changes: 29 additions & 16 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,33 @@
{
"target_name": "libpg_query",
"type": "none",
"actions": [
{
"action_name": "build_libpg_query",
"inputs": [],
"outputs": [
"libpg_query/libpg_query.a"
"actions": [{
"action_name": "build_libpg_query",
"inputs": [],
"outputs": ["libpg_query/libpg_query.a"],
"conditions": [
[
'OS=="win"',
{
"action": [
"cmd",
"/c",
"cd /d libpg_query && MAKEFLAGS=-w nmake /F Makefile.msvc build",
]
},
],
"action": [
"sh",
"-c",
"echo \"PWD => $(pwd)\" && find . -type f -not -path '*/.*' && cd libpg_query && MAKEFLAGS=-w make build"
]
}
]
[
'OS!="win"',
{
"action": [
"sh",
"-c",
"cd libpg_query && MAKEFLAGS=-w make build",
]
},
],
],
}],
},
{
"target_name": "queryparser",
Expand All @@ -45,7 +58,7 @@
],
"conditions": [
[
"OS==\"linux\"",
'OS=="linux"',
{
"libraries": [
"-L<!(pwd)/libpg_query",
Expand All @@ -54,7 +67,7 @@
}
],
[
"OS==\"mac\"",
'OS=="mac"',
{
"libraries": [
"-L<!(pwd)/libpg_query",
Expand All @@ -68,7 +81,7 @@
}
],
[
"OS==\"win\"",
'OS=="win"',
{
"link_settings": {
"library_dirs": [
Expand Down

0 comments on commit f8b08e7

Please sign in to comment.