Skip to content

Commit b191758

Browse files
committed
expose M_PI for MSVC compiler
The MSVC compiler only exposes M_PI if _USE_MATH_DEFINES is defined... don't ask me why.
1 parent 780059a commit b191758

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ set(
2323
# Build rnnoise
2424
add_definitions(-DRNNOISE_BUILD)
2525

26+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
27+
# MSVC requires this to expose definitions like M_PI
28+
add_definitions(-D_USE_MATH_DEFINES)
29+
endif()
30+
2631
# Compile the library
2732
add_library(rnnoise ${SOURCES})
2833

0 commit comments

Comments
 (0)