AnyOldName3 / vsgPhysX

MIT License
0 stars 0 forks source link

RelWithDebInfo doesn't work on Windows #3

Open AnyOldName3 opened 4 months ago

AnyOldName3 commented 4 months ago

PhysX's foundation\PxPreprocessor.h has this check:

#if PX_WINDOWS_FAMILY
    // check that exactly one of NDEBUG and _DEBUG is defined
    #if !defined(NDEBUG) ^ defined(_DEBUG)
        #error Exactly one of NDEBUG and _DEBUG needs to be defined!
    #endif
#endif

Both NDEBUG and _DEBUG are defined for RelWithDebInfo.

NDEBUG comes from CMake's default flags, and is generally supposed to be there for RelWithDebInfo.

https://learn.microsoft.com/en-us/cpp/c-runtime-library/debug?view=msvc-170 says _DEBUG is because we've passed /MTd or /MDd, which definitely shouldn't be the case for RelWithDebInfo. However, according to the VS GUI, we're actually passing /MD for RelWithDebInfo, and only use /MDd for Debug.