소스 검색

Only find Direct3D package when not using OpenGL on Windows platform.
Fix #756.

Yao Wei Tjong 姚伟忠 10 년 전
부모
커밋
7547b0213a
2개의 변경된 파일3개의 추가작업 그리고 8개의 파일을 삭제
  1. 1 1
      CMake/Modules/FindDirect3D.cmake
  2. 2 7
      CMake/Modules/Urho3D-CMake-common.cmake

+ 1 - 1
CMake/Modules/FindDirect3D.cmake

@@ -30,7 +30,7 @@
 #  DIRECT3D_DLL
 #
 
-if (NOT WIN32 OR DIRECT3D_FOUND)
+if (NOT WIN32 OR URHO3D_OPENGL OR DIRECT3D_FOUND)
     return ()
 endif ()
 

+ 2 - 7
CMake/Modules/Urho3D-CMake-common.cmake

@@ -361,13 +361,8 @@ if (NOT URHO3D_LIB_TYPE STREQUAL SHARED)
     add_definitions (-DURHO3D_STATIC_DEFINE)
 endif ()
 
-# Find Direct3D include & library directories for Visual Studio in MS Windows SDK or DirectX SDK.
-# 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.
-# 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 Direct3D include & library directories in MS Windows SDK or DirectX SDK when not using OpenGL.
+if (WIN32 AND NOT URHO3D_OPENGL)
     find_package (Direct3D REQUIRED)
     if (DIRECT3D_INCLUDE_DIRS)
         include_directories (${DIRECT3D_INCLUDE_DIRS})