RenderKit / embree

Embree ray tracing kernels repository.
Apache License 2.0
2.32k stars 383 forks source link

Building 3.13.4 on Windows using Visual Studio 2022 17.6.2 and OneAPI 2023.1 #446

Open loopless opened 1 year ago

loopless commented 1 year ago

I have having a difficult time building Embree 3.13.4 on Windows VS 2022 17.6 due to include file conflicts

From what I can see, platform.h includes "memory" which ultimately includes "cstring" which includes "string.h" but the compiler finds the Embree "string.h" and everything falls apart.

4>In file included from sysinfo.cpp:4: 4>In file included from ./sysinfo.h:15: 4>In file included from ./platform.h:12: 4>In file included from C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.36.32532\include\memory:12: 4>In file included from C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.36.32532\include\iosfwd:13: 4>In file included from C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.36.32532\include\cstring:12: 4>In file included from .\string.h:7: 4>In file included from ./../math/vec2.h:6: 4>In file included from ./../math/math.h:7: 4>./../math/../sys/intrinsics.h(362,9): : error : use of undeclared identifier 'unlikely' 4> if (unlikely(x == 0)) return 32; 4> ^

dopitz commented 1 year ago

Hi, unfortunately I could not reproduce this. I was using a clean windows 11 installation using VS 2022 with the Intel OneAPI 2023.1 and cmake 3.27.0

inside embree-3.13.4 folder

cmake -B build -G "Visual Studio 17 2022"
cmake --build build