www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - dub, copyFiles and linux

reply Andre <andre s-e-a-p.de> writes:
Hi,

I created a library which uses some shared objects. The dub.json 
looks like this:
{
	"name": "sec",
	"configurations": [
		{
			"name": "debug",
			"targetType": "library",
			"copyFiles":["lib/libssoext.so","lib/librypto.so"],
			"libs-posix": ["ssoext"],
			"lflags":["-L./.","-rpath=./."],
		}
	]
}
Within my project folder, there is a folder lib with the 2 so 
files.

Within my application project, I use this library. The dub.sdl 
looks like this:
name "demo"
targetName "app"
dependency "sec" version=">=0.0.1"

I would expect, while dub is compiling my application project, 
the 2 libs are
copied to my application folder. But that is not working.

I can't see why it is working with vibe-d projects (openssl 
libraries copied to application folder) but not for my project. 
There is no console output "copying files for..." while using dub 
for my application project.
What is wrong?

Kind regards
André
Mar 30 2016
parent reply Andre <andre s-e-a-p.de> writes:
On Thursday, 31 March 2016 at 04:57:01 UTC, Andre wrote:

 I can't see why it is working with vibe-d projects (openssl 
 libraries copied to application folder) but not for my project. 
 There is no console output "copying files for..." while using 
 dub for my application project.
 What is wrong?

 Kind regards
 André
OK, I see copying files is triggered after the linking process. That is bad...
Mar 30 2016
parent Andre <andre s-e-a-p.de> writes:
OK solved;)
Shared libraries doesn't need to be mentioned in libs section in 
dub.
Therefore copying after the linking is correct and is working 
fine.

Kind regards
André
Mar 30 2016