简体   繁体   中英

Automatically copy dependencies in DUB for Derelict

I'm creating a Derelict application and apparently derelict needs the shared libraries to be in the root path. Is there a way to do this using DUB, without copying the files over manually into the ./bin folder? (Just have them get copied when building automatically)

Also I am assuming the .so files for Linux systems will have to be in the binary folder too. I know there is "copyFiles" but where will the files get copied from, where will they get copied to? Is this cross-platform?

On Linux you'd normally just have the necessary libraries installed system wide using your distribution's package manager.

On Windows DLLs are often placed in the application's folder and copyFiles exists for exactly this reason.

This is what I have in my DUB package.json for an application that uses Derelict GLFW and Derelict FreeImage:

"copyFiles": [
    "lib/glfw3.dll",
    "lib/FreeImage.dll"
]

The files are copied from the lib folder in the root of my project and they are copied to the random temporary folder dub uses for building (I imagine on linux it's somewhere in /tmp and on Windows it's in somewhere like %APPDATA%\\Temp\\dub).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM