|
|
@@ -86,25 +86,23 @@ cmake_dependent_option (URHO3D_NETWORK "Enable networking support" TRUE "NOT EMS
|
|
|
cmake_dependent_option (URHO3D_DATABASE_ODBC "Enable Database support with ODBC, requires vendor-specific ODBC driver" FALSE "NOT IOS AND NOT ANDROID AND NOT EMSCRIPTEN" FALSE)
|
|
|
option (URHO3D_PHYSICS "Enable physics support" TRUE)
|
|
|
option (URHO3D_URHO2D "Enable 2D graphics and physics support" TRUE)
|
|
|
-if (MINGW AND NOT DEFINED URHO3D_SSE)
|
|
|
- # Certain MinGW versions fail to compile SSE code. This is the initial guess for known "bad" version range, and can be tightened later
|
|
|
- execute_process (COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION ERROR_QUIET)
|
|
|
- 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.")
|
|
|
+if (NOT DEFINED URHO3D_DEFAULT_SSE)
|
|
|
+ # Set the default to true for all the platforms that support SSE except the following
|
|
|
+ set (URHO3D_DEFAULT_SSE TRUE)
|
|
|
+ if (MINGW)
|
|
|
+ # Certain MinGW versions fail to compile SSE code. This is the initial guess for known "bad" version range, and can be tightened later
|
|
|
+ execute_process (COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION ERROR_QUIET)
|
|
|
+ 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.")
|
|
|
+ set (URHO3D_DEFAULT_SSE FALSE)
|
|
|
+ endif ()
|
|
|
+ elseif (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 ()
|
|
|
- set (URHO3D_DEFAULT_SSE TRUE)
|
|
|
endif ()
|
|
|
-else ()
|
|
|
- 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()
|
|
|
+ set (URHO3D_DEFAULT_SSE ${URHO3D_DEFAULT_SSE} CACHE INTERNAL "Default value for URHO3D_SSE build option")
|
|
|
endif ()
|
|
|
-cmake_dependent_option (URHO3D_SSE "Enable SSE instruction set (Intel platform only including Android on Intel Atom)" ${URHO3D_DEFAULT_SSE} "NOT ARM" FALSE)
|
|
|
+cmake_dependent_option (URHO3D_SSE "Enable SSE2 instruction set (HTML5 and Intel platforms 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)
|