With O1 being default, also set NDEBUG.

This commit is contained in:
Axel Naumann 2022-01-10 12:50:44 +01:00 committed by jenkins
parent c0eed39bfe
commit c6dcc185a8

View File

@ -763,19 +763,19 @@ namespace {
} }
} }
#if defined(_MSC_VER) || defined(NDEBUG) #if defined(_MSC_VER)
static void stringifyPreprocSetting(PreprocessorOptions& PPOpts, static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
const std::string &Name, int Val) { const std::string &Name, int Val) {
smallstream Strm; smallstream Strm;
Strm << Name << "=" << Val; Strm << Name << "=" << Val;
if (std::find(PPOpts.Macros.begin(), PPOpts.Macros.end(), if (std::find(PPOpts.Macros.begin(), PPOpts.Macros.end(),
std::make_pair(Name, true)) std::make_pair(Name, true))
== PPOpts.Macros.end() == PPOpts.Macros.end()
&& std::find(PPOpts.Macros.begin(), PPOpts.Macros.end(), && std::find(PPOpts.Macros.begin(), PPOpts.Macros.end(),
std::make_pair(Name, false)) std::make_pair(Name, false))
== PPOpts.Macros.end()) == PPOpts.Macros.end())
PPOpts.addMacroDef(Strm.str()); PPOpts.addMacroDef(Strm.str());
} }
#define STRINGIFY_PREPROC_SETTING(PP, name) \ #define STRINGIFY_PREPROC_SETTING(PP, name) \
stringifyPreprocSetting(PP, #name, name) stringifyPreprocSetting(PP, #name, name)
@ -791,9 +791,10 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
#endif #endif
#endif #endif
#ifdef NDEBUG // cling wants to JIT O1 by default. Might want to revisit once we have
STRINGIFY_PREPROC_SETTING(PPOpts, NDEBUG); // debug symbols.
#endif PPOpts.addMacroDef("NDEBUG=1");
// Since cling, uses clang instead, macros always sees __CLANG__ defined // Since cling, uses clang instead, macros always sees __CLANG__ defined
// In addition, clang also defined __GNUC__, we add the following two macros // In addition, clang also defined __GNUC__, we add the following two macros
// to allow scripts, and more important, dictionary generation to know which // to allow scripts, and more important, dictionary generation to know which