Archived
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:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user