Skip to content

Commit 7980cfd

Browse files
committed
Allow Embree to build with custom compiler flags
Undefine all __AVX* defines to prevent hitting code paths that result in linker errors. Change-Id: I60d8a77c449607762bd5449ead21180744c17dff Reviewed-by: Andy Nichols <andy.nichols@qt.io>
1 parent 5074a6a commit 7980cfd

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

src/3rdparty/embree/common/sys/platform.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,3 +376,11 @@ namespace embree
376376
}
377377

378378
}
379+
380+
// Qt's bundled build enforces EMBREE_TARGET_SSE2, it must not hit the AVX code paths
381+
#undef __AVX512VL__
382+
#undef __AVX512F__
383+
#undef __AVX2__
384+
#undef __AVXI__
385+
#undef __AVX__
386+
#undef __SSE4_2__
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From bcdf980cd1293e10e3f661e847f41b4e7ec3a4e4 Mon Sep 17 00:00:00 2001
2+
From: Laszlo Agocs <laszlo.agocs@qt.io>
3+
Date: Fri, 3 Jun 2022 10:35:15 +0200
4+
Subject: [PATCH] Allow Embree to build with custom compiler flags
5+
6+
Undefine all __AVX* defines to prevent hitting code paths
7+
that result in linker errors.
8+
9+
Change-Id: I60d8a77c449607762bd5449ead21180744c17dff
10+
---
11+
src/3rdparty/embree/common/sys/platform.h | 8 ++++++++
12+
1 file changed, 8 insertions(+)
13+
14+
diff --git a/src/3rdparty/embree/common/sys/platform.h b/src/3rdparty/embree/common/sys/platform.h
15+
index 7ba5a19f..78d8afce 100644
16+
--- a/src/3rdparty/embree/common/sys/platform.h
17+
+++ b/src/3rdparty/embree/common/sys/platform.h
18+
@@ -376,3 +376,11 @@ namespace embree
19+
}
20+
21+
}
22+
+
23+
+// Qt's bundled build enforces EMBREE_TARGET_SSE2, it must not hit the AVX code paths
24+
+#undef __AVX512VL__
25+
+#undef __AVX512F__
26+
+#undef __AVX2__
27+
+#undef __AVXI__
28+
+#undef __AVX__
29+
+#undef __SSE4_2__
30+
--
31+
2.36.1.windows.1
32+

0 commit comments

Comments
 (0)