From 733e479498d8d8307c6234664a5d354681a8d169 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Sat, 24 Feb 2024 18:54:20 +0100 Subject: [PATCH] bin/config: add option for getting build definitions --- src/bin/config.cc | 1 + src/include/base/config.h | 3 +++ src/lib/base/config.cc | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/src/bin/config.cc b/src/bin/config.cc index 7cf47bd..d9e9320 100644 --- a/src/bin/config.cc +++ b/src/bin/config.cc @@ -25,6 +25,7 @@ auto configMap() m["--version"] = CNORXZ::Config::version; m["--commit"] = CNORXZ::Config::commit; m["--flags"] = CNORXZ::Config::flags; + m["--definitions"] = CNORXZ::Config::definitions; return m; } diff --git a/src/include/base/config.h b/src/include/base/config.h index 63a9871..f86eecd 100644 --- a/src/include/base/config.h +++ b/src/include/base/config.h @@ -29,6 +29,9 @@ namespace CNORXZ /** return compile flags */ String flags(); + + /** return compile definitions */ + String definitions(); } } diff --git a/src/lib/base/config.cc b/src/lib/base/config.cc index a502939..f701398 100644 --- a/src/lib/base/config.cc +++ b/src/lib/base/config.cc @@ -31,5 +31,17 @@ namespace CNORXZ { 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; + } } }