aboutsummaryrefslogtreecommitdiff
path: root/thirdparty/ryml/samples/singleheaderlib
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/ryml/samples/singleheaderlib')
-rw-r--r--thirdparty/ryml/samples/singleheaderlib/lib.cpp2
-rwxr-xr-xthirdparty/ryml/samples/singleheaderlib/run_shared.sh10
-rwxr-xr-xthirdparty/ryml/samples/singleheaderlib/run_static.sh10
3 files changed, 22 insertions, 0 deletions
diff --git a/thirdparty/ryml/samples/singleheaderlib/lib.cpp b/thirdparty/ryml/samples/singleheaderlib/lib.cpp
new file mode 100644
index 000000000..aa33e6e17
--- /dev/null
+++ b/thirdparty/ryml/samples/singleheaderlib/lib.cpp
@@ -0,0 +1,2 @@
+#define RYML_SINGLE_HDR_DEFINE_NOW
+#include <ryml_all.hpp>
diff --git a/thirdparty/ryml/samples/singleheaderlib/run_shared.sh b/thirdparty/ryml/samples/singleheaderlib/run_shared.sh
new file mode 100755
index 000000000..372a36772
--- /dev/null
+++ b/thirdparty/ryml/samples/singleheaderlib/run_shared.sh
@@ -0,0 +1,10 @@
+#!/bin/bash -x
+
+# take the build type from the command line, or default to release
+cfg=${1:-Release}
+# make sure to run from where this file is
+cd $(dirname $0)
+# configure the sample
+cmake -S . -B ./build/$cfg-shared -DCMAKE_BUILD_TYPE=$cfg -DBUILD_SHARED_LIBS=ON
+# build and run the sample
+cmake --build ./build/$cfg-shared --config $cfg --target run
diff --git a/thirdparty/ryml/samples/singleheaderlib/run_static.sh b/thirdparty/ryml/samples/singleheaderlib/run_static.sh
new file mode 100755
index 000000000..d0e570215
--- /dev/null
+++ b/thirdparty/ryml/samples/singleheaderlib/run_static.sh
@@ -0,0 +1,10 @@
+#!/bin/bash -x
+
+# take the build type from the command line, or default to release
+cfg=${1:-Release}
+# make sure to run from where this file is
+cd $(dirname $0)
+# configure the sample
+cmake -S . -B ./build/$cfg-static -DCMAKE_BUILD_TYPE=$cfg -DBUILD_SHARED_LIBS=OFF
+# build and run the sample
+cmake --build ./build/$cfg-static --config $cfg --target run