Ver Fonte

For MSVC compiler, make COMPILER_VERSION synonym to MSVC_VERSION.

Yao Wei Tjong 姚伟忠 há 9 anos atrás
pai
commit
c9de118b01

+ 1 - 4
CMake/Modules/CheckCompilerToolchain.cmake

@@ -83,10 +83,7 @@ if (MSVC)
     # On MSVC compiler, use the chosen CMake/VS generator to determine the ABI
     # On MSVC compiler, use the chosen CMake/VS generator to determine the ABI
     set (NATIVE_64BIT ${CMAKE_CL_64})
     set (NATIVE_64BIT ${CMAKE_CL_64})
     # Determine MSVC compiler version based on CMake informational variables
     # Determine MSVC compiler version based on CMake informational variables
-    if (NOT DEFINED COMPILER_VERSION)
-        string (REGEX REPLACE "^.*Visual Studio ([0-9]+\\.[0-9]+).*$" \\1 COMPILER_VERSION "${CMAKE_C_COMPILER}")    # Stringify for string replacement
-        set (COMPILER_VERSION ${COMPILER_VERSION} CACHE INTERNAL "MSVC Compiler version")
-    endif ()
+    set (COMPILER_VERSION ${MSVC_VERSION})
 else ()
 else ()
     # Determine the native ABI based on the size of pointer
     # Determine the native ABI based on the size of pointer
     check_native_define (__SIZEOF_POINTER__ SIZEOF_POINTER)
     check_native_define (__SIZEOF_POINTER__ SIZEOF_POINTER)

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

@@ -175,7 +175,7 @@ if (CMAKE_PROJECT_NAME STREQUAL Urho3D)
     option (URHO3D_DOCS "Generate documentation as part of normal build")
     option (URHO3D_DOCS "Generate documentation as part of normal build")
     option (URHO3D_DOCS_QUIET "Generate documentation as part of normal build, suppress generation process from sending anything to stdout")
     option (URHO3D_DOCS_QUIET "Generate documentation as part of normal build, suppress generation process from sending anything to stdout")
     option (URHO3D_PCH "Enable PCH support" TRUE)
     option (URHO3D_PCH "Enable PCH support" TRUE)
-    cmake_dependent_option (URHO3D_DATABASE_ODBC "Enable Database support with ODBC, requires vendor-specific ODBC driver" FALSE "NOT IOS AND NOT ANDROID AND NOT WEB;NOT MSVC OR NOT COMPILER_VERSION VERSION_LESS 14.0" FALSE)
+    cmake_dependent_option (URHO3D_DATABASE_ODBC "Enable Database support with ODBC, requires vendor-specific ODBC driver" FALSE "NOT IOS AND NOT ANDROID AND NOT WEB;NOT MSVC OR NOT MSVC_VERSION VERSION_LESS 1900" FALSE)
     option (URHO3D_DATABASE_SQLITE "Enable Database support with SQLite embedded")
     option (URHO3D_DATABASE_SQLITE "Enable Database support with SQLite embedded")
     cmake_dependent_option (URHO3D_MINIDUMPS "Enable minidumps on crash (VS only)" TRUE "MSVC" FALSE)
     cmake_dependent_option (URHO3D_MINIDUMPS "Enable minidumps on crash (VS only)" TRUE "MSVC" FALSE)
     option (URHO3D_FILEWATCHER "Enable filewatcher support" TRUE)
     option (URHO3D_FILEWATCHER "Enable filewatcher support" TRUE)