The premake file (premake5.lua) mentions C++11 with this snippet:
filter { "language:C++", "toolset:gcc" }
buildoptions { "-std=c++11" }
does it doesn't seem to work. This is probably related to this issue, whose solution is to use cppdialect
which is only available from premake 5 alpha 12 (at the time of writing, last release is alpha 11, which means you need to download the latest version directly on GitHub).
As a quick fix, you can follow the OP's own answer: modify the Make files of Box2D (also HelloWorld and Testbed if needed) by adding -std=c++11
(resp. gnu++11
, c++14
, etc.) to ALL_CXXFLAGS
.
If you prefer modifying the premake itself:
- In premake5.lua, Comment out the filter / buildoptions snippet mentioned above
- In projects Box2D (also HelloWorld and Testbed if needed), add
flags "C++11"
(you can also add buildoptions { "-std=c++11" }
, the only difference is that it will also add the option to ALL_CFLAGS)
Example:
project "Box2D"
kind "StaticLib"
language "C++"
flags "C++11" -- added
files { "Box2D/**.h", "Box2D/**.cpp" }
includedirs { "." }
I intend to send a PR to Box2D's repository with this change.
EDIT: Done, here is the PR.