panda3d-thirdparty icon indicating copy to clipboard operation
panda3d-thirdparty copied to clipboard

iOS cross-compilation and macOS fixups

Open treamology opened this issue 5 years ago • 6 comments

This PR removes the 32-bit build options since we're not longer supporting it (and it adds some complexity to the build). I also removed the explicit setting of CMAKE_OSX_SYSROOT since CMake can infer it from the deployment target.

It also explicitly downloads and builds the icu library since there doesn't seem to be an easy way to satisfy that dependency externally.

I also bumped the OpenSSL version to the latest stable (1.1.1c) on macOS and iOS, since it has much better presets for building 64 bit executables for both.

I have a fork of the python-cmake-buildsystem repository that adds the ability to compile for iOS. I've added a BUILD_PYTHON option to this script accordingly, that is only built when cross-compiling by default.

treamology avatar Jun 06 '19 21:06 treamology

Hey,

Is there anything in particular you have to do when building from this branch on Mac? If I do:

git clone https://github.com/treamology/panda3d-thirdparty/tree/ios

And run:

cmake -DCMAKE_BUILD_TYPE=Release -G"Xcode" ..

I still get an error about the i386 architecture.

eoinroe avatar Jul 18 '19 10:07 eoinroe

@Eoey1 Hi there, be sure to clear your CMake cache (can be done by just deleting and recreating your build folder) before trying out this branch, so the old settings don't stick around.

treamology avatar Jul 18 '19 18:07 treamology

Hey,

So I simply cloned the repository again to start afresh and did:

cmake -DCMAKE_BUILD_TYPE=Release -G"Xcode" ..

And got the same i386 error.

If I don't specify the generator I get the following message:

The C compiler

"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc"

is not able to compile a simple test program.

It fails with the following output:

etc

Are you using MacOS?

eoinroe avatar Jul 21 '19 16:07 eoinroe

Yes, I'm on 10.14.5 with Xcode 10.2.1. Did you make sure to git checkout ios after cloning the repository? I'm confused as to how i386 could possibly be getting selected, since I explicitly set CMAKE_OSX_ARCHITECTURES to x86_64 in the build script.

treamology avatar Jul 21 '19 17:07 treamology

Hey, thanks for that!

I didn't realise I had to do 'git checkout ios' since I thought since I was cloning your repositiory:

https://github.com/treamology/panda3d-thirdparty.git

That I'd already be on the right branch...

After installing yasm (for FFmpeg) I could build the 3rd party packages succesfully.

However, I'm still running into problems when I go to build Panda3d...

eoinroe avatar Jul 29 '19 11:07 eoinroe

@rdb and @treamology, what's the status of this PR? I am investigating bringing this repo into the main Panda repo, and I need to figure out if it makes sense to merge this soon or request that a new PR gets opened on the main repo if/when this repo gets merged in.

Moguri avatar Apr 28 '21 23:04 Moguri