← Back to team overview

kicad-developers team mailing list archive

[PATCH 3/9] Set _USE_MATH_DEFINES on Windows

 

All compilers need this in standards-compliant mode.
---
 CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ee43d9eb9..c73c86a29 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -245,6 +245,10 @@ if( WIN32 )
     # define UNICODE and_UNICODE definition on Windows. KiCad uses unicode.
     # Both definitions are required
     add_definitions(-DUNICODE -D_UNICODE)
+
+    # In fully standards-compliant mode, M_PI et al. are defined only if
+    # _USE_MATH_DEFINES is set.
+    add_definitions( -D_USE_MATH_DEFINES )
 endif()
 
 

References