Просмотр исходного кода

Need to stringify to guard against undefined environment variable.

Yao Wei Tjong 姚伟忠 10 лет назад
Родитель
Сommit
bfa54ece21

+ 1 - 1
CMake/Toolchains/android.toolchain.cmake

@@ -1150,7 +1150,7 @@ if( NOT CMAKE_C_COMPILER )
  # Urho3D - there are two ways to use ccache, by prefixing compiler toolchain with 'ccache' command (as done by NDK_CCACHE code branch above) or
  #          let ccache masquerade as the compiler by creating a symbolic link named as the compiler pointing back to 'ccache' command
  #          Urho3D has to use the second way because the first one does not handle our precompiled header build rules well
- elseif ($ENV{USE_CCACHE} AND NOT CMAKE_HOST_WIN32)
+ elseif ("$ENV{USE_CCACHE}" AND NOT CMAKE_HOST_WIN32)   # Need to stringify to guard against undefined environment variable
     execute_process (COMMAND which ccache RESULT_VARIABLE EXIT_CODE OUTPUT_VARIABLE CCACHE ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
     if (NOT EXIT_CODE EQUAL 0)
         set (CCACHE /usr/bin/ccache)

+ 1 - 1
CMake/Toolchains/emscripten.toolchain.cmake

@@ -46,7 +46,7 @@ if (CMAKE_HOST_WIN32)
     set (TOOL_EXT .bat)
 endif ()
 set (COMPILER_PATH ${EMSCRIPTEN_ROOT_PATH})
-if ($ENV{USE_CCACHE} AND NOT CMAKE_HOST_WIN32 AND FALSE)    # Disable ccache support for now until Emscripten has fixed https://github.com/kripken/emscripten/issues/3365
+if ("$ENV{USE_CCACHE}" AND NOT CMAKE_HOST_WIN32 AND FALSE)    # Disable ccache support for now until Emscripten has fixed https://github.com/kripken/emscripten/issues/3365
     if (NOT $ENV{PATH} MATCHES ${EMSCRIPTEN_ROOT_PATH})
         message (FATAL_ERROR "The bin directory containing the compiler toolchain (${EMSCRIPTEN_ROOT_PATH}) has not been added in the PATH environment variable. "
             "This is required to enable ccache support for Emscripten compiler toolchain.")