RejectedSoftware Forums

Sign up

Is there a way to output to a platform specific folder/filename

http://code.dlang.org/package-format?lang=sdl especially mentions, that
targetPath does not support the platform attributes.

I would like to be able to distinguish osx-binaries from linux binaries.
Also having different settings for linux-arm and linux-x86_64 would be
great.

Thanks,
Christian

Re: Is there a way to output to a platform specific folder/filename

Am 15.07.2017 um 18:49 schrieb Christian Köstlin:

http://code.dlang.org/package-format?lang=sdl especially mentions, that
targetPath does not support the platform attributes.

I would like to be able to distinguish osx-binaries from linux binaries.
Also having different settings for linux-arm and linux-x86_64 would be
great.

Thanks,
Christian

Configurations would work in that case. Each configuration has a list of
platform specifiers that it supports, and any global settings are
inherited, so that only the necessary bits need to be customized:

 name "foo"
 dependency "bar" version="~>1.0"

 configuration "osx" {
     platforms "osx"
     targetName "foo_for_mac"
 }
 configuration "armlinux" {
     platforms "linux-arm"
     targetName "armlinux_foo"
     dependency "myarmlib" version="~>2.0"
 }
 configuration "linux" {
     plaforms "linux-x86" "linux-x86_64"
     targetName "pc-linux"
 }

Re: Is there a way to output to a platform specific folder/filename

On 26.07.17 01:09, Sönke Ludwig wrote:

Am 15.07.2017 um 18:49 schrieb Christian Köstlin:

http://code.dlang.org/package-format?lang=sdl especially mentions, that
targetPath does not support the platform attributes.

I would like to be able to distinguish osx-binaries from linux binaries.
Also having different settings for linux-arm and linux-x86_64 would be
great.

Thanks,
Christian

Configurations would work in that case. Each configuration has a list of
platform specifiers that it supports, and any global settings are
inherited, so that only the necessary bits need to be customized:

name "foo"
dependency "bar" version="~>1.0"

configuration "osx" {
    platforms "osx"
    targetName "foo_for_mac"
}
configuration "armlinux" {
    platforms "linux-arm"
    targetName "armlinux_foo"
    dependency "myarmlib" version="~>2.0"
}
configuration "linux" {
    plaforms "linux-x86" "linux-x86_64"
    targetName "pc-linux"
}

Thanks for the answer!

this means, I would have to always make dub -c osx/linux/armlinux?

Is it somehow possible to run on all platforms (raspi, osx and linux)
just dub build and then get the proper executable with a platform
specific name?

Re: Is there a way to output to a platform specific folder/filename

Am 02.08.2017 um 21:30 schrieb Christian Köstlin:

On 26.07.17 01:09, Sönke Ludwig wrote:

Am 15.07.2017 um 18:49 schrieb Christian Köstlin:

http://code.dlang.org/package-format?lang=sdl especially mentions, that
targetPath does not support the platform attributes.

I would like to be able to distinguish osx-binaries from linux binaries.
Also having different settings for linux-arm and linux-x86_64 would be
great.

Thanks,
Christian

Configurations would work in that case. Each configuration has a list of
platform specifiers that it supports, and any global settings are
inherited, so that only the necessary bits need to be customized:

name "foo"
dependency "bar" version="~>1.0"

configuration "osx" {
    platforms "osx"
    targetName "foo_for_mac"
}
configuration "armlinux" {
    platforms "linux-arm"
    targetName "armlinux_foo"
    dependency "myarmlib" version="~>2.0"
}
configuration "linux" {
    plaforms "linux-x86" "linux-x86_64"
    targetName "pc-linux"
}

Thanks for the answer!

this means, I would have to always make dub -c osx/linux/armlinux?

Is it somehow possible to run on all platforms (raspi, osx and linux)
just dub build and then get the proper executable with a platform
specific name?

By default, DUB will choose the first configuration that matches the
selected (or host) platform. So with the proper "platforms" directives,
it should work without any explicit configuration selection.

Re: Is there a way to output to a platform specific folder/filename

On 03.08.17 12:07, Sönke Ludwig wrote:

By default, DUB will choose the first configuration that matches the
selected (or host) platform. So with the proper "platforms" directives,
it should work without any explicit configuration selection.

thanks a lot for this explanation.
the following fills my needs now (for linux, osx and my linux-on-raspi):

...
mainSourceFile "source/app.d"
configuration "application-osx" {
platforms "osx"
targetPath "out/osx"
lflags "-Lout/osx"
}

configuration "application-linux" {
platforms "linux-x86" "linux-x86_64"
targetPath "out/linux"
lflags "-Lout/linux"
}

configuration "application-raspi" {
platforms "arm"
targetPath "out/raspi"
lflags "-Lout/raspi"
}
...

still i do not know how to come up with proper platforms. e.g. linux-x86
is not described here:
http://dlang.org/spec/version.html#PredefinedVersions and "arm" is also
not quite right :)

cK