Archived
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6442e749ca | ||
|
|
1bbc17b02f | ||
|
|
e96a3fb456 |
@@ -48,6 +48,7 @@ jobs:
|
||||
-DCMAKE_C_FLAGS="-Oz -g -Werror"
|
||||
- name: clang
|
||||
cmakeflags: >-
|
||||
-DBUILD_EXAMPLES=ON
|
||||
-DBUILD_SHARED_LIBS=ON
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DCMAKE_C_COMPILER=clang
|
||||
@@ -56,6 +57,7 @@ jobs:
|
||||
-DCMAKE_CXX_FLAGS_DEBUG="-Werror"
|
||||
- name: linux-g++
|
||||
cmakeflags: >-
|
||||
-DBUILD_EXAMPLES=ON
|
||||
-DBUILD_SHARED_LIBS=ON
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DCMAKE_C_COMPILER=gcc
|
||||
@@ -68,15 +70,16 @@ jobs:
|
||||
name: clang-small
|
||||
cmakeflags: >-
|
||||
-DBUILD_TESTING=OFF
|
||||
-DBUILD_TOOLS=OFF
|
||||
-DCMAKE_C_COMPILER=clang
|
||||
-DCMAKE_C_FLAGS="-Oz -g -Werror"
|
||||
-DCMAKE_CXX_COMPILER=clang++
|
||||
-DCMAKE_CXX_FLAGS="-O2 -g -Werror"
|
||||
-DWITH_TOOLS=OFF
|
||||
- os: macos-15-intel
|
||||
build_cfg:
|
||||
name: clang
|
||||
cmakeflags: >-
|
||||
-DBUILD_EXAMPLES=ON
|
||||
-DBUILD_SHARED_LIBS=ON
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DCMAKE_C_COMPILER=clang
|
||||
|
||||
+13
-2
@@ -35,7 +35,8 @@ option(WITH_FLOATING_POINT "Use floating point code in TinyCBOR" ON)
|
||||
option(WITH_FREESTANDING "Compile TinyCBOR in C freestanding mode" OFF)
|
||||
if(WITH_FLOATING_POINT AND NOT WITH_FREESTANDING)
|
||||
option(WITH_CBOR2JSON "Compile code to convert from CBOR to JSON" ON)
|
||||
option(WITH_TOOLS "Compile the TinyCBOR tools" ON)
|
||||
option(BUILD_EXAMPLES "Compile the TinyCBOR examples" OFF)
|
||||
option(BUILD_TOOLS "Compile the TinyCBOR tools" ON)
|
||||
endif()
|
||||
|
||||
# Include additional modules that are used unconditionally
|
||||
@@ -125,6 +126,9 @@ generate_export_header(tinycbor
|
||||
# Generate version header
|
||||
configure_file(src/tinycbor-version.h.in tinycbor-version.h)
|
||||
|
||||
# Generate pkgconfig file
|
||||
configure_file(tinycbor.pc.in tinycbor.pc @ONLY)
|
||||
|
||||
# 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)
|
||||
@@ -157,6 +161,10 @@ install(FILES
|
||||
${PROJECT_BINARY_DIR}/tinycbor-export.h
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tinycbor
|
||||
)
|
||||
install(FILES
|
||||
${CMAKE_BINARY_DIR}/tinycbor.pc
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
||||
)
|
||||
install(
|
||||
TARGETS tinycbor
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
@@ -169,10 +177,13 @@ install(
|
||||
set(PROJECT_LIBRARIES TinyCBOR)
|
||||
include(PackageConfig)
|
||||
|
||||
if(BUILD_EXAMPLES)
|
||||
add_subdirectory(examples)
|
||||
endif()
|
||||
if(BUILD_TESTING)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
if(WITH_TOOLS)
|
||||
if(BUILD_TOOLS)
|
||||
add_subdirectory(tools)
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# Copyright (C) 2025 Intel Corporation
|
||||
# SPDX-License-Identifier: MIT
|
||||
include(TinyCBORHelpers)
|
||||
|
||||
tinycbor_add_executable(simplereader simplereader.c)
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=@CMAKE_INSTALL_PREFIX@
|
||||
libdir=@CMAKE_INSTALL_LIBDIR@
|
||||
includedir=@CMAKE_INSTALL_INCLUDEDIR@
|
||||
|
||||
Name: TinyCBOR
|
||||
Description: A tiny CBOR encoder and decoder library
|
||||
Version: @version@
|
||||
Version: @PROJECT_VERSION@
|
||||
Libs: -L${libdir} -ltinycbor
|
||||
Libs.private: -lm
|
||||
Cflags: -I${includedir}/tinycbor
|
||||
|
||||
Reference in New Issue
Block a user