Commit 31038eae by Antonio Maiorano

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: 's avatarBen Clayton <bclayton@google.com> Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent 1e2fba30
...@@ -93,8 +93,8 @@ find_library(XCB xcb) ...@@ -93,8 +93,8 @@ find_library(XCB xcb)
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The type of build: Debug Release MinSizeRel RelWithDebInfo." FORCE) 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() endif()
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release MinSizeRel RelWithDebInfo)
function (option_if_not_defined name description default) function (option_if_not_defined name description default)
if(NOT DEFINED ${name}) if(NOT DEFINED ${name})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment