File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848 -DCMAKE_C_FLAGS="-Oz -g -Werror"
4949 - name : clang
5050 cmakeflags : >-
51+ -DBUILD_EXAMPLES=ON
5152 -DBUILD_SHARED_LIBS=ON
5253 -DCMAKE_BUILD_TYPE=Debug
5354 -DCMAKE_C_COMPILER=clang
5657 -DCMAKE_CXX_FLAGS_DEBUG="-Werror"
5758 - name : linux-g++
5859 cmakeflags : >-
60+ -DBUILD_EXAMPLES=ON
5961 -DBUILD_SHARED_LIBS=ON
6062 -DCMAKE_BUILD_TYPE=Debug
6163 -DCMAKE_C_COMPILER=gcc
@@ -68,15 +70,16 @@ jobs:
6870 name : clang-small
6971 cmakeflags : >-
7072 -DBUILD_TESTING=OFF
73+ -DBUILD_TOOLS=OFF
7174 -DCMAKE_C_COMPILER=clang
7275 -DCMAKE_C_FLAGS="-Oz -g -Werror"
7376 -DCMAKE_CXX_COMPILER=clang++
7477 -DCMAKE_CXX_FLAGS="-O2 -g -Werror"
75- -DWITH_TOOLS=OFF
7678 - os : macos-15-intel
7779 build_cfg :
7880 name : clang
7981 cmakeflags : >-
82+ -DBUILD_EXAMPLES=ON
8083 -DBUILD_SHARED_LIBS=ON
8184 -DCMAKE_BUILD_TYPE=Debug
8285 -DCMAKE_C_COMPILER=clang
Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ option(WITH_FLOATING_POINT "Use floating point code in TinyCBOR" ON)
3535option (WITH_FREESTANDING "Compile TinyCBOR in C freestanding mode" OFF )
3636if (WITH_FLOATING_POINT AND NOT WITH_FREESTANDING)
3737 option (WITH_CBOR2JSON "Compile code to convert from CBOR to JSON" ON )
38- option (WITH_TOOLS "Compile the TinyCBOR tools" ON )
38+ option (BUILD_EXAMPLES "Compile the TinyCBOR examples" OFF )
39+ option (BUILD_TOOLS "Compile the TinyCBOR tools" ON )
3940endif ()
4041
4142# Include additional modules that are used unconditionally
@@ -176,10 +177,13 @@ install(
176177set (PROJECT_LIBRARIES TinyCBOR)
177178include (PackageConfig )
178179
180+ if (BUILD_EXAMPLES)
181+ add_subdirectory (examples )
182+ endif ()
179183if (BUILD_TESTING)
180184 enable_testing ()
181185 add_subdirectory (tests )
182186endif ()
183- if (WITH_TOOLS )
187+ if (BUILD_TOOLS )
184188 add_subdirectory (tools )
185189endif ()
Original file line number Diff line number Diff line change 1+ # Copyright (C) 2025 Intel Corporation
2+ # SPDX-License-Identifier: MIT
3+ include (TinyCBORHelpers )
4+
5+ tinycbor_add_executable (simplereader simplereader.c )
You can’t perform that action at this time.
0 commit comments