Przeglądaj źródła

Do not use system paths when searching for the d3dcompiler DLL, to avoid using the wrong architecture.

Lasse Öörni 10 lat temu
rodzic
commit
43c9120e33
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      CMake/Modules/FindDirect3D.cmake

+ 3 - 1
CMake/Modules/FindDirect3D.cmake

@@ -48,9 +48,11 @@ else ()
     set (PATH_SUFFIX x86)
 endif ()
 # Only need to search the DLL as a proxy for the presence of the MS Windows SDK
+# Note: do not use default paths such as the PATH variable, to potentially avoid using a wrong architecture DLL
 find_file (DIRECT3D_DLL NAMES ${DLL_NAMES} PATHS
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]/Redist/D3D/${PATH_SUFFIX}"
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]/Redist/D3D/${PATH_SUFFIX}")
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]/Redist/D3D/${PATH_SUFFIX}"
+    NO_DEFAULT_PATH)
 if (DIRECT3D_DLL OR MINGW)  # MinGW compiler toolchain is assumed to come with its own necessary headers and libraries for Direct3D
     if (NOT URHO3D_D3D11)
         set (DIRECT3D_LIBRARIES d3d9 d3dcompiler)