padster / go-sound

Functional sound libraries for go
GNU General Public License v3.0
118 stars 15 forks source link

Build midiinput.go only on the platforms supported by portmidi #4

Closed unkaktus closed 6 years ago

padster commented 6 years ago

I didn't know about +build, thanks.

Do you know if there's a way to get these to only build when needed? When making this originally, it seemed best to only have e.g. portmidi or jack code compile if the user is actually using/importing portmidi or jack parts of code, though I couldn't find a way to get that working.

unkaktus commented 6 years ago

@padster, there are build tags for that. user-defined in this case. so it works like this:

go build -tags "jack portmidi"