Where does the -DNDEBUG normally come from?

后端 未结 3 1584
我在风中等你
我在风中等你 2020-12-03 05:18

Our build system has somehow changed such that optimized builds are no longer getting the -DNDEBUG added to the compile line. I searched our makefiles and don\'t find this.

3条回答
  •  爱一瞬间的悲伤
    2020-12-03 05:44

    It is really difficult to answer this since you didn't specify the build system you are using. If you're using autoconf, then either the user is expected to put -DNDEBUG in CPPFLAGS manually (or perhaps you were setting it from a CONFIG_SITE file that has changed), or the configure.ac might set up a custom variable for setting NDEBUG, or configure.ac may invoke AC_HEADER_ASSERT, in which case adding --disable-assert to the invocation of configure will define NDEBUG in config.h. There are lots of ways it can happen.

提交回复
热议问题