Skip to content

Commit

Permalink
build_usd.py: Remove OpenEXR dependency when building OpenImageIO
Browse files Browse the repository at this point in the history
OpenImageIO no longer needs to support .exr images, since USD
supports that format natively. So we remove OpenEXR from the list
of dependencies and explicitly turn off EXR support when
building OIIO.

(Internal change: 2331174)
  • Loading branch information
sunyab authored and pixar-oss committed Jun 13, 2024
1 parent 1b6a1ea commit 5332d62
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions build_scripts/build_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,15 +1260,11 @@ def InstallOpenImageIO(context, force, buildArgs):
'-DUSE_PYTHON=OFF',
'-DSTOP_ON_WARNING=OFF']

# OIIO's FindOpenEXR module circumvents CMake's normal library
# search order, which causes versions of OpenEXR installed in
# /usr/local or other hard-coded locations in the module to
# take precedence over the version we've built, which would
# normally be picked up when we specify CMAKE_PREFIX_PATH.
# This may lead to undefined symbol errors at build or runtime.
# So, we explicitly specify the OpenEXR we want to use here.
extraArgs.append('-DOPENEXR_ROOT="{instDir}"'
.format(instDir=context.instDir))
# USD natively supports reading .exr files. Disable support in
# OpenImageIO so we don't need to build OpenEXR as a dependency,
# and so we don't accidentally pick up an OpenEXR library outside
# of our build.
extraArgs.append('-DUSE_OPENEXR=OFF')

# If Ptex support is disabled in USD, disable support in OpenImageIO
# as well. This ensures OIIO doesn't accidentally pick up a Ptex
Expand Down Expand Up @@ -2263,7 +2259,7 @@ def ForceBuildDependency(self, dep):
requiredDependencies += [BLOSC, BOOST, OPENEXR, OPENVDB, TBB]

if context.buildOIIO:
requiredDependencies += [BOOST, JPEG, TIFF, PNG, OPENEXR, OPENIMAGEIO]
requiredDependencies += [BOOST, JPEG, TIFF, PNG, OPENIMAGEIO]

if context.buildOCIO:
requiredDependencies += [OPENCOLORIO]
Expand Down

0 comments on commit 5332d62

Please # to comment.