Well, I have tried a few things and I have a solution. It works.
1) First, with premake4
, the flags {"C++11"}
statement doesn't appear to work. What I mean is, on premake4
, the C++11
flag isn't recognized. Note that the flags
statements itself is valid on premake4
but (apparently) not the C++11
flag .
2) On premake5
, the flags
statement itself has been deprecated. So you can't use flags {"C++11"}
on premake5
. Instead, use the cppdialect "C++11"
statement. I used it within the configuration
blocks.
3) Now, you can issue the statement to create the makefiles
using premake5
. Eg:
premake5 --file=premake-lua-scriptname.lua gmake
4) Later, when you run the generated makefiles
, you will find the binary created, by default, in the bin
subdirectory subordinate to the dir containing the premake5 lua script. Take my suggestion and override this default to have it created in the same dir as the lua script. (I'll explain why below.) You override this default using the targetdir
function, which can be issued at the project level. Eg:
targetdir "."
5) Note that the current (alpha12) release of premake5
doesn't support the clean
action. To invoke the clean
action, you will have to use premake4
. That's why I suggested creating the binary in the default dir. premake4
then cleans it by default.
All this works. However, is there a better solution?