bin/config: add option for getting build definitions

This commit is contained in:
Christian Zimmermann 2024-02-24 18:54:20 +01:00
parent 27c4c59d19
commit 733e479498
3 changed files with 16 additions and 0 deletions

View file

@ -25,6 +25,7 @@ auto configMap()
m["--version"] = CNORXZ::Config::version; m["--version"] = CNORXZ::Config::version;
m["--commit"] = CNORXZ::Config::commit; m["--commit"] = CNORXZ::Config::commit;
m["--flags"] = CNORXZ::Config::flags; m["--flags"] = CNORXZ::Config::flags;
m["--definitions"] = CNORXZ::Config::definitions;
return m; return m;
} }

View file

@ -29,6 +29,9 @@ namespace CNORXZ
/** return compile flags */ /** return compile flags */
String flags(); String flags();
/** return compile definitions */
String definitions();
} }
} }

View file

@ -31,5 +31,17 @@ namespace CNORXZ
{ {
return String(CXX_FLAGS); return String(CXX_FLAGS);
} }
String definitions()
{
String o;
#ifdef HAVE_CEREAL
o += "HAVE_CEREAL ";
#endif
#ifdef CXZ_HAVE_AVX
o += "CXZ_HAVE_AVX ";
#endif
return o;
}
} }
} }