www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - dub subpackage output to shared lib not working

reply Tofu Ninja <joeyemmons yahoo.com> writes:
Trying to get a dub sub package to output as a shared lib but for 
some reason I can only get it to output as a static lib.

dub.json
---
{
	"name": "tofueng",
	"targetType": "executable",
	"targetPath" : "game",
	"sourcePaths": ["eng"],
	"importPaths": ["eng"],

	"dependencies": {
		"tofueng:test": "*",
	},
	"subPackages": [
		{
			"name": "test",
			"targetType": "dynamicLibrary",
			"targetPath" : "game/libs",
			"sourcePaths": ["com/test"],
			"importPaths": ["com/test"]
		}
	]
}
---

Get tofueng_test.lib instead of tofueng_test.dll. If I try to 
build the sub package directly it builds the dll. What am I doing 
wrong?
Jan 22 2017
parent reply Tofu Ninja <joeyemmons yahoo.com> writes:
On Sunday, 22 January 2017 at 08:16:49 UTC, Tofu Ninja wrote:
 Trying to get a dub sub package to output as a shared lib but 
 for some reason I can only get it to output as a static lib.

 dub.json
 ---
 {
 	"name": "tofueng",
 	"targetType": "executable",
 	"targetPath" : "game",
 	"sourcePaths": ["eng"],
 	"importPaths": ["eng"],

 	"dependencies": {
 		"tofueng:test": "*",
 	},
 	"subPackages": [
 		{
 			"name": "test",
 			"targetType": "dynamicLibrary",
 			"targetPath" : "game/libs",
 			"sourcePaths": ["com/test"],
 			"importPaths": ["com/test"]
 		}
 	]
 }
 ---

 Get tofueng_test.lib instead of tofueng_test.dll. If I try to 
 build the sub package directly it builds the dll. What am I 
 doing wrong?
Is this not doable?
Jan 26 2017
parent reply Tofu Ninja <joeyemmons yahoo.com> writes:
On Thursday, 26 January 2017 at 18:00:57 UTC, Tofu Ninja wrote:
 Is this not doable?
I guess an alternative question, is there any way to have multiple binaries(an executable and a bunch of shared libs) built from a single dub package? Or should I just give up on trying to use dub for this...
Jan 26 2017
parent reply Tofu Ninja <joeyemmons yahoo.com> writes:
On Thursday, 26 January 2017 at 18:10:12 UTC, Tofu Ninja wrote:
 On Thursday, 26 January 2017 at 18:00:57 UTC, Tofu Ninja wrote:
 Is this not doable?
I guess an alternative question, is there any way to have multiple binaries(an executable and a bunch of shared libs) built from a single dub package? Or should I just give up on trying to use dub for this...
This [https://github.com/dlang/dub/issues/665] seems to be somewhat related to what I am trying to do, not sure if this got addressed at all though.
Jan 26 2017
parent reply Tofu Ninja <joeyemmons yahoo.com> writes:
On Thursday, 26 January 2017 at 18:26:27 UTC, Tofu Ninja wrote:
 On Thursday, 26 January 2017 at 18:10:12 UTC, Tofu Ninja wrote:
 On Thursday, 26 January 2017 at 18:00:57 UTC, Tofu Ninja wrote:
 Is this not doable?
I guess an alternative question, is there any way to have multiple binaries(an executable and a bunch of shared libs) built from a single dub package? Or should I just give up on trying to use dub for this...
This [https://github.com/dlang/dub/issues/665] seems to be somewhat related to what I am trying to do, not sure if this got addressed at all though.
Actually.. if I do dub describe on the root package it lists both the exe and the lib as targets but the build settings for the lib has "targetType": 6 which according to dub/source/dub/compilers/buildsettings.d is staticLibrary... is this a bug or what?
Jan 26 2017
parent Tofu Ninja <joeyemmons yahoo.com> writes:
On Thursday, 26 January 2017 at 19:01:41 UTC, Tofu Ninja wrote:
 Actually.. if I do dub describe on the root package it lists 
 both the exe and the lib as targets but the build settings for 
 the lib has "targetType": 6 which according to 
 dub/source/dub/compilers/buildsettings.d is staticLibrary... is 
 this a bug or what?
omfg.... I should have read the build output more closely...right at the top "Dynamic libraries are not yet supported as dependencies - building as static library."... welp guess I give up then, 4 days waisted.
Jan 26 2017