Re: [Premake-users] How should Premake interpret a flag NOT set?
On GitHub now!
Brought to you by:
starkos,
ttk-bandit
|
From: Konstantin T. <an...@ya...> - 2011-11-29 08:39:02
|
29.11.2011, 00:35, "Jason Perkins" <st...@in...>: > I've come across a compiler that does NOT enable exceptions or RTTI by default. I'm going back and forth on how to handle it, and want to seek a bit of input before I make a final decision. > > Take exceptions as the case in point, there are two options: > > 1. If the NoExceptions flag is not set, then enable exceptions. That is, the lack of a NoExceptions flag implicitly enables exceptions. > > 2. If the NoExceptions flag is not set, then use the default behavior of the compiler: in this case, exceptions are left disabled. A new flag (presumably named Exceptions) would be required to actually turn them on. > > I'm leaning toward solution (1). Since all of the other compilers I've looked at enable exceptions by default, this approach will provide the most consistent behavior across toolsets, which is kind of the whole point of Premake. > > Thoughts? Feel free to weigh in with your opinions, but what I'm really looking for are examples and use cases to support one approach over another. I think (1) is more correct if it's just a compiler's pecularity. I agree with Jason McKesson. However, support of RTTI and exceptions can be platform-dependent (i.e., C runtime may not support this features, or support may be somewhat incomplete). In this case, I think platform definition should be able to pre-define NoExceptions and NoRTTI flags, and user should be able to specify Exceptions and RTTI on his own risk. What about all these "No*" flags, it seems to be related to [1], it should be possible to negate everything in configuration by excluding it from list. [1] https://sourceforge.net/tracker/?func=detail&aid=3435038&group_id=71616&atid=531881 -- Regards, Konstantin |