build: add USE_MATH_DEFINES define to expose M_PI on Windows

This commit is contained in:
Gabriel Ferreira
2023-05-01 00:10:25 -03:00
parent 664a0ac9a4
commit 680dc71ae6

View File

@@ -71,6 +71,10 @@ if(WIN32)
set(NS3_PRECOMPILE_HEADERS OFF
CACHE BOOL "Precompile module headers to speed up compilation" FORCE
)
# For whatever reason getting M_PI and other math.h definitions from cmath requires this definition
# https://docs.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=vs-2019
add_definitions(/D_USE_MATH_DEFINES)
endif()
set(cat_command cat)