premake / premake-xcode

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

Xcode Build Settings Confusion #8

Closed thejustinwalsh closed 9 years ago

thejustinwalsh commented 9 years ago

This may not explicitly apply to Xcode, however I want to generate a project that targets C++11 of which in Xcode is controlled by CLANG_CXX_LANGUAGE_STANDARD= in the buildSettings of the configuration.

Additionally how would I change the ARCHS setting, SYMROOT or anything else listed in that section. When I use the buildoptions function in premake it just appears to add to the OTHER_CFLAGS buildSettings list.

akaStiX commented 9 years ago

Do it in this way:

    configuration { "xcode*" }
        xcodebuildsettings
        {           
            ["CLANG_CXX_LANGUAGE_STANDARD"] = "c++11";
        }
thejustinwalsh commented 9 years ago

Perfect that has produced the desired results in my project.

However, the API documentation has the configuration function marked as depreciated is there a more consistent way that we should pull such settings off?

akaStiX commented 9 years ago

Yes, use

filter { "action:xcode*" }

instead

thejustinwalsh commented 9 years ago

I take it the xcodebuildsettings function is a specific function that applies to Xcode projects only then and the filter is ensuring that this function won't be called when generating this project for windows? I haven't tested it yet on MSVC...

Thanks for the help as well.

starkos commented 9 years ago

I don't think you need the filter at all, those settings are already specific to Xcode? (But it doesn't break anything to add it.)