-
-
Notifications
You must be signed in to change notification settings - Fork 230
Cookbook
Martin Nowak edited this page Feb 18, 2015
·
20 revisions
- Creating windows package that has 32 and 64-bit dlls
- Working with submodules or packages that are not in the registry
###Creating windows package that has 32 and 64-bit dlls
-
Create
lib
andlib64
folders in your project root (the same folder asdub.json
) -
Put your 32-bit dll files in a
lib
folder and 64-bit dlls inlib64
Dub offers copyFiles build setting that we will use to get things done. This option allows to copy files to the applications directory. Also this option can have platform specific suffixes, which we will use to copy specific files to each platform. -
Put these lines in your dub.json. They will copy every
.dll
file found in lib folder into application folder.
"copyFiles-windows-x86" : ["lib/*.dll"],
"copyFiles-windows-x86_64" : ["lib64/*.dll"],
-
Final folder structure:
project dub.json /lib freetype.dll, etc. /lib64 freetype.dll, etc. 64-bit version
###Working with submodules or packages that are not in the registry
It is a common practice to either have a project as a git submodule of a master project, or to use an unregistered project as a dependency for development.
In this setup, setting the project to depend on a project at a given path, rather than looking up the repository, can come handy.
Here's an example of such a package:
{ "name": "dlang-org", "dependencies": [ "libddoc": { "path": "./libddoc" }, "libdparse": { "path": "./libdparse" } ] }