The Premake discussion forums here at Industrious One are now READ ONLY.

For questions about using Premake and authoring project scripts, please ask on StackOverflow, adding the #premake tag to your question. More people (including the Premake developers) will be able to see and respond to your questions, and you will have the opportunity to reward the best answers.

For discussions about developing, customizing, or extending Premake and add-on modules, please use the new Premake Developers Google Groups forum.

 


 

xcode4: c++11 build option?

Is there any way to make premake when generating my xcode4 projects set:
C++ Language Dialect to C++11 (-std=C++11)
C++ Standard Library to libc++ (LLVM C++ standard library with C++ 11 support)

Thanks.

buildoptions "-std=c++11 -stdlib=libc++"

Thanks.
Tried this but instead of showing up as:
C++ Language Dialect: C++11 (-std=C++11)
C++ Standard Library: libc++ (LLVM C++ standard library with C++ 11 support)

I get:
Other C Flags: -std=c++11 -stdlib=libc++
Other C++ Flags: -std=c++11 -stdlib=libc++

and when trying to build I get link-errors because of missing C++11 features.

Any idea?

Thanks.

Please try

linkoptions "-stdlib=libc++"

Hi again,
yes that did the trick.
I guess in order to get it to set the other xcode options this would have to be added to premake?
But this works just as good for now.

Thanks.

>I guess in order to get it to set the other xcode options this would have to be added to premake?

You mean to see "C++ Language Dialect" and "C++ Standard Library" in GUI? Yes, it would require changes in Premake.

BTW, using buildoptions/linkoptions is not Xcode-specific, it will work on any platform where clang and libc++ work.

>You mean to see "C++ Language Dialect" and "C++ Standard Library" in GUI? Yes, it would require changes in Premake.

Oh well, this works just as good.

>BTW, using buildoptions/linkoptions is not Xcode-specific, it will work on any platform where clang and libc++ work.

Good to know if I decided to try out my code on other platforms or when I decided to kick out xcode (pretty sure that day will come soon)

Thanks