Closed rcorre closed 9 years ago
Just to check... does pragma(lib)
work in non-dub contexts?
also this should make all the pragma lib
s unnecessary in user code
yes, the pragma libs are necessary to build in a non-dub context as far as I can tell
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.
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.
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" }
Ok, that's acceptable I guess. Thanks!
When I tried to use DAllegro as a dub package a few things went wrong:
importPaths
libs
to reference all the C libraries (pragma(lib)s seemed to not work with dub?)I didn't catch these before when I was just using a local dub package. Also, I believe
dub.json
is now preferred overpackage.json