From 3d52f3906b12d38ad0f4b991a8f9ea678171bd28 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Sun, 3 Dec 2023 00:32:42 -0800 Subject: [PATCH] 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 --- src/testrender/cuda/rend_lib.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/testrender/cuda/rend_lib.h b/src/testrender/cuda/rend_lib.h index a35fe9060..12ab2e7e7 100644 --- a/src/testrender/cuda/rend_lib.h +++ b/src/testrender/cuda/rend_lib.h @@ -4,6 +4,16 @@ #pragma once +#include + +#if defined(__has_include) && __has_include() +# include +#elif OSL_USING_IMATH >= 3 +# include +#else +# include +#endif + #include "../../liboslexec/string_hash.h" #include