I could switch it to off when CMAKE_BUILD_TYPE is not Debug, but generally it's not a good idea. With VS and Xcode one can configure once and then compile for different configurations, that's why one should normally use, say, CMAKE_CXX_FLAGS_DEBUG, etc instead of adding options to CMAKE_CXX_FLAGS when CMAKE_BUILD_TYPE is Debug.
While TokuDB doesn't compile on Windows, it can be compiled on Mac OS X, right?
I'd suggest the following fix: rename the option (in cmakefiles) to, say, TOKUDB_DEBUG_PARANOID. And if it's set, add -DTOKU_DEBUG_PARANOID (old name) to CMAKE_CXX_FLAGS_DEBUG. This way you won't need to change source files, and cmake will automatically enable debug flag in the correct configuration.
In the server we use a somewhat more complex approach. For safemalloc, for example, the values are ON, OFF, AUTO, meaning "always enable", "always disable", "enable in debug builds only". And -DSAFEMALLOC is added, respectively, to CMAKE_CXX_FLAGS, nowhere, to CMAKE_CXX_FLAGS_DEBUG.
I could switch it to off when CMAKE_BUILD_TYPE is not Debug, but generally it's not a good idea. With VS and Xcode one can configure once and then compile for different configurations, that's why one should normally use, say, CMAKE_CXX_FLAGS_DEBUG, etc instead of adding options to CMAKE_CXX_FLAGS when CMAKE_BUILD_TYPE is Debug.
While TokuDB doesn't compile on Windows, it can be compiled on Mac OS X, right?
I'd suggest the following fix: rename the option (in cmakefiles) to, say, TOKUDB_DEBUG_PARANOID. And if it's set, add -DTOKU_DEBUG_PARANOID (old name) to CMAKE_CXX_FLAGS_DEBUG. This way you won't need to change source files, and cmake will automatically enable debug flag in the correct configuration.
In the server we use a somewhat more complex approach. For safemalloc, for example, the values are ON, OFF, AUTO, meaning "always enable", "always disable", "enable in debug builds only". And -DSAFEMALLOC is added, respectively, to CMAKE_CXX_FLAGS, nowhere, to CMAKE_CXX_FLAGS_DEBUG.