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