electron/spec-main/fixtures/native-addon/uv-dlopen/index.js
Teo Koon Peng 14aba3f0de
fix: export libuv symbols (#24659)
* fix: export libuv symbols

* add test for linux and windows

* mac linker flags

* assuming same foo.so path for macos

* use --whole-archive flag for mac as well

* use force_load for mac

* refactor: use napi c api directly

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-08-11 19:17:18 +09:00

16 lines
415 B
JavaScript

const testLoadLibrary = require('./build/Release/test_module');
const lib = (() => {
switch (process.platform) {
case 'linux':
return `${__dirname}/build/Release/foo.so`;
case 'darwin':
return `${__dirname}/build/Release/foo.dylib`;
case 'win32':
return `${__dirname}/build/Release/libfoo.dll`;
default:
throw new Error('unsupported os');
}
})();
testLoadLibrary(lib);