Fix backward compatibility for CONFIG_LOWBITDEPTH.
1. If CONFIG_LOWBITDEPTH is defined, emit a warning message to suggest
using FORCE_HIGHBITDEPTH_DECODING instead. In addition, if
CONFIG_LOWBITDEPTH is defined as 0, set FORCE_HIGHBITDEPTH_DECODING to
1. (If CONFIG_LOWBITDEPTH is defined as 1, we don't need to set
FORCE_HIGHBITDEPTH_DECODING to 0 because that is the default.)
2. Add FORCE as the final argument to the set() command enabling
FORCE_HIGHBITDEPTH_DECODING. Tom Finegan suggested this change.
Tested:
cmake ../aom
cmake ../aom -DFORCE_HIGHBITDEPTH_DECODING=0
cmake ../aom -DFORCE_HIGHBITDEPTH_DECODING=1
cmake ../aom -DCONFIG_LOWBITDEPTH=0
cmake ../aom -DCONFIG_LOWBITDEPTH=1
Then inspect the value of FORCE_HIGHBITDEPTH_DECODING in the files
generated by cmake. The "cmake ../aom -DCONFIG_LOWBITDEPTH=0" and
"cmake ../aom -DCONFIG_LOWBITDEPTH=1" commands should cause cmake to
emit the warning message:
CONFIG_LOWBITDEPTH has been removed. Use -DFORCE_HIGHBITDEPTH_DECODING=1
instead of -DCONFIG_LOWBITDEPTH=0 and -DFORCE_HIGHBITDEPTH_DECODING=0
instead of -DCONFIG_LOWBITDEPTH=1.
and set FORCE_HIGHBITDEPTH_DECODING to the opposite value (0 <=> 1).
BUG=aomedia:2474
Change-Id: I027aeafbb8a23837dcc7f7718f5705354f616393
diff --git a/build/cmake/aom_configure.cmake b/build/cmake/aom_configure.cmake
index 635b57a..754b114 100644
--- a/build/cmake/aom_configure.cmake
+++ b/build/cmake/aom_configure.cmake
@@ -24,10 +24,15 @@
include("${AOM_ROOT}/build/cmake/compiler_tests.cmake")
include("${AOM_ROOT}/build/cmake/util.cmake")
-if(CONFIG_LOWBITDEPTH)
- message(WARNING "CONFIG_LOWBITDEPTH has been removed, \
- enabling FORCE_HIGHBITDEPTH_DECODING")
- set(FORCE_HIGHBITDEPTH_DECODING 1 CACHE NUMBER "${cmake_cmdline_helpstring}")
+if(DEFINED CONFIG_LOWBITDEPTH)
+ message(WARNING "CONFIG_LOWBITDEPTH has been removed. \
+ Use -DFORCE_HIGHBITDEPTH_DECODING=1 instead of -DCONFIG_LOWBITDEPTH=0 \
+ and -DFORCE_HIGHBITDEPTH_DECODING=0 instead of -DCONFIG_LOWBITDEPTH=1.")
+ if(NOT CONFIG_LOWBITDEPTH)
+ set(FORCE_HIGHBITDEPTH_DECODING
+ 1
+ CACHE NUMBER "${cmake_cmdline_helpstring}" FORCE)
+ endif()
endif()
if(FORCE_HIGHBITDEPTH_DECODING AND NOT CONFIG_AV1_HIGHBITDEPTH)