2024-10-01 20:04:53 +00:00
|
|
|
const path = require('node:path');
|
2024-10-03 04:36:15 +00:00
|
|
|
|
2020-08-11 10:17:18 +00:00
|
|
|
const testLoadLibrary = require('./build/Release/test_module');
|
|
|
|
|
|
|
|
const lib = (() => {
|
|
|
|
switch (process.platform) {
|
|
|
|
case 'linux':
|
2024-10-01 20:04:53 +00:00
|
|
|
return path.resolve(__dirname, 'build/Release/foo.so');
|
2020-08-11 10:17:18 +00:00
|
|
|
case 'darwin':
|
2024-10-01 20:04:53 +00:00
|
|
|
return path.resolve(__dirname, 'build/Release/foo.dylib');
|
2020-08-11 10:17:18 +00:00
|
|
|
case 'win32':
|
2024-10-01 20:04:53 +00:00
|
|
|
return path.resolve(__dirname, 'build/Release/libfoo.dll');
|
2020-08-11 10:17:18 +00:00
|
|
|
default:
|
|
|
|
throw new Error('unsupported os');
|
|
|
|
}
|
|
|
|
})();
|
|
|
|
|
|
|
|
testLoadLibrary(lib);
|