Fix node-gyp rebuild script on Windows (#13)

* build-srt-sdk: add console log line about platform detection

* node-gyp rebuild: rm -j with num-cpus eval'd from shell (breaks Windows)
This commit is contained in:
Stephan Hesse 2020-10-26 16:54:20 +01:00 committed by GitHub
parent b7d33bb431
commit ef2795cb52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -6,7 +6,8 @@
"scripts": {
"install": "npm run build-srt && npm run rebuild",
"build-srt": "node scripts/build-srt-sdk.js",
"rebuild": "node-gyp rebuild -j $(echo \"console.log(require('os').cpus().length)\" | node)",
"rebuild": "node-gyp rebuild",
"rebuild-jn": "node-gyp rebuild -j $(echo \"console.log(require('os').cpus().length)\" | node)",
"clean": "node-gyp clean",
"test": "jasmine",
"test-jest": "jest --runInBand --detectOpenHandles",

View file

@ -44,10 +44,12 @@ if (!fs.existsSync(srtSourcePath)) {
}
function build() {
console.log('Building SRT SDK and prerequisites')
if (process.platform === "win32") {
console.log('Building SRT SDK and prerequisites for current platform:', process.platform);
switch (process.platform) {
case "win32":
buildWin32();
} else {
break;
default:
buildNx();
}
}