Skip to content

Commit

Permalink
linker workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrit committed Mar 8, 2024
1 parent 801d9cf commit 41ee8cc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions TinyEmbree/TinyEmbreeCore.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
namespace TinyEmbree;

internal static class TinyEmbreeCore {

#region LINKING_ON_WIN_WORKAROUND
static TinyEmbreeCore() {
// Some change in Embree between v3 and v4 causes the Win linker to no longer find tbb12.dll
// We work around this by first linking to TBB, so the linker will later just re-use the now
// successfully found tbb12.dll
// (the proper fix is likely deep within embree's CMake setup...)
if (System.OperatingSystem.IsWindows())
NativeLibrary.Load("tbb12.dll", System.Reflection.Assembly.GetExecutingAssembly(), DllImportSearchPath.SafeDirectories);
}
#endregion LINKING_ON_WIN_WORKAROUND

[DllImport("TinyEmbreeCore", CallingConvention = CallingConvention.Cdecl)]
public static extern nint InitScene();

Expand Down

0 comments on commit 41ee8cc

Please sign in to comment.