Skip to content

Commit 3d52f39

Browse files
authored
build: handle case where OIIO uses a different Imath than OSL (#1758)
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 <lg@larrygritz.com>
1 parent e154a22 commit 3d52f39

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/testrender/cuda/rend_lib.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
#pragma once
66

7+
#include <OSL/oslconfig.h>
8+
9+
#if defined(__has_include) && __has_include(<Imath/half.h>)
10+
# include <Imath/half.h>
11+
#elif OSL_USING_IMATH >= 3
12+
# include <Imath/half.h>
13+
#else
14+
# include <OpenEXR/half.h>
15+
#endif
16+
717
#include "../../liboslexec/string_hash.h"
818
#include <OSL/oslexec.h>
919

0 commit comments

Comments
 (0)