Skip to content

Commit

Permalink
Add -D_USE_MATH_DEFINES when building on Windows
Browse files Browse the repository at this point in the history
This define is needed on Windows to enable the math constants
like M_PI_2 that are used in openvdb headers, otherwise builds
will fail. This is needed for OpenVDB versions after v7.0.0.
(see commit d87bb3bb in the openvdb GitHub repo).

(Internal change: 2239319)
  • Loading branch information
sunyab authored and pixar-oss committed Jun 25, 2022
1 parent 0cd2f89 commit 33fd2b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pxr/imaging/hioOpenVDB/CMakeLists.txt
Expand Up @@ -7,6 +7,12 @@ if (NOT ${PXR_BUILD_GPU_SUPPORT})
return()
endif()

if (WIN32)
# OpenVDB uses constants from <cmath> that aren't available on
# Windows unless this is defined.
add_definitions(-D_USE_MATH_DEFINES)
endif()

pxr_library(hioOpenVDB
LIBRARIES
ar
Expand Down

0 comments on commit 33fd2b0

Please sign in to comment.