How to better organize dub project to get 3 exe from same codebase?
Zardoz via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Feb 25 11:07:55 PST 2016
On Thursday, 25 February 2016 at 18:57:08 UTC, Suliman wrote:
> I have got 3 small projects that have shared code base. At
> compile time they use few same classes. On runtime they use
> same config file. How to better to organize work with dub?
Try with subpacjages like I did :
name "dedcpu"
authors "Luis Panadero GuardeƱo"
targetType "none"
license "BSD 3-clause"
description "DCPU-16 tools"
subPackage {
name "lem1802"
description "Visual LEM1802 font editor"
excludedSourceFiles "src/bconv.d"
excludedSourceFiles "src/ddis.d"
targetType "executable"
targetName "lem1802"
libs "gtkd" platform="windows"
configuration "nogtk" {
platforms "windows"
}
configuration "gtk" {
platforms "posix"
dependency "gtk-d:gtkd" version="~>3.2.0"
}
}
subPackage {
name "bconv"
description "Binary file conversor. Converts between different
data files for DCPU-16 emulators"
targetType "executable"
targetName "bconv"
excludedSourceFiles "src/lem1802_fontview.d"
excludedSourceFiles "src/ddis.d"
excludedSourceFiles "src/ui/*"
}
subPackage {
name "ddis"
description "Dis-assembler for DCPU-16. Generates a DCPU-16
assembly dump from a binary file."
targetType "executable"
targetName "ddis"
excludedSourceFiles "src/lem1802_fontview.d"
excludedSourceFiles "src/bconv.d"
excludedSourceFiles "src/ui/*"
}
https://github.com/Zardoz89/DEDCPU-16/blob/master/dub.sdl
More information about the Digitalmars-d-learn
mailing list