Browse Source

Merge branch 'juj-allow_enable_sse_on_emscripten' into master.

Yao Wei Tjong 姚伟忠 10 years ago
parent
commit
a6dbb2c06d
1 changed files with 8 additions and 2 deletions
  1. 8 2
      CMake/Modules/Urho3D-CMake-common.cmake

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

@@ -96,9 +96,15 @@ if (MINGW AND NOT DEFINED URHO3D_SSE)
         set (URHO3D_DEFAULT_SSE TRUE)
     endif ()
 else ()
-    set (URHO3D_DEFAULT_SSE TRUE)
+    if (EMSCRIPTEN)
+        # In Emscripten, default to false for targeting SSE2, since the SIMD.js specification is not yet widely adopted in browsers.
+        set (URHO3D_DEFAULT_SSE FALSE)
+    else()
+        # In other platforms, we can safely default to enabling SSE2.
+        set (URHO3D_DEFAULT_SSE TRUE)
+    endif()
 endif ()
-cmake_dependent_option (URHO3D_SSE "Enable SSE instruction set (Intel platform only including Android on Intel Atom)" ${URHO3D_DEFAULT_SSE} "NOT ARM AND NOT EMSCRIPTEN" FALSE)
+cmake_dependent_option (URHO3D_SSE "Enable SSE instruction set (Intel platform only including Android on Intel Atom)" ${URHO3D_DEFAULT_SSE} "NOT ARM" FALSE)
 if (CMAKE_PROJECT_NAME STREQUAL Urho3D)
     cmake_dependent_option (URHO3D_LUAJIT_AMALG "Enable LuaJIT amalgamated build (LuaJIT only)" FALSE "URHO3D_LUAJIT" FALSE)
     cmake_dependent_option (URHO3D_SAFE_LUA "Enable Lua C++ wrapper safety checks (Lua/LuaJIT only)" FALSE "URHO3D_LUA OR URHO3D_LUAJIT" FALSE)