Re: [go-nuts] Conditional compiling for android

2018-02-01 Thread aashish . a . patel
Thanks for getting back. I finally got it to work after some experimentation on test project. Solution Added tag android for android only file and named it with suffix _android // +build android And for linux only file added // +build !android Below env are set as mentioned earlier GOOS=android

Re: [go-nuts] Conditional compiling for android

2018-02-01 Thread Hyang-Ah Hana Kim
Partly true. Build tags like !android should prevent inclusion of the file. Files named with _android suffix or with android buildtag should be included only for android. https://go.googlesource.com/go/+/master/src/time/zoneinfo_android.go https://go.googlesource.com/go/+/master/src/time/zoneinfo_

Re: [go-nuts] Conditional compiling for android

2018-02-01 Thread Dave Cheney
The build system considers android and Linux to be the same for historical reasons. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@goog

Re: [go-nuts] Conditional compiling for android

2018-02-01 Thread Hyang-Ah Hana Kim
Strange. Can you share an example for repro? On Thu, Feb 1, 2018 at 7:07 AM, wrote: > I have similar situation where I need to compile a package specifically > for android and other specifically for linux. > I have included constraints mentioned above for pure linux and pure > android compilatio

Re: [go-nuts] Conditional compiling for android

2018-02-01 Thread aashish . a . patel
I have similar situation where I need to compile a package specifically for android and other specifically for linux. I have included constraints mentioned above for pure linux and pure android compilation but still both files are getting built and I get error. GOOS=android GOARCH=arm Android s

Re: [go-nuts] Conditional compiling for android

2016-08-31 Thread Nigel Tao
On Wed, Aug 31, 2016 at 4:45 AM, Sapna Todwal wrote: > I already tried this and it doesn't work . That's odd. It should work. What are your filenames? What do your "// +build" lines look like exactly? > Also I need a way to enable > certain code only for pure android and not linux. Any suggesti

Re: [go-nuts] Conditional compiling for android

2016-08-30 Thread Sapna Todwal
I already tried this and it doesn't work . Also I need a way to enable certain code only for pure android and not linux. Any suggestions ?? On Mon, Aug 29, 2016 at 12:14 PM, andrey mirtchovski wrote: > you can do this for the pure linux stuff: > > // +build !android,linux > -- You received thi

Re: [go-nuts] Conditional compiling for android

2016-08-29 Thread andrey mirtchovski
you can do this for the pure linux stuff: // +build !android,linux -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For

[go-nuts] Conditional compiling for android

2016-08-29 Thread sapna . todwal
As per the documentation in https://golang.org/pkg/go/build/ : Using GOOS=android matches build tags and files as for GOOS=linux in addition to android tags and files. So what if I want to compile a file on android but not for linux, because I have multiple targets , one of them being linux a