premake / premake-core

Premake
https://premake.github.io/
BSD 3-Clause "New" or "Revised" License
3.22k stars 620 forks source link

Incorrect names on macosx #2069

Closed crazydef closed 1 year ago

crazydef commented 1 year ago

What seems to be the problem?

I think cfg.platform is broken. Or platform detection in general seems to be a bit iffy on Mac.

I'm building xcode projects on macOS for macOS. (On an Arm-based Mac, if that makes a difference.)

I have the following defined in my premake script:

    elseif os.host() == "macosx" then
        platforms
        {
            "macOS",
            "iOS",
        }
        filter { "platforms:macOS" }
            architecture "universal"
            system( "macosx" )

        filter { "platforms:iOS" }
            system( "ios" )

        filter {}

        targetsuffix "%{cfg.platform}.%{cfg.buildcfg}"

All my outputs have ".iOS" in their names, and my build outputs are placed in the obj/iOS/... directory.

I'm not actually getting iOS targets in my project files, only macOS. (But that's a story for another day.)

If I remove "iOS" from my list of platforms, everything works as expected. Having it there breaks all naming. (It doesn't break the build, per se, all build outputs are universal binaries for macOS. It's just their names that are wrong.)

What did you expect to happen? I would expect builds on macOS targeting macOS to have the correct names.

What have you tried so far? I tried adding --os=macosx to the premake command line, but that made no difference.

I've also spent the last few hours looking through the Premake code trying to figure out what's happening. (But to no avail.)

How can we reproduce this? I think the above snippet in a solution block should be sufficient.

What version of Premake are you using? 5.0.0-dev

samsinsane commented 1 year ago

I'm going to close this as a duplicate of #1370 - the generator doesn't really support multiple platforms or configurations: https://github.com/premake/premake-core/blob/3f1e4f8ded5ce1397bd286eef5e2ebef02556422/modules/xcode/xcode_common.lua#L397-L398