-
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.
rapidyaml: add ys parsing with integer-based events
- Loading branch information
Showing
20 changed files
with
2,050 additions
and
435 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/rapidyaml/ | ||
/rapidyaml-build/ | ||
/rapidyaml_all.hpp | ||
/_build/ | ||
/librapidyaml.* | ||
/.cache | ||
/compile_commands.json |
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 |
---|---|---|
@@ -1,45 +1,70 @@ | ||
cmake_minimum_required(VERSION 3.12) | ||
project(rapidyaml | ||
DESCRIPTION "rapidyaml -> yamlscript" | ||
project(ysparse | ||
DESCRIPTION "ysparse: rapidyaml -> yamlscript" | ||
HOMEPAGE_URL "https://github.com/biojppm/rapidyaml -> https://github.com/yaml/yamlscript" | ||
LANGUAGES CXX) | ||
|
||
find_package(JNI REQUIRED) | ||
|
||
option(YS2EDN_TIMED "add timings to sections" OFF) | ||
option(YSPARSE_TIMED "add timings to sections" OFF) | ||
option(YSPARSE_DBG "enable debug logs" OFF) | ||
|
||
if(UNIX) | ||
set(CMAKE_SHARED_LIBRARY_SUFFIX .so) | ||
endif() | ||
|
||
add_library(rapidyaml | ||
set(libname rapidyaml) # TODO rename to ysparse | ||
|
||
add_library(${libname} | ||
org_rapidyaml_Rapidyaml.h | ||
org_rapidyaml_Rapidyaml.cpp | ||
rapidyaml_all.hpp | ||
rapidyaml_edn_handler.hpp | ||
rapidyaml_edn_handler.cpp | ||
rapidyaml_edn.hpp | ||
rapidyaml_edn.cpp | ||
# | ||
# ysparse files | ||
ysparse_edn_handler.hpp | ||
ysparse_edn_handler.cpp | ||
ysparse_edn.hpp | ||
ysparse_edn.cpp | ||
ysparse_evt_handler.hpp | ||
ysparse_evt_handler.cpp | ||
ysparse_evt.hpp | ||
ysparse_evt.cpp | ||
# | ||
# files required from rapidyaml | ||
rapidyaml/src/c4/yml/common.cpp | ||
rapidyaml/src/c4/yml/node_type.cpp | ||
rapidyaml/src/c4/yml/parse.cpp | ||
rapidyaml/src/c4/yml/tree.cpp | ||
rapidyaml/src/c4/yml/tag.cpp | ||
rapidyaml/src/c4/yml/reference_resolver.cpp | ||
# | ||
# files required from rapidyaml/ext/c4core | ||
rapidyaml/ext/c4core/src/c4/base64.cpp | ||
rapidyaml/ext/c4core/src/c4/error.cpp | ||
rapidyaml/ext/c4core/src/c4/language.cpp | ||
rapidyaml/ext/c4core/src/c4/utf.cpp | ||
) | ||
target_include_directories(rapidyaml PUBLIC | ||
target_include_directories(${libname} PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR} | ||
${CMAKE_CURRENT_LIST_DIR}/rapidyaml/src | ||
${CMAKE_CURRENT_LIST_DIR}/rapidyaml/test | ||
${CMAKE_CURRENT_LIST_DIR}/rapidyaml/ext/c4core/src | ||
) | ||
target_compile_definitions(rapidyaml PUBLIC | ||
target_compile_definitions(${libname} PUBLIC | ||
RYML_WITH_TAB_TOKENS | ||
RYML_DEFAULT_CALLBACK_USES_EXCEPTIONS | ||
RYML_SINGLE_HEADER | ||
$<$<BOOL:${YS2EDN_TIMED}>:YS2EDN_TIMED> | ||
$<$<BOOL:${YSPARSE_TIMED}>:YS2EDN_TIMED> | ||
$<$<BOOL:${YSPARSE_DBG}>:RYML_DBG> | ||
) | ||
set_target_properties(rapidyaml PROPERTIES CXX_STANDARD 17) | ||
set_target_properties(${libname} PROPERTIES CXX_STANDARD 17) | ||
|
||
# target_link_libraries(rapidyaml PUBLIC JNI::JNI) | ||
target_include_directories(rapidyaml PUBLIC ${JNI_INCLUDE_DIRS}) | ||
# target_link_libraries(${libname} PUBLIC JNI::JNI) | ||
target_include_directories(${libname} PUBLIC ${JNI_INCLUDE_DIRS}) | ||
|
||
add_executable(rapidyaml-test rapidyaml_test.cpp) | ||
target_link_libraries(rapidyaml-test rapidyaml) | ||
add_custom_target(rapidyaml-test-run | ||
DEPENDS rapidyaml-test | ||
COMMAND $<TARGET_FILE:rapidyaml-test> | ||
add_executable(${libname}-test ysparse_test.cpp) | ||
target_link_libraries(${libname}-test ${libname}) | ||
add_custom_target(${libname}-test-run | ||
DEPENDS ${libname}-test | ||
COMMAND $<TARGET_FILE:${libname}-test> | ||
COMMENT "running C++ tests" | ||
) |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.