Skip to content

Commit 4d1ae60

Browse files
amikhalevMinggang Wang
authored andcommitted
Fix build in cases where AMENT_PREFIX_PATH has more than two items (#517)
Fix cases where AMENT_PREFIX_PATH has >2 items The regular expression transform on AMENT_PREFIX_PATH would only replace the first ':' in many places, resulting in it not using the remaining entries if there are more than two. '/g' makes the regular expression 'global' so it will replace more than one occurrence per line. Fix #521
1 parent 4476b1b commit 4d1ae60

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ Special thanks to the people who contribute.
177177

178178
* [martins-mozeiko](https://github.com/martins-mozeiko)
179179
* [Teo Koon Peng](https://github.com/koonpeng)
180+
* [Alex Mikhalev](https://github.com/amikhalev)
180181

181182
## License
182183

binding.gyp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252
'-std=c++14'
5353
],
5454
'include_dirs': [
55-
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/, '/include/ ') + '/include/')\")",
55+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/ ') + '/include/')\")",
5656
],
5757
'library_dirs': [
58-
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/, '/lib/ ') + '/lib/')\")",
58+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/lib/ ') + '/lib/')\")",
5959
],
6060
}
6161
],
@@ -70,7 +70,7 @@
7070
],
7171
'include_dirs': [
7272
'./src/third_party/dlfcn-win32/',
73-
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/, '\\\include ').replace(/\\\/g, '/') + '/include')\")",
73+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '\\\include ').replace(/\\\/g, '/') + '/include')\")",
7474
],
7575
'sources': [
7676
'./src/third_party/dlfcn-win32/dlfcn.c',
@@ -81,7 +81,7 @@
8181
},
8282
'VCLinkerTool': {
8383
'AdditionalDependencies': ['psapi.lib'],
84-
'AdditionalLibraryDirectories': ["<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/, '\\\lib ').replace(/\\\/g, '/') + '/lib')\")",],
84+
'AdditionalLibraryDirectories': ["<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '\\\lib ').replace(/\\\/g, '/') + '/lib')\")",],
8585
}
8686
}
8787
}
@@ -93,10 +93,10 @@
9393
'OS_MACOS'
9494
],
9595
'include_dirs': [
96-
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/, '/include/ ') + '/include/')\")",
96+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/ ') + '/include/')\")",
9797
],
9898
'library_dirs': [
99-
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/, '/lib/ ') + '/lib/')\")",
99+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/lib/ ') + '/lib/')\")",
100100
],
101101
'xcode_settings': {
102102
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',

0 commit comments

Comments
 (0)