Commit cbb5a10e by Ben Clayton

CMake: Add flag for controlling the logging level

Wrapped in a `if(NOT DEFINED SWIFTSHADER_LOGGING_LEVEL)` so that it can be controlled by a parent project with a simple `set()`, much like `option_if_not_defined()`. Bug: b/169966461 Change-Id: I53a072289e6eac589e7640970045174076492774 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/48948 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com>
parent 01144ed9
......@@ -166,6 +166,11 @@ set_property(CACHE SWIFTSHADER_LLVM_VERSION PROPERTY STRINGS "10.0")
set(REACTOR_DEFAULT_OPT_LEVEL "Default" CACHE STRING "Reactor default optimization level")
set_property(CACHE REACTOR_DEFAULT_OPT_LEVEL PROPERTY STRINGS "None" "Less" "Default" "Aggressive")
if(NOT DEFINED SWIFTSHADER_LOGGING_LEVEL)
set(SWIFTSHADER_LOGGING_LEVEL "Info" CACHE STRING "SwiftShader logging level")
set_property(CACHE SWIFTSHADER_LOGGING_LEVEL PROPERTY STRINGS "Verbose" "Debug" "Info" "Warn" "Error" "Fatal" "Disabled")
endif()
# LLVM disallows calling cmake . from the main LLVM dir, the reason is that
# it builds header files that could overwrite the orignal ones. Here we
# want to include LLVM as a subdirectory and even though it wouldn't cause
......@@ -553,6 +558,10 @@ if(REACTOR_DEFAULT_OPT_LEVEL)
list(APPEND SWIFTSHADER_COMPILE_OPTIONS "-DREACTOR_DEFAULT_OPT_LEVEL=${REACTOR_DEFAULT_OPT_LEVEL}")
endif()
if(DEFINED SWIFTSHADER_LOGGING_LEVEL)
list(APPEND SWIFTSHADER_COMPILE_OPTIONS "-DSWIFTSHADER_LOGGING_LEVEL=${SWIFTSHADER_LOGGING_LEVEL}")
endif()
if(WIN32)
add_definitions(-DWINVER=0x501 -DNOMINMAX -DSTRICT)
set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "" "lib")
......
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