I'm aiming to create a project with multiple sub-packages using Dub. This seems to work for the most part, except in the case of Linux, I need to manually set LD_LIBRARY_PATH in the command line since the compiled executables don't look in the current directory:
D_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/build" ./build/app
Is there anything I need to change for that to work? Are there any best practices I need to more closely follow? I've pieced this together looking at some other issues here.
dub.json
{
"name": "example",
"targetType": "none",
"dependencies": {
"example:app": "*"
},
"subPackages": [
"packages/common",
"packages/app"
]
}
packages/common/dub.json
{
"name": "common",
"targetType": "dynamicLibrary",
"targetPath": "../../build"
}
packages/app/dub.json
{
"name": "app",
"targetType": "executable",
"targetName": "app",
"targetPath": "../../build",
"dependencies": {
"example:common": "*"
}
}
I'm aiming to create a project with multiple sub-packages using Dub. This seems to work for the most part, except in the case of Linux, I need to manually set
LD_LIBRARY_PATHin the command line since the compiled executables don't look in the current directory:D_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/build" ./build/appIs there anything I need to change for that to work? Are there any best practices I need to more closely follow? I've pieced this together looking at some other issues here.
dub.json{ "name": "example", "targetType": "none", "dependencies": { "example:app": "*" }, "subPackages": [ "packages/common", "packages/app" ] }packages/common/dub.json{ "name": "common", "targetType": "dynamicLibrary", "targetPath": "../../build" }packages/app/dub.json{ "name": "app", "targetType": "executable", "targetName": "app", "targetPath": "../../build", "dependencies": { "example:common": "*" } }