From acb42ac427392333b00168f0694e335455116dfa Mon Sep 17 00:00:00 2001 From: Andrew <51118083+ArionThinker@users.noreply.github.com> Date: Sun, 7 May 2023 23:21:32 +0300 Subject: [PATCH] github.com/skystrife/cpptoml (#1866) * new file: projects/github.com/skystrife/cpptoml/package.yml new file: projects/github.com/skystrife/cpptoml/tea.toml new file: projects/github.com/skystrife/cpptoml/test.cc * modified: projects/github.com/skystrife/cpptoml/package.yml * modified: projects/github.com/skystrife/cpptoml/package.yml * modified: projects/github.com/skystrife/cpptoml/package.yml * modified: projects/github.com/skystrife/cpptoml/package.yml * modified: projects/github.com/skystrife/cpptoml/package.yml * modified: projects/github.com/skystrife/cpptoml/package.yml --- .../github.com/skystrife/cpptoml/package.yml | 29 +++++++++++++++++++ .../github.com/skystrife/cpptoml/tea.toml | 1 + projects/github.com/skystrife/cpptoml/test.cc | 14 +++++++++ 3 files changed, 44 insertions(+) create mode 100644 projects/github.com/skystrife/cpptoml/package.yml create mode 100644 projects/github.com/skystrife/cpptoml/tea.toml create mode 100644 projects/github.com/skystrife/cpptoml/test.cc diff --git a/projects/github.com/skystrife/cpptoml/package.yml b/projects/github.com/skystrife/cpptoml/package.yml new file mode 100644 index 00000000..7b70f72a --- /dev/null +++ b/projects/github.com/skystrife/cpptoml/package.yml @@ -0,0 +1,29 @@ +distributable: + url: https://github.com/skystrife/cpptoml/archive/v0.1.1.tar.gz + strip-components: 1 + +versions: + github: skystrife/cpptoml + +build: + dependencies: + gnu.org/gcc: '*' + tea.xyz/gx/make: '*' + cmake.org: '*' + script: | + cmake -S . -B build $ARGS + cmake --build build + cmake --install build + env: + LD_LIBRARY_PATH: "{{deps.gnu.org/gcc.prefix}}" + ARGS: + - -DCMAKE_INSTALL_PREFIX="{{prefix}}" + - -DENABLE_LIBCXX="ON" + - -DCPPTOML_BUILD_EXAMPLES=OFF + +test: + dependencies: + tea.xyz/gx/cc: c99 + script: | + g++ -std=c++11 -I {{prefix}}/include test.cc -o test + ./test | grep "Hello, Tea" \ No newline at end of file diff --git a/projects/github.com/skystrife/cpptoml/tea.toml b/projects/github.com/skystrife/cpptoml/tea.toml new file mode 100644 index 00000000..79366528 --- /dev/null +++ b/projects/github.com/skystrife/cpptoml/tea.toml @@ -0,0 +1 @@ +str = "Hello, Tea." \ No newline at end of file diff --git a/projects/github.com/skystrife/cpptoml/test.cc b/projects/github.com/skystrife/cpptoml/test.cc new file mode 100644 index 00000000..61b71f2e --- /dev/null +++ b/projects/github.com/skystrife/cpptoml/test.cc @@ -0,0 +1,14 @@ +#include "cpptoml.h" +#include + +int main() { + auto tea = cpptoml::parse_file("tea.toml"); + auto s = tea->get_as("str"); + + if (s) { + std::cout << *s << std::endl; + return 0; + } + + return 1; +} \ No newline at end of file