소스 검색

Search for DirectX SDK also on OpenGL build to fix build failure on old Visual Studio (2008/2010) if the SDK is not set as a VS default include directory.

Lasse Öörni 10 년 전
부모
커밋
f9d02e7299
2개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      CMake/Modules/FindDirect3D.cmake
  2. 4 1
      CMake/Modules/Urho3D-CMake-common.cmake

+ 1 - 1
CMake/Modules/FindDirect3D.cmake

@@ -96,7 +96,7 @@ else ()
             message (STATUS "DirectX SDK search skipped for MSVC 2012 and greater when using Direct3D 11")
         endif ()
     else ()
-        message (STATUS "DirectX SDK search skipped for MinGW. It is assumed that MinGW itself comes with the necessary headers & libraries for Direct3D")
+        message (STATUS "DirectX SDK search skipped for MinGW. It is assumed that MinGW itself comes with the necessary headers & libraries")
     endif ()
 endif ()
 

+ 4 - 1
CMake/Modules/Urho3D-CMake-common.cmake

@@ -346,7 +346,10 @@ endif ()
 # Find DirectX SDK include & library directories for Visual Studio. It is also possible to compile
 # without if a recent Windows SDK is installed. The SDK is not searched for with MinGW as it is
 # incompatible; rather, it is assumed that MinGW itself comes with the necessary headers & libraries.
-if (WIN32 AND NOT URHO3D_OPENGL)
+# Note that when building for OpenGL, any libraries are not used, but the include directory may
+# be necessary for DirectInput & DirectSound headers, if those are not present in the compiler's own
+# default includes.
+if (WIN32)
     find_package (Direct3D)
     if (DIRECT3D_FOUND)
         include_directories (${DIRECT3D_INCLUDE_DIRS})