SiegeLord / DAllegro5

D binding to the Allegro5 game development library
Other
42 stars 15 forks source link

Fix up dub package #18

Closed rcorre closed 9 years ago

rcorre commented 9 years ago

When I tried to use DAllegro as a dub package a few things went wrong:

I didn't catch these before when I was just using a local dub package. Also, I believe dub.json is now preferred over package.json

SiegeLord commented 9 years ago

Just to check... does pragma(lib) work in non-dub contexts?

rcorre commented 9 years ago

also this should make all the pragma libs unnecessary in user code

rcorre commented 9 years ago

yes, the pragma libs are necessary to build in a non-dub context as far as I can tell

SiegeLord commented 9 years ago

I just mean that not all D compilers implement pragma(lib, so I always considered it a matter of course that the application will have to supply the necessary C libraries itself and not rely on the library to do it.

That said, I don't agree that this is the best solution, since you're being forced to link every Allegro C library even if you don't use them all. I'll have to think about it. Maybe I'd be ok with this if the C libraries were part of a configuration.

rcorre commented 9 years ago

Ah, thats a good point. If the user supplies "libs" in their application's dub.json, that also works, and they can choose which they want. I just figured it would be easier for most this way. However, I believe "importPaths" should be in there.

rcorre commented 9 years ago

I placed the libs in separate configurations. By default, dub will pick the first configuration, which will not pull in any of the libraries automatically. An alternate config can be specified like so:

"dependencies": { "allegro": "~master" }
"subConfigurations": { "allegro": "all-addons" }
SiegeLord commented 9 years ago

Ok, that's acceptable I guess. Thanks!