iOS support/multi platform XCode support

131 views
Skip to first unread message

Rick Appleton

unread,
Jun 11, 2017, 8:42:22 AM6/11/17
to Premake Development
Hello all,

Background
I'm looking to use Premake5 with a cross-platform code base. I'm sure the Windows/Visual Studio side will work, but I'm having issues on the MacOSX side. The code base is for MacOS, iOS and tvOS. I've been able to essentially create a workspace for iOS through Premake5, but I can't figure out how to make a single workspace that I can use for all those platforms.

Current
From posts I've found I understand that dependencies didn't work with multiple target dependencies within a project (http://industriousone.com/post/question-xcode-users).
As of XCode 7.2 (which is not that recent, XCode 9 is now in beta), this does seem to work ok though.

I also found the --platform flag for Premake4 (http://industriousone.com/platforms). This also no longer works in Premake5.

How to?
My question now is, how do I create an XCode workspace from which I can choose project/target for different platforms.

Ideally, my premake file would look like this:

configurations { "Debug", "Release" }
platforms { "Windows", "MacOSX", "iOS" }

filter  { "platforms:macosx" }
    arch
"x86_64"
   xcodebuildsettings {
        -- settings specific for MacOS
   }

filter { "platforms:ios" }
    arch
"arm64"
   xcodebuildsettings {
        -- settings specific for iOS
   }

-- something to ignore the windows configuration when action is 'xcode4'?

I'm willing to dig into the premake code to make something like this work, the only question is what should it generate? Release/Debug are handled ok I assume (didn't check), but for different platforms we could have different targets within a project. So each project is only a single target for each platform, but has different targets for the different platforms. Dependencies are still done between projects as they are now.

Would that be an acceptable design?

Kind regards,
Rick
Reply all
Reply to author
Forward
0 new messages