.lua is not an extension unique to premake, but instead a lua script file. I am currently working on a generator for another build system which uses .lua files, and the problem is obvious. I suggest conanbuildinfo.premake.lua. That's the convention I'll be using for the new generator.
Make sense, but would be breaking, so assigning it for 2.0
Ok, well at the same time, might as well also consider the following.
The variable for preprocessor definitions has a rather unfortunate name:
https://github.com/conan-io/conan/blob/develop/conans/client/generators/premake.py#L37
conan_cppdefines{dep} = {{{deps.defines}}}\n
conan_cppflags{dep} = {{{deps.cppflags}}}\n
These two variables mean the following:
conan_cppdefines : "C Pre Processor Definitions"
conan_cppflags : "C Plus Plus Flags"
This variable "situation" is unspeakably bad for at least three reasons:
cppdefines. The standard is simply defines. deps.defines. So, someone actually mapped the standard variable defines to this unique variable name: cppdefines. It would be funny, if these names didn't matter much, but they do. When working on the gnu_make generator, I spent hours across many days being confused, misinterpreting, and then troubleshooting the inconsistent meanings of cpp and cxx between Conan and Make. It could affect others in the future.
Now, I think the premake generator was created and maintained by Conan team from day 1. So, all of this together makes me wonder why this variable was named so uniquely. I'm willing to believe there was some special reason cppdefines was used here instead of the normal defines. However, I hope it was just a historical oversight that hasn't been corrected yet.
I am aware of the unfortunate history of the naming of the variable cpp_info.cppflags, and that's something we'll all have to accept and live with long-term. But, the premake generator is relatively new (as far as being an official generator), so hopefully we can rename the variable from conan_cppdefines to simply conan_defines so this blemish doesn't have to stick around forever.
I think we could change this as the generator was released as experimental https://docs.conan.io/en/latest/reference/generators/premake.html
So we could tackle both problems even before 2.0 @memsharded
to summarize, I believe we should change:
conanbuildinfo.lua -> conanbuildinfo.premake.luaconan_cppdefines -> conan_definesconan_cppflags -> conan_cxxflagsC PreProcessor instead of C++, and CPPFLAGS variable is used for C preprocessor flags instead of C++ compiler flags (which is CXXFLAGS). so, this may introduce lots of confusion for end users, let's use more obvious name.I support 1 and 2.
3) Sadly, I would leave conan_cppflags, which is what we did in the gnu_make generator. The conclusion there was that the user will be the one to map CONAN_CPPFLAGS -> CXXFLAGS variable in their consuming makefile. I agreed that it was even more confusing to map the Conan variable cppflags to the build variable cxxflags implicitly. It's certainly debatable, but given the history, it was the decision that was made in that one.
There was some discussion about it here.
https://github.com/conan-io/docs/pull/955#issuecomment-442754327
@solvingj you meant leave conan_cppflags, right?
Yes, sorry, i have corrected my comment.
As a reference, other generators, most noticeable cmake does this conversion:
cppflags (conanfile) -> CONAN_CXX_FLAGS (conanbuildinfo.cmake)
So it might make sense to be consistent.
We have finally decided to change the mapping of cpp_info.cppflags, see #4336
Most helpful comment
I support 1 and 2.
3) Sadly, I would leave
conan_cppflags, which is what we did in thegnu_makegenerator. The conclusion there was that the user will be the one to mapCONAN_CPPFLAGS->CXXFLAGSvariable in their consuming makefile. I agreed that it was even more confusing to map the Conan variablecppflagsto the build variablecxxflagsimplicitly. It's certainly debatable, but given the history, it was the decision that was made in that one.There was some discussion about it here.
https://github.com/conan-io/docs/pull/955#issuecomment-442754327