-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow BENCHMARK_VERSION to be undefined #1769
Conversation
I feel this is a roundabout way to achieve the the end result.
? |
Hm, and if |
I'm kinda surprised it even compiles if it's not defined, but perhaps |
I can do this, but I still think the escapes can be avoided via stringification as @dmah42 suggested |
That's because it's passed into the stringification macro. Normally it indeed fails: https://godbolt.org/z/j5x4a4sWG |
ef3a278
to
2bf1db6
Compare
updated to just
|
oh, that's a shame. i quite liked the reduced complexity in the bazel config. i was thinking we'd land somewhere in between where be both stringify it if it's set but return a safe value if it's not. anyway, this also looks fine. |
@PhilipDeegan thank you! |
closes #1768
motivation is to allow simpler override at compilation time
shouldn't impact anyone using the official build tools as it's all internal in that case
I haven't tested the bazel build output for the function
benchmark::GetBenchmarkVersion()
but I'm guessing it's without the extra quote from "stringification" given the modificationsI have tested the cmake build output for the funciton, and the string is without quotes with the proposed changes
PRed on my fork for testing here
I can't explain the sanitizer failures so I'm figuring they are existing