Skip to content

Commit

Permalink
be able to provide a specific libmediasoup_worker.a library
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed May 17, 2024
1 parent 95b8225 commit 1fec8b9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 12 additions & 4 deletions node/workerChannel/binding.gyp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"variables": {
"mediasoup_build_type%": "Release"
"mediasoup_build_type%": "Release",
"mediasoup_worker_lib%": ""
},
"targets": [
{
Expand All @@ -15,10 +16,17 @@
"<!@(node -p \"require('node-addon-api').include\")",
"<(module_root_dir)/../../worker/include",
],
"libraries": [
"<(module_root_dir)/../../worker/out/<(mediasoup_build_type)/build/libmediasoup-worker.a"
],
'conditions': [
['mediasoup_worker_lib==""', {
"libraries": [
"<(module_root_dir)/../../worker/out/<(mediasoup_build_type)/build/libmediasoup-worker.a"
],
}, {
"libraries": [
"<(mediasoup_worker_lib)"
],
}
],
['OS=="win"', {
"libraries": [
"Ws2_32.lib", "Dbghelp.lib", "Crypt32.lib", "Userenv.lib",
Expand Down
4 changes: 4 additions & 0 deletions node/workerChannel/npm-scripts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ function buildBinding() {

process.env.GYP_DEFINES = `mediasoup_build_type=${buildType}`;

if (process.env.MEDIASOUP_WORKER_LIB) {
process.env.GYP_DEFINES += ` mediasoup_worker_lib=${process.env.MEDIASOUP_WORKER_LIB}`;
}

executeCmd(`node-gyp rebuild --${buildType.toLowerCase()} --verbose`);
}

Expand Down

0 comments on commit 1fec8b9

Please sign in to comment.