Skip to content

Commit

Permalink
adding windows arm64, modifying native library resolution logic
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Jun 1, 2024
1 parent 22aab6b commit 6983039
Show file tree
Hide file tree
Showing 25 changed files with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions lib/edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ var fs = require('fs')
, builtEdge = path.resolve(__dirname, '../build/Release/' + (process.env.EDGE_USE_CORECLR || !fs.existsSync(path.resolve(__dirname, '../build/Release/edge_nativeclr.node')) ? 'edge_coreclr.node' : 'edge_nativeclr.node'))
, edge;

var versionMap = [
[ /^16\./, '16.20.2' ],
[ /^18\./, '18.19.1' ],
[ /^20\./, '20.11.1' ],
[ /^22\./, '22.1.0' ],
];


function determineVersion() {
for (var i in versionMap) {
if (process.versions.node.match(versionMap[i][0])) {
return versionMap[i][1];
}
}
var source = path.resolve(__dirname, `native/${process.platform}/${process.arch}`)
const version = `${process.versions.node.split(".")[0]}`;

const getDirectories = source =>
fs.readdirSync(source, { withFileTypes: true })
.filter(dir => dir.isDirectory() && dir.name.startsWith(version))
.map(dir => dir.name)

var nativeModulePath = getDirectories(source).shift()

if(nativeModulePath) return nativeModulePath;

throw new Error('The edge module has not been pre-compiled for node.js version ' + process.version +
'. You must build a custom version of edge.node. Please refer to https:/agracio/edge-js ' +
Expand Down
Binary file added lib/native/win32/arm64/20.14.0/edge_coreclr.node
Binary file not shown.
Binary file not shown.
Binary file added lib/native/win32/arm64/22.2.0/edge_coreclr.node
Binary file not shown.
Binary file not shown.
Binary file added lib/native/win32/arm64/concrt140.dll
Binary file not shown.
Binary file added lib/native/win32/arm64/msvcp140.dll
Binary file not shown.
Binary file added lib/native/win32/arm64/vccorlib140.dll
Binary file not shown.
Binary file added lib/native/win32/arm64/vcruntime140.dll
Binary file not shown.
Binary file removed lib/native/win32/ia32/20.11.1/edge_coreclr.node
Binary file not shown.
Binary file removed lib/native/win32/ia32/20.11.1/edge_nativeclr.node
Binary file not shown.
Binary file added lib/native/win32/ia32/20.14.0/edge_coreclr.node
Binary file not shown.
Binary file not shown.
Binary file removed lib/native/win32/ia32/22.1.0/edge_coreclr.node
Binary file not shown.
Binary file removed lib/native/win32/ia32/22.1.0/edge_nativeclr.node
Binary file not shown.
Binary file added lib/native/win32/ia32/22.2.0/edge_coreclr.node
Binary file not shown.
Binary file added lib/native/win32/ia32/22.2.0/edge_nativeclr.node
Binary file not shown.
Binary file removed lib/native/win32/x64/20.11.1/edge_coreclr.node
Binary file not shown.
Binary file removed lib/native/win32/x64/20.11.1/edge_nativeclr.node
Binary file not shown.
Binary file added lib/native/win32/x64/20.14.0/edge_coreclr.node
Binary file not shown.
Binary file added lib/native/win32/x64/20.14.0/edge_nativeclr.node
Binary file not shown.
Binary file removed lib/native/win32/x64/22.1.0/edge_coreclr.node
Binary file not shown.
Binary file removed lib/native/win32/x64/22.1.0/edge_nativeclr.node
Binary file not shown.
Binary file added lib/native/win32/x64/22.2.0/edge_coreclr.node
Binary file not shown.
Binary file added lib/native/win32/x64/22.2.0/edge_nativeclr.node
Binary file not shown.

0 comments on commit 6983039

Please sign in to comment.