Skip to content

Commit

Permalink
build: install both addon and plugin during npm install
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Nov 26, 2017
1 parent a283c85 commit d7f5d93
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ build/
out/
npm-debug.log
node_modules/

# generated by scripts/configure.js
options.gypi
.project
addon.node
25 changes: 16 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,26 @@ _travis:
TEST_LLDB_BINARY=`which lldb-3.6` npm test

clean:
rm -rf out
rm -rf build
rm -rf options.gypi
rm -rf lldb
rm -rf addon.node llnode.so
$(RM) -r out
$(RM) -r build
$(RM) options.gypi
$(RM) lldb
$(RM) llnode.so llnode.dylib

addon:
configure: scripts/configure.js
node scripts/configure.js

addon: configure
node-gyp rebuild

plugin:
node ./scripts/configure.js
plugin: configure
./gyp_llnode
$(MAKE) -C out/

.PHONY: all addon clean plugin format
# configure is run during preinstall
npm-build:
./gyp_llnode
$(MAKE) -C out/
node-gyp rebuild

.PHONY: all addon clean plugin format npm-build
4 changes: 2 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"xcode_settings": {
"OTHER_LDFLAGS": [
"-F<(mac_shared_frameworks)",
"-Wl,-rpath,<(mac_shared_frameworks)",
"-framework LLDB",
"-Wl,-rpath,<(mac_shared_frameworks)",
"-framework LLDB",
],
},
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"//": "(Blame C++)",
"scripts": {
"preinstall": "node scripts/configure.js",
"install": "./gyp_llnode && ( gmake -C out/ || make -C out/ )",
"install": "( gmake npm-build || make npm-build )",
"postinstall": "node scripts/cleanup.js",
"test": "tape test/*-test.js"
},
Expand Down
6 changes: 3 additions & 3 deletions scripts/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ function getLinuxLib(version) {
const libDir = child_process.execFileSync('llvm-config-' + version,
['--libdir']).toString().trim();
const soPath = path.join(libDir, `liblldb-${version}.so`);
const stat = fs.lstatSync(soPath);
if (stat.isFile() || stat.isSymbolicLink()) {
const stat = fs.statSync(soPath);
if (stat.isFile()) {
return {
buildDir: path.dirname(libDir),
lib: `lldb-${version}`
Expand All @@ -353,7 +353,7 @@ function getLinuxLib(version) {
console.log(err);
// Return undefined, we will download the headers.
}
// On Redhat lib are just installed in /usr/lib
// On Redhat libs are just installed in /usr/lib
if (fs.existsSync('/usr/lib/lldblldb.so')) {
return {
buildDir: '/usr',
Expand Down

0 comments on commit d7f5d93

Please sign in to comment.