Thread overview
How to setup dub to use x86 and x64 dll's when appropriate?
Feb 26, 2019
Michelle Long
Feb 26, 2019
Michelle Long
Feb 26, 2019
JN
Feb 26, 2019
Jonathan M Davis
Feb 26, 2019
Jacob Carlborg
February 26, 2019
e.g., using sdl for different versions and have it automatically switch.

What would be nice is if one could stick all the files for x86 in one dir and x64 in the others and they will be used depending on the build(and copied)

Ideally one can do it for debug and release versions too.


February 26, 2019
On Tuesday, 26 February 2019 at 04:17:04 UTC, Michelle Long wrote:
> e.g., using sdl for different versions and have it automatically switch.
>
> What would be nice is if one could stick all the files for x86 in one dir and x64 in the others and they will be used depending on the build(and copied)
>
> Ideally one can do it for debug and release versions too.

It seems also that dub is shit for swapping between different archs... I added the -m64 flag and then get build errors for lib format errors, compiles fine for x86...


February 25, 2019
On Monday, February 25, 2019 9:17:04 PM MST Michelle Long via Digitalmars-d- learn wrote:
> e.g., using sdl for different versions and have it automatically switch.
>
> What would be nice is if one could stick all the files for x86 in one dir and x64 in the others and they will be used depending on the build(and copied)
>
> Ideally one can do it for debug and release versions too.

You have to set up different build settings for each architecture if you want something like that. The documentation on it isn't great, but I believe that this is the relevant section:

https://dub.pm/package-format-json#build-settings

You'd probably end up with something like "libs-x86_64" and "libs-x86" with them pointing to the different spots, but I don't know exactly what you'll need. In general, the documentation hints at what's needed in situations like this but doesn't manage to make it clear exactly how to go about it, so whenever I need to do much interesting with dub, I tend to have to muck around with the dub.json file until I manage to hit upon the right combination of settings that do what I need. Usually, it's possible to do what you need to do with dub, but it's a pain to figure it out.

You can also ask questions in the dub-specific forum:

http://forum.rejectedsoftware.com/groups/rejectedsoftware.dub/

- Jonathan M Davis



February 26, 2019
On Tuesday, 26 February 2019 at 04:20:27 UTC, Michelle Long wrote:
> On Tuesday, 26 February 2019 at 04:17:04 UTC, Michelle Long wrote:
>> e.g., using sdl for different versions and have it automatically switch.
>>
>> What would be nice is if one could stick all the files for x86 in one dir and x64 in the others and they will be used depending on the build(and copied)
>>
>> Ideally one can do it for debug and release versions too.
>
> It seems also that dub is shit for swapping between different archs... I added the -m64 flag and then get build errors for lib format errors, compiles fine for x86...

Why add -m64 rather than --arch=x86_64?

Also: https://github.com/dlang/dub/wiki/Cookbook#creating-windows-package-that-has-32-and-64-bit-dlls
February 26, 2019
On 2019-02-26 05:17, Michelle Long wrote:
> e.g., using sdl for different versions and have it automatically switch.
> 
> What would be nice is if one could stick all the files for x86 in one dir and x64 in the others and they will be used depending on the build(and copied)
> 
> Ideally one can do it for debug and release versions too.

You can use a combination of "sourcePaths" and "excludedSourceFiles" (see the documentation of Dub for this [1]). You can also have a look at the DWT project as an example [2]. It uses two separate configurations, one for Linux and one for Windows. It's use in the case of DWT because the whole source tree is different. You might not need to do this.

[1] https://dub.pm/package-format-json
[2] https://github.com/d-widget-toolkit/dwt/blob/master/dub.sdl

-- 
/Jacob Carlborg