I'm trying to build Kodi for tvOS on macOS 10.13.6 and Xcode 9. Because I'm an Apple developer and already have Xcode 10 installed, I reinstalled Xcode 9 to a different directory and selected it using xcode-select.
I followed dmytrokoren's instructions on building from the beginning of this thread, but on the step for compiling build dependencies I got an error that read "error: C compiler cannot create executables" and now if I try to recompile it still prints "Dependencies built successfully" but fails with the following:
Code:
/path/to/Xcode9.app/Contents/Developer/usr/bin/make -C target
/path/to/Xcode9.app/Contents/Developer/usr/bin/make -C pcre
/path/to/Xcode9.app/Contents/Developer/usr/bin/make -C appletvos11.4_arm64-target
make[3]: *** No targets specified and no makefile found. Stop.
make[2]: *** [appletvos11.4_arm64-target/.libs/libpcre.a] Error 2
make[1]: *** [pcre] Error 2
make: *** [target/.installed-appletvos11.4_arm64-target] Error 2
(I've changed the path of my Xcode 9 installation just to make things more readable.)
If I try the "Compiling Kodi to Use with Xcode" step then I get this:
Code:
checking for gcc... /path/to/Xcode9.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
checking whether the C compiler works... no
configure: error: in `/Users/myuser/Development/kodi/kodi':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** [../../../..//libkodi.so] Error 77
I have pretty much no idea what I can do to resolve this issue. I'm wondering if trying to use a secondary Xcode installation is causing issues. However I can't replace my primary Xcode installation because I need it for work. I suppose I could try building Kodi in a virtual machine but that would both be slower and prevent me from being able to run it in a simulator.
Any ideas what I can do to resolve this?
edit: I tried again after installing Xcode 9 to /Applications and the same error occurred, so it's not just Xcode being installed to a non-standard directory.
edit 2: I was able to get things compiling properly by installing Xcode 9.2 and using xcode-select to choose it for command line compiling. Previously I was using Xcode 9.4.1 and apparently that one doesn't work.
edit 3: ...but things aren't linking properly. I'm getting a ton of undefined symbol errors plus a lot of warnings that the libraries in /Users/Shared/xbmc-depends/appletvos11.2_arm64-target are the wrong architecture (x86_64)
final edit: Silly me, I was building for the iOS Simulator. I've gotten the app to compile and link. Too bad it can't run in the Simulator, though, since that would have been convenient.