Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up multiple subpackages #3003

Open
alanondra opened this issue Mar 7, 2025 · 1 comment
Open

Setting up multiple subpackages #3003

alanondra opened this issue Mar 7, 2025 · 1 comment

Comments

@alanondra
Copy link

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": "*"
	}
}
@rikkimax
Copy link
Contributor

rikkimax commented Mar 7, 2025

#2718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants