-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #416 from mmd-osm/lib/sjparser
Adding sjparser lib
- Loading branch information
Showing
59 changed files
with
8,280 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
BasedOnStyle: Google | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortFunctionsOnASingleLine: Inline | ||
Standard: Cpp11 | ||
BreakBeforeBinaryOperators: NonAssignment | ||
AlwaysBreakTemplateDeclarations: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build | ||
.*.swp | ||
.*.swo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
image: registry.gitlab.com/dhurum/docker_build_images/sjparser-build:master | ||
|
||
stages: | ||
- configure | ||
- build | ||
- test | ||
- deploy | ||
|
||
configuration: | ||
stage: configure | ||
script: | ||
- mkdir build && cd build | ||
- cmake ../ -DCMAKE_BUILD_TYPE=Release -DSJPARSER_WITH_TESTS=On | ||
artifacts: | ||
expire_in: 15 min | ||
paths: | ||
- build | ||
|
||
configuration-coverage: | ||
stage: configure | ||
script: | ||
- mkdir build && cd build | ||
- cmake ../ -DCMAKE_BUILD_TYPE=Debug -DSJPARSER_WITH_COVERAGE=On | ||
artifacts: | ||
expire_in: 15 min | ||
paths: | ||
- build | ||
|
||
build: | ||
stage: build | ||
script: | ||
- cd build | ||
- make -j `nproc` | ||
dependencies: | ||
- configuration | ||
artifacts: | ||
expire_in: 15 min | ||
paths: | ||
- build | ||
|
||
build-coverage: | ||
stage: build | ||
script: | ||
- cd build | ||
- make -j `nproc` | ||
dependencies: | ||
- configuration-coverage | ||
artifacts: | ||
expire_in: 15 min | ||
paths: | ||
- build | ||
|
||
checks: | ||
stage: build | ||
script: | ||
- cd build | ||
- make check | ||
- make format | ||
- git status -s | ||
- '[[ -z $( git status -s ) ]]' | ||
dependencies: | ||
- configuration | ||
|
||
documentation: | ||
stage: build | ||
script: | ||
- cd build | ||
- make documentation | ||
- mv documentation ../ | ||
dependencies: | ||
- configuration | ||
artifacts: | ||
expire_in: 15 min | ||
paths: | ||
- documentation | ||
|
||
test: | ||
stage: test | ||
script: | ||
- cd build | ||
- make test | ||
dependencies: | ||
- build | ||
|
||
coverage: | ||
stage: test | ||
script: | ||
- cd build | ||
- make coverage | ||
coverage: '/^TOTAL.*\s+(\d+\%)$/' | ||
dependencies: | ||
- build-coverage | ||
|
||
pages: | ||
stage: deploy | ||
only: | ||
- master | ||
script: | ||
- mv documentation/html public | ||
dependencies: | ||
- documentation | ||
artifacts: | ||
paths: | ||
- public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
|
||
project(sjparser) | ||
|
||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) | ||
|
||
option(SJPARSER_WITH_TESTS | ||
"Build tests if the config is not Debug" OFF) | ||
option(SJPARSER_WITH_COVERAGE | ||
"Add coverage target (only in Debug config)" OFF) | ||
option(SJPARSER_BUILD_SHARED_LIBRARY | ||
"Build shared library even in case of submodule build" OFF) | ||
|
||
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) | ||
message(STATUS | ||
"Sjparser is a part of some project, only library targets are enabled.") | ||
set(STANDALONE_BUILD FALSE) | ||
else() | ||
set(STANDALONE_BUILD TRUE) | ||
set(SJPARSER_BUILD_SHARED_LIBRARY TRUE) | ||
|
||
if(CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
set(SJPARSER_WITH_TESTS TRUE) | ||
endif() | ||
endif() | ||
|
||
function(setup_compilation_options TARGET) | ||
target_compile_features(${TARGET} PUBLIC cxx_std_17) | ||
|
||
target_compile_options(${TARGET} PRIVATE | ||
-Werror | ||
-Wall | ||
-Wextra | ||
-Wpedantic | ||
$<$<CONFIG:Debug>:-O0 -g3> | ||
) | ||
|
||
if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND SJPARSER_WITH_COVERAGE) | ||
target_compile_options(${TARGET} PRIVATE -O0 --coverage) | ||
target_link_libraries(${TARGET} PRIVATE --coverage) | ||
endif() | ||
endfunction() | ||
|
||
add_subdirectory(library) | ||
|
||
if(SJPARSER_WITH_TESTS) | ||
enable_testing() | ||
add_subdirectory(tests) | ||
endif() | ||
|
||
if(STANDALONE_BUILD) | ||
add_subdirectory(check) | ||
endif() | ||
|
||
if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND SJPARSER_WITH_COVERAGE) | ||
add_subdirectory(coverage) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2016 Denis Tikhomirov <[email protected]> | ||
|
||
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
|
||
Source: https://gitlab.com/dhurum/sjparser | ||
Commit: a53246dac850fd5fadd288277776b43cc2c9b819 | ||
|
||
git subtree add --prefix contrib/sjparser https://gitlab.com/dhurum/sjparser.git improvements --squash | ||
|
||
Update via `git subtree pull --prefix=contrib/sjparser/ --squash https://gitlab.com/dhurum/sjparser.git <remote-ref>` | ||
|
||
List of changes to sjparser: | ||
|
||
* MemberParser: replace recursive template metaprogramming by folds | ||
* NthTypes: get rid of recursive template metaprogramming | ||
* Value<double> should also support yajl integers | ||
* if key appears multiple times, last one wins | ||
* Include error location in error message | ||
* Typo fixes | ||
* Removed union.h and s_union.h, as well as standalone/embedded (s_)union test cases (not relevant) | ||
* Removed doxygen & documentation directory (see original repo for documentation) | ||
|
||
|
||
|
Oops, something went wrong.