forbocai 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/check-cmake.js +9 -9
package/package.json
CHANGED
package/scripts/check-cmake.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// Preinstall check: CMake is required for node-llama-cpp
|
|
3
|
-
//
|
|
2
|
+
// Preinstall check (Windows only): CMake is required for node-llama-cpp on Windows.
|
|
3
|
+
// On macOS/Linux we skip this so install works as before (prebuilt binaries or system cmake).
|
|
4
4
|
|
|
5
|
-
const {
|
|
5
|
+
const { spawnSync } = require('child_process');
|
|
6
6
|
const isWindows = process.platform === 'win32';
|
|
7
7
|
|
|
8
|
+
if (!isWindows) {
|
|
9
|
+
process.exit(0);
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
function cmakeAvailable() {
|
|
9
13
|
try {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return r.status === 0;
|
|
13
|
-
}
|
|
14
|
-
execSync('which cmake', { stdio: 'pipe' });
|
|
15
|
-
return true;
|
|
14
|
+
const r = spawnSync('cmake', ['--version'], { stdio: 'pipe', shell: true });
|
|
15
|
+
return r.status === 0;
|
|
16
16
|
} catch {
|
|
17
17
|
return false;
|
|
18
18
|
}
|