-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Is your feature request related to a problem? Please describe.
Since a recent addition adding usage of "BENCHMARK_VERSION", this project is now coupled to the official build tools and is not compatible with anything else.
Describe the solution you'd like
Default macro variables so we can ignore if they're not set
Describe alternatives you've considered
Setting BENCHMARK_VERSION during compilation via -DBENCHMARK_VERSION=version doesn't work as the macro is not converted to a string, see below.
Additional context
In my experience, converting define inputs to strings is better done via a helper macro like
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
such that inputs like -DBENCHMARK_VERSION=version
can be used like
std::string s{TOSTRING(BENCHMARK_VERSION)};
This IMO is simpler from a build perspective to not need any fancy escaping
Metadata
Metadata
Assignees
Labels
No labels