Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ add_library(tinycbor
src/cborpretty.c
src/cborvalidation.c
src/cbor.h
src/tinycbor-version.h
)
if(WITH_FREESTANDING)
target_compile_options(tinycbor PUBLIC
Expand Down Expand Up @@ -123,6 +122,9 @@ generate_export_header(tinycbor
EXPORT_FILE_NAME "tinycbor-export.h"
)

# Generate version header
configure_file(src/tinycbor-version.h.in tinycbor-version.h)

# Check for open_memstream and store the result in HAVE_OPEN_MEMSTREAM
check_symbol_exists(open_memstream stdio.h HAVE_OPEN_MEMSTREAM)
check_symbol_exists(funopen stdio.h HAVE_OPEN_FUNOPEN)
Expand Down
2 changes: 1 addition & 1 deletion src/cbor.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
#include "cbor_cfg.h"
#endif

#include "tinycbor-version.h"
#include "tinycbor-export.h"
#include "tinycbor-version.h"

#define TINYCBOR_VERSION ((TINYCBOR_VERSION_MAJOR << 16) | (TINYCBOR_VERSION_MINOR << 8) | TINYCBOR_VERSION_PATCH)

Expand Down
3 changes: 0 additions & 3 deletions src/tinycbor-version.h

This file was deleted.

7 changes: 7 additions & 0 deletions src/tinycbor-version.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* Copyright (C) 2025 Intel Corporation
* SPDX-License-Identifier: MIT
*/
/* This is a generated file */
#define TINYCBOR_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define TINYCBOR_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define TINYCBOR_VERSION_PATCH 0