CMake: force building the library as C99

As the comment says, to ensure we don't accidentally use something from
a new edition of the language than C99. In 2015 I think compilers still
defaulted to C99, but now in 2025, they default to C17.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Thiago Macieira
2025-03-18 16:43:48 -07:00
parent 3444a63ea0
commit ca1b419b89
+7
View File
@@ -78,6 +78,13 @@ else()
target_compile_definitions(tinycbor PUBLIC CBOR_NO_FLOATING_POINT)
endif()
set_target_properties(tinycbor PROPERTIES
# Force this library to link as C and compile as C99, to ensure we
# don't use something of a newer language level.
C_EXTENSIONS OFF
C_STANDARD 99
)
# Generate export macros
generate_export_header(tinycbor BASE_NAME "cbor" EXPORT_MACRO_NAME "CBOR_API" EXPORT_FILE_NAME "tinycbor-export.h")