2 ms·
It seems fairly straightforward - copy over the SDK header files and libraries to the project and then add these envs to the build: CC="/path/to/cross/comp
by 10000truths 4y ago
It seems fairly straightforward - copy over the SDK header files and libraries to the project and then add these envs to the build:
CC="/path/to/cross/compiler" CGO_CFLAGS=—I/path/to/sdk/header/files/include" CGO_LDFLAGS="-L/path/to/sdk/obj/files/lib”
I suppose with .so files, you might have to specify "-Wl,-rpath" if the SDK libraries don’t reside under /usr/lib or /usr/local/lib on the target system. But I haven’t actually tried any of this yet, so I could be wrong. Are there any gotchas that I’m missing?
- pjmlp 4y agoNow do the same as Windows UWP SDK, or iOS SDK. You're missing all the tooling and OS specific steps required to produce a proper package.
- shepherdjerred 4y agoFor macOS: https://github.com/tpoechtrager/osxcross https://github.com/tpoechtrager/osxcross
- pjmlp 4y agoDoesn't seem to do IO Kit, DriverKit, Metal, Instruments Plugins, UI frameworks, XPC, and plenty of other stuff dependent on Objective-C/Swift.
- shepherdjerred 4y agoI believe it would work for all of that, given that it links to the same libraries an app made with Xcode would. That repository won't compile Swift, but it does compile objective C. Either way, you don't need to be able to compile Swift/Obj C to link to a library that was written in Swift/Obj C.