Skip to content
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

Define Symbol Globally (C++, assert and NDEBUG) #139

Closed
aarossig opened this issue Apr 18, 2015 · 2 comments
Closed

Define Symbol Globally (C++, assert and NDEBUG) #139

aarossig opened this issue Apr 18, 2015 · 2 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Configurability platforms, toolchains, cquery, select(), config transitions type: bug

Comments

@aarossig
Copy link

I am writing C++11 and using assert to test for programmer error. I would like to disable the assertions by defining the symbol NDEBUG as per http://www.cplusplus.com/reference/cassert/assert/

How can I define this symbol for all targets when building an optimized build?

@ulfjack
Copy link
Contributor

ulfjack commented Apr 20, 2015

We should update the CROSSTOOL file to set that flag in the opt config. Then you can build with:
bazel build -c opt //foo/bar

As a workaround, you can modify your CROSSTOOL file yourself.

@ulfjack ulfjack self-assigned this Apr 20, 2015
@laszlocsomor laszlocsomor added type: bug P2 We'll consider working on this in future. (Assignee optional) labels Apr 21, 2015
@hanwen
Copy link
Contributor

hanwen commented Jan 20, 2016

The current crosstool has NDEBUG for opt mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Configurability platforms, toolchains, cquery, select(), config transitions type: bug
Projects
None yet
Development

No branches or pull requests

6 participants