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>
This commit is contained in:
Larry Gritz
2023-12-03 00:32:42 -08:00
committed by GitHub
parent e154a220b6
commit 3d52f3906b
+10
View File
@@ -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>