-
Notifications
You must be signed in to change notification settings - Fork 208
add CMake support #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add CMake support #201
Changes from all commits
4509c99
3c4c103
edd2b9e
c3c0f7e
d87c786
573e5a4
666beac
4e50bef
aa37315
dd2fa30
b0840db
f1db0ab
6643c17
e52b1d5
9a13e92
7dce551
dbf8f13
cb37252
814ec02
9ed9d03
5910b7d
e2a4ed1
bf919a2
f798bc0
6f001e6
2d8e73b
5521ccf
b8ea2eb
14299a2
0b4f7f6
a8515c4
eddbf5b
5d871b2
d503c11
95129b8
34c8452
e26ff9a
87a7a93
5159ec3
8adc3cf
d393c16
10f7399
c223ee6
b422a41
9ded7dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,28 @@ | ||
| version: 0.5.4-build-{build} | ||
| version: 0.6-build-{build} | ||
| pull_requests: | ||
| do_not_increment_build_number: true | ||
| image: | ||
| - Visual Studio 2015 | ||
| - Visual Studio 2017 | ||
| - Visual Studio 2019 | ||
| install: | ||
| - cmd: >- | ||
| set tests=1 | ||
| if /i "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86) & (set QTDIR=C:\Qt\5.13\msvc2017) | ||
|
|
||
| if /i "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" (call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86) & (set QTDIR=C:\Qt\5.9\msvc2015) | ||
|
|
||
| if /i "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64) & (set QTDIR=C:\Qt\5.12\msvc2017_64) | ||
|
|
||
| if /i "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" (call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64) & (set QTDIR=C:\Qt\5.15\msvc2019_64) & set CFLAGS=/arch:AVX2 | ||
| if /i "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" (call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64) & (set QTDIR=C:\Qt\6.1\msvc2019_64) | ||
|
|
||
| set path=%PATH%;%QTDIR%\bin | ||
| build_script: | ||
| - cmd: >- | ||
| nmake -f Makefile.nmake -nologo CFLAGS="%CFLAGS% -W3 -Os -MDd" | ||
| nmake -f Makefile.nmake -nologo CFLAGS="-W3 -Os -MDd" | ||
|
|
||
| cd tests | ||
|
|
||
| if /i "%tests%"=="1" qmake CONFIG-=release CONFIG+=debug | ||
| qmake CONFIG-=release CONFIG+=debug | ||
|
|
||
| if /i "%tests%"=="1" nmake -nologo -s | ||
| nmake -nologo -s | ||
| test_script: | ||
| - cmd: >- | ||
| if /i "%tests%"=="1" nmake -s -nologo TESTARGS=-silent check | ||
|
|
||
| if /i "%tests%"=="0" echo Tests skipped. | ||
| nmake -s -nologo TESTARGS=-silent check | ||
| artifacts: | ||
| - path: lib\tinycbor.lib | ||
| deploy: off |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,3 +79,5 @@ src/cjson | |
| src/doxygen.log | ||
| !/Makefile | ||
| .config | ||
| build/ | ||
| .vscode/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # /**************************************************************************** | ||
| # ** | ||
| # ** Copyright (C) 2015 Intel Corporation | ||
| # ** | ||
| # ** Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| # ** of this software and associated documentation files (the "Software"), to deal | ||
| # ** in the Software without restriction, including without limitation the rights | ||
| # ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| # ** copies of the Software, and to permit persons to whom the Software is | ||
| # ** furnished to do so, subject to the following conditions: | ||
| # ** | ||
| # ** The above copyright notice and this permission notice shall be included in | ||
| # ** all copies or substantial portions of the Software. | ||
| # ** | ||
| # ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| # ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| # ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| # ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| # ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| # ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| # ** THE SOFTWARE. | ||
| # ** | ||
| # ****************************************************************************/ | ||
|
|
||
| project(intel_tinycbor LANGUAGES C) | ||
|
|
||
| cmake_minimum_required(VERSION 3.10) | ||
|
|
||
| option(build_tools "Build the cbor tools. Note: This will install the cjson library as a dependency" OFF) | ||
|
|
||
| add_library(tinycbor | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. File listing has changed.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think all the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are new files in the 0.6 release. That's what needs updating here. |
||
| ${CMAKE_CURRENT_LIST_DIR}/src/cborencoder.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/cborencoder_close_container_checked.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/cborerrorstrings.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/cborparser.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/cborparser_dup_string.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/cborpretty.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/cborpretty_stdio.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/cbortojson.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/cborvalidation.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/open_memstream.c | ||
| ) | ||
|
|
||
| target_include_directories(tinycbor | ||
| PUBLIC | ||
| ${CMAKE_CURRENT_LIST_DIR}/src | ||
| ) | ||
|
|
||
| add_library(intel::tinycbor ALIAS tinycbor) | ||
|
|
||
| add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/examples) | ||
|
|
||
| if(${build_tools}) | ||
| add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/tools) | ||
| endif() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0.5.4 | ||
| 0.6.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # /**************************************************************************** | ||
| # ** | ||
| # ** Copyright (C) 2015 Intel Corporation | ||
| # ** | ||
| # ** Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| # ** of this software and associated documentation files (the "Software"), to deal | ||
| # ** in the Software without restriction, including without limitation the rights | ||
| # ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| # ** copies of the Software, and to permit persons to whom the Software is | ||
| # ** furnished to do so, subject to the following conditions: | ||
| # ** | ||
| # ** The above copyright notice and this permission notice shall be included in | ||
| # ** all copies or substantial portions of the Software. | ||
| # ** | ||
| # ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| # ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| # ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| # ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| # ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| # ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| # ** THE SOFTWARE. | ||
| # ** | ||
| # ****************************************************************************/ | ||
|
|
||
| cmake_minimum_required(VERSION 3.10) | ||
|
|
||
| add_executable(simplereader | ||
| ${CMAKE_CURRENT_LIST_DIR}/simplereader.c | ||
| ) | ||
|
|
||
| target_link_libraries(simplereader | ||
| PRIVATE | ||
| intel::tinycbor | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # tinyCBOR Example | ||
|
|
||
| This directory has sample CBOR data (`testcbor`) that can be used with the example. The CBOR data resembles the following CBOR (based on [cbor.me diagnostic notation](http://cbor.me/)): | ||
|
|
||
| ``` | ||
| [ 1, [2, 3, 4]] | ||
| ``` | ||
|
|
||
| To run the example, be sure the test data is in the same directory as the example executable and add `testcbor` as an argument to the executable. | ||
|
|
||
| Example: | ||
|
|
||
| ```bash | ||
| ./examples/simplereader testcbor | ||
| ``` |
Uh oh!
There was an error while loading. Please reload this page.