+1 for making this a cmake option. That said, I don't think we can implement this using #ifdefs. lldb-enumerations.h is a part of our public api, Config.h isn't (it theoretically could be, but I don't think we want that).
I think the simplest way to achieve this would be to make eScriptLanguageDefault an enum value in its own right, and handle the translation to an actual language internally. pl On 02/04/2020 01:12, Ted Woodward via lldb-dev wrote: > I agree with Jim - it should be a cmake setting, defaulting to Python. If the > person building lldb wants to change the default scripting language from > Python to Lua, it should be easy. Since we now support 2 scripting languages, > we should have an easy way for the user to see which are supported, and which > is the default if there are more than 1 supported. Maybe in lldb --version? > > Ted > > -----Original Message----- > From: lldb-dev <lldb-dev-boun...@lists.llvm.org> On Behalf Of Jim Ingham via > lldb-dev > Sent: Wednesday, April 1, 2020 5:43 PM > To: Ed Maste <ema...@freebsd.org> > Cc: LLDB <lldb-dev@lists.llvm.org> > Subject: [EXT] Re: [lldb-dev] Default script language > > Right now, Lua is not nearly as well supported as Python, so it makes sense > that if both Python and Lua are available Python should be the default. But > at some point Lua will become an equal to Python. When that happens, it > seems to me the default scripting language choice should be up to the package > distributor. I don’t see why we need to weigh in on that. That would imply > that the default should be an independent build setting. Not sure that means > we need to do it that way now, but if we don’t want to do it twice… > > Jim > > >> On Apr 1, 2020, at 2:09 PM, Ed Maste via lldb-dev <lldb-dev@lists.llvm.org> >> wrote: >> >> In lldb/include/lldb/lldb-enumerations.h we have: >> eScriptLanguageDefault = eScriptLanguagePython >> >> I'd like to do something like: >> #if LLDB_ENABLE_PYTHON >> eScriptLanguageDefault = eScriptLanguagePython #elif LLDB_ENABLE_LUA >> eScriptLanguageDefault = eScriptLanguageLua #else >> eScriptLanguageDefault = eScriptLanguageNone #endif >> >> if we could include Config.h, or achieve the same effect in some other >> way if we cannot. Does this seem reasonable? >> >> I'm interested in this for lldb in the FreeBSD base system. We have >> lua available already (and no python) and I've integrated our liblua >> it into lldb, but it required "--script-language lua" on the command >> line. For now I'll just change the default to be eScriptLanguageLua in >> our tree, but would like to have this "just work" upstream. >> _______________________________________________ >> lldb-dev mailing list >> lldb-dev@lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev > > _______________________________________________ > lldb-dev mailing list > lldb-dev@lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev > _______________________________________________ > lldb-dev mailing list > lldb-dev@lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev > _______________________________________________ lldb-dev mailing list lldb-dev@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev