From 1d4edce326efb40e71355fdb0d064023ff03e891 Mon Sep 17 00:00:00 2001 From: debloip Date: Fri, 8 Mar 2024 12:25:05 -0500 Subject: [PATCH] HYDRA-843 : Add extra info on _USE_MATH_DEFINES problem --- cmake/compiler_config.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/compiler_config.cmake b/cmake/compiler_config.cmake index a66f929998..14beada8b8 100644 --- a/cmake/compiler_config.cmake +++ b/cmake/compiler_config.cmake @@ -143,6 +143,8 @@ set(MSVC_DEFINITIONS # 12. As _USE_MATH_DEFINES is now defined, corecrt_math_defines.h does get included this time. # 13. corecrt_math_defines.h defines the macros without checking if they have already been defined : # macro redefinition -> warning -> warning treated-as-error -> error -> compilation fails. + # In our case, step 9 (_USE_MATH_DEFINES getting defined late) happens in MTypes.h, and step 10 + # (math.h re-inclusion) in some other Maya headers, for example MFloatVector.h. # By defining _USE_MATH_DEFINES from the get-go, we ensure that the math macros get defined by # corecrt_math_defines.h the first time around. Afterwards, even if math.h does not have a # header guard, the one in corecrt_math_defines.h avoids redefining the macros.