瀏覽代碼

Only give warning for 'bad' MinGW compiler when no SSE option given.
So that user does not receive the same warning subsequently after taking action to set the URHO3D_SSE option explicitly or after the correct setting has been set by the script.

Yao Wei Tjong 姚伟忠 11 年之前
父節點
當前提交
becb97cdb6
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Source/CMake/Modules/Urho3D-CMake-common.cmake

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

@@ -21,8 +21,8 @@
 #
 #
 
 
 # Certain MinGW versions fail to compile SSE code. This is the initial guess for known "bad" version range, and can be tightened later
 # Certain MinGW versions fail to compile SSE code. This is the initial guess for known "bad" version range, and can be tightened later
-if (MINGW)
-    execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+if (MINGW AND NOT DEFINED URHO3D_SSE)
+    execute_process (COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
     if (GCC_VERSION VERSION_LESS 4.9.1)
     if (GCC_VERSION VERSION_LESS 4.9.1)
         message (WARNING "Disabling SSE by default due to MinGW version. It is recommended to upgrade to MinGW with GCC >= 4.9.1. You can also try to re-enable SSE with CMake option -DURHO3D_SSE=1, but this may result in compile errors.")
         message (WARNING "Disabling SSE by default due to MinGW version. It is recommended to upgrade to MinGW with GCC >= 4.9.1. You can also try to re-enable SSE with CMake option -DURHO3D_SSE=1, but this may result in compile errors.")
         set (URHO3D_DEFAULT_SSE FALSE)
         set (URHO3D_DEFAULT_SSE FALSE)