premake / premake-xcode

BSD 3-Clause "New" or "Revised" License
9 stars 15 forks source link

Using more than one "platforms" keyword errors out #15

Closed fzwoch closed 8 years ago

fzwoch commented 9 years ago

Using something like platforms { "x64", "x86" } will cause the generation process to bail out with attempt to concatenate field '?' (a nil value)

I could track it down to this function - more particular to the premake.action.current().valid_platforms[cfg.platform] part. But I could not comprehend where exactly it goes wrong.

function xcode.getconfigname(cfg)
    local name = cfg.buildcfg
    if #cfg.project.solution.platforms > 1 then
        name = name .. " " .. premake.action.current().valid_platforms[cfg.platform]
    end
    return name
end
starkos commented 9 years ago

Presumably, valid_platforms doesn't have an entry for whatever value is in cfg.platform so it returns nil. I'd guess they are pulling that table from the action in order to support multiple versions of Xcode with different platform identifiers; might be easier to just move it to a local table for now?

mihaisebea commented 9 years ago

yes ...x86 or x64 is not a valid platform for xcode ... you shouldn't add these to the project/solution for the xcode action ...

what kind of project are you trying to generate ?

akaStiX commented 9 years ago

This pull request fixes this issue - https://github.com/premake/premake-xcode/pull/9

It's a bit tricky though. I don't see a check box in XCode, that will allow you to change the build architecture (like in VS), you have to do that through project settings. In fact there are no separate settings for different build architectures, so, maybe, it's better to get rid of valid_platforms table?!

fzwoch commented 8 years ago

Since premake/premake-xcode#9 has been merged I close this one.