Closed niondir closed 3 years ago
Maybe it's due to some CGO / GCC issue
Yes, if you want the USB enumerator compiling for Mac requires CGO: you need a cross-compiler and the Apple SDK installed on your PC.
I suggest using the docker image we use in the arduino-cli
that already has everything needed -> https://github.com/arduino/arduino-cli/blob/471358634cd6680dbe2be4ca652db46fb759deda/DistTasks.yml#L219-L228
The command line that the Taskfile run (without the ldflags that you don't need) is:
$ task dist:macOS_64bit
docker run -v `pwd`/..:/home/build -w /home/build \
-e CGO_ENABLED=1 \
docker.elastic.co/beats-dev/golang-crossbuild:1.16.4-darwin-debian10 \
--build-cmd "go build -o dist/arduino-cli_osx_darwin_amd64/arduino-cli" \
-p "darwin/amd64"
TBH I don't really know how this works exactly (someone else did it for me), but I'm sure you can tinker it to make it work on your project :-).
Alternatively, the easiest way is to build natively on OSX...
Since it's not a bug, I'm closing the issue.
nativeGetDetailedPortsList
seems not to be supported. Do I miss something? How can I build the library for mac?Update:
Maybe it's due to some CGO / GCC issue. I'm getting
I'm Working on Windows.