Skip to content

Commit

Permalink
build: handle case where OIIO uses a different Imath than OSL (#1758)
Browse files Browse the repository at this point in the history
This can come up if, for example, you build an OIIO using a static
Imath library that's more recent than what you're forced to use for
your OSL build. (Don't ask, you don't want to know.) So we need
to see half.h before we include any OIIO headers. But it's the OIIO
headers that adjudicated where we get half.h from, so we need to
be a little more explicit in, of all places, rend_lib.h of testrender.

Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz authored Dec 3, 2023
1 parent e154a22 commit 3d52f39
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/testrender/cuda/rend_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

#pragma once

#include <OSL/oslconfig.h>

#if defined(__has_include) && __has_include(<Imath/half.h>)
# include <Imath/half.h>
#elif OSL_USING_IMATH >= 3
# include <Imath/half.h>
#else
# include <OpenEXR/half.h>
#endif

#include "../../liboslexec/string_hash.h"
#include <OSL/oslexec.h>

Expand Down

0 comments on commit 3d52f39

Please sign in to comment.