Skip to content

Commit fb046ea

Browse files
author
Laurence Lundblade
committed
backwards compatibility for float options
1 parent 9da29f4 commit fb046ea

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@ option(QCBOR_DISABLE_ENCODE_USAGE_GUARDS "Disable (safely) encoding usage
3939
option(QCBOR_DISABLE_INDEFINITE_LENGTH_STRINGS "Disable encoding and decoding of indefinite-length strings" OFF)
4040
option(QCBOR_DISABLE_INDEFINITE_LENGTH_ARRAYS "Disable encoding and decoding of indefinite-length arrays and maps" OFF)
4141

42+
43+
# This is backwards compatibility for float-related cmake options -- decided
44+
# to just make the cmake option the same as the #define
45+
if(DEFINED QCBOR_OPT_DISABLE_PREFERRED_FLOAT)
46+
set(QCBOR_DISABLE_PREFERRED_FLOAT ${QCBOR_OPT_DISABLE_PREFERRED_FLOAT} CACHE BOOL "xx" FORCE)
47+
endif()
48+
49+
if(DEFINED QCBOR_OPT_DISABLE_ALL_FLOAT)
50+
set(USEFULBUF_DISABLE_ALL_FLOAT ${QCBOR_OPT_DISABLE_ALL_FLOAT} CACHE BOOL "xx" FORCE)
51+
endif()
52+
53+
if(DEFINED QCBOR_OPT_DISABLE_FLOAT_HW_USE)
54+
set(QCBOR_DISABLE_FLOAT_HW_USE ${QCBOR_OPT_DISABLE_FLOAT_HW_USE} CACHE BOOL "xx" FORCE)
55+
endif()
56+
57+
4258
if (BUILD_QCBOR_WARN)
4359
# Compile options applying to all targets in current directory and below
4460
add_compile_options(-Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wcast-qual)

0 commit comments

Comments
 (0)