summaryrefslogtreecommitdiffhomepage
path: root/examples/example_02_libbtb
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-28 03:19:14 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-28 03:19:14 +0200
commitb250a9858728ad9078e482ccf95f938ceb0ae24c (patch)
tree7190d7c9312a99ac83faf03da53b0612c1ea4eba /examples/example_02_libbtb
parent23f0a09cb5bb9a211358e613557ab60b3cbd7172 (diff)
fix: fix dylib build on POSIX targets.
feat: add libBTB example, and updated libBTB version. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'examples/example_02_libbtb')
-rw-r--r--examples/example_02_libbtb/README.md7
-rw-r--r--examples/example_02_libbtb/libbtb.cc12
-rw-r--r--examples/example_02_libbtb/posix.json20
-rw-r--r--examples/example_02_libbtb/win64.json19
4 files changed, 58 insertions, 0 deletions
diff --git a/examples/example_02_libbtb/README.md b/examples/example_02_libbtb/README.md
new file mode 100644
index 0000000..50488a4
--- /dev/null
+++ b/examples/example_02_libbtb/README.md
@@ -0,0 +1,7 @@
+# Notice for Deployment.
+
+In order to use libBTB, it shall live on the same directory,
+<br/>
+or within a directory recognized in the `$PATH` variable.
+
+## Thanks in advance. \ No newline at end of file
diff --git a/examples/example_02_libbtb/libbtb.cc b/examples/example_02_libbtb/libbtb.cc
new file mode 100644
index 0000000..f3d45b8
--- /dev/null
+++ b/examples/example_02_libbtb/libbtb.cc
@@ -0,0 +1,12 @@
+#include <BTBKit/JSONManifestBuilder.h>
+
+#ifndef _WIN32
+static auto kPath = "./posix.json";
+#else
+static auto kPath = ".\win64.json";
+#endif
+
+int main(int argc, char** argv) {
+ auto builder = new BTB::JSONManifestBuilder();
+ return builder->buildTarget(strlen(kPath), kPath);
+}
diff --git a/examples/example_02_libbtb/posix.json b/examples/example_02_libbtb/posix.json
new file mode 100644
index 0000000..871712e
--- /dev/null
+++ b/examples/example_02_libbtb/posix.json
@@ -0,0 +1,20 @@
+{
+ "compiler_path": "g++",
+ "compiler_std": "c++20",
+ "headers_path": [
+ "../../",
+ "../../vendor"
+ ],
+ "sources_path": [
+ "libbtb.cc"
+ ],
+ "output_name": "libbtb.elf",
+ "compiler_flags": [
+ "-L/usr/local/lib",
+ "-lBTB"
+ ],
+ "cpp_macros": [
+ "FOO_MACRO"
+ ],
+ "run_after_build": true
+} \ No newline at end of file
diff --git a/examples/example_02_libbtb/win64.json b/examples/example_02_libbtb/win64.json
new file mode 100644
index 0000000..658ee0f
--- /dev/null
+++ b/examples/example_02_libbtb/win64.json
@@ -0,0 +1,19 @@
+{
+ "compiler_path": "x86_64-w64-mingw32-g++",
+ "compiler_std": "c++20",
+ "headers_path": [
+ "../../",
+ "../../vendor"
+ ],
+ "sources_path": [
+ "libbtb.cc"
+ ],
+ "output_name": "libbtb.exe",
+ "compiler_flags": [
+ "-lBTB"
+ ],
+ "cpp_macros": [
+ "FOO_MACRO"
+ ],
+ "run_after_build": true
+} \ No newline at end of file