CMake: fix add_subdirectory(SwiftShader) when CMAKE_BUILD_TYPE is set in parent project

If parent project sets CMAKE_BUILD_TYPE as a non-cache variable
(e.g. like https://github.com/google/amber does), CMake emits an error
because we're trying to set it as a cache variable.

Bug: b/145758253
Change-Id: Ie169c45dd11674be9e40610f5dd711b8fd5830f8
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43952
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e64465c..daea8a5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -93,8 +93,8 @@
 
 if(NOT CMAKE_BUILD_TYPE)
     set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The type of build: Debug Release MinSizeRel RelWithDebInfo." FORCE)
+    set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release MinSizeRel RelWithDebInfo)
 endif()
-set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release MinSizeRel RelWithDebInfo)
 
 function (option_if_not_defined name description default)
     if(NOT DEFINED ${name})