diff options
author | Paul Cercueil <paul.cercueil@analog.com> | 2016-11-09 11:41:43 +0100 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2016-11-11 11:39:53 -0800 |
commit | 9fd93c0a940feb6afb7ff587c8b3b17920aedf12 (patch) | |
tree | 502777280b8474ee7965b194706ad649c10a16a6 | |
parent | 660e500fd6cd4e5e4189ea9bd42c035bf8b8eb31 (diff) |
CMake: Fix math macros not available on MinGW
Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | cmake/msvc/config.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ca13431cd5..ba43f97a80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,6 +148,10 @@ if(MSVC) add_definitions(/bigobj) #allow for larger object files endif(MSVC) +if(WIN32) + add_definitions(-D_USE_MATH_DEFINES) +endif(WIN32) + # Record Compiler Info for record STRING(TOUPPER ${CMAKE_BUILD_TYPE} GRCBTU) set(COMPILER_INFO "") diff --git a/cmake/msvc/config.h b/cmake/msvc/config.h index 99a2ea0f89..db0088e3a9 100644 --- a/cmake/msvc/config.h +++ b/cmake/msvc/config.h @@ -21,7 +21,6 @@ typedef ptrdiff_t ssize_t; //////////////////////////////////////////////////////////////////////// // rint functions //////////////////////////////////////////////////////////////////////// -#define _USE_MATH_DEFINES #include <math.h> #if _MSC_VER < 1800 static inline long lrint(double x){return (long)(x > 0.0 ? x + 0.5 : x - 0.5);} |