Browse Source

Simplify the construct for guarding against empty output string.

Yao Wei Tjong 姚伟忠 11 years ago
parent
commit
843f6c733c
1 changed files with 3 additions and 5 deletions
  1. 3 5
      Source/CMake/Modules/Urho3D-CMake-common.cmake

+ 3 - 5
Source/CMake/Modules/Urho3D-CMake-common.cmake

@@ -42,11 +42,9 @@ set (URHO3D_DEFAULT_64BIT FALSE)
 if (NOT MSVC)
 if (NOT MSVC)
     # On non-MSVC compiler, default to build 64-bit when the host system has a 64-bit build environment
     # On non-MSVC compiler, default to build 64-bit when the host system has a 64-bit build environment
     execute_process (COMMAND echo COMMAND ${CMAKE_C_COMPILER} -E -dM - OUTPUT_VARIABLE PREDEFINED_MACROS ERROR_QUIET)
     execute_process (COMMAND echo COMMAND ${CMAKE_C_COMPILER} -E -dM - OUTPUT_VARIABLE PREDEFINED_MACROS ERROR_QUIET)
-    if (NOT ${PREDEFINED_MACROS} STREQUAL "")
-        string (REGEX MATCH "#define +__x86_64__ +1" matched ${PREDEFINED_MACROS})
-        if (matched)
-            set (URHO3D_DEFAULT_64BIT TRUE)
-        endif ()
+    string (REGEX MATCH "#define +__x86_64__ +1" matched "${PREDEFINED_MACROS}")
+    if (matched)
+        set (URHO3D_DEFAULT_64BIT TRUE)
     endif ()
     endif ()
 endif ()
 endif ()
 option (URHO3D_64BIT "Enable 64-bit build" ${URHO3D_DEFAULT_64BIT})
 option (URHO3D_64BIT "Enable 64-bit build" ${URHO3D_DEFAULT_64BIT})