summaryrefslogtreecommitdiffhomepage
path: root/examples/example_02_libnebuild
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-08-16 20:00:37 +0200
committerGitHub <noreply@github.com>2025-08-16 20:00:37 +0200
commitd21a3b2e16b4e5f974dd000e11c868e2021292f0 (patch)
treed91d1351193a9f758daa9dad964e40f5a84ece7f /examples/example_02_libnebuild
parent50c2c9773d5660b1497a1132ffa96a7ab10d9c45 (diff)
parentd987d62459d59a6d95ffb815d5e6eccd8dbde1dd (diff)
Merge pull request #3 from nekernel-org/dev
v0.0.3
Diffstat (limited to 'examples/example_02_libnebuild')
-rw-r--r--examples/example_02_libnebuild/README.md7
-rw-r--r--examples/example_02_libnebuild/libnebuild.cc15
-rw-r--r--examples/example_02_libnebuild/posix.json20
-rw-r--r--examples/example_02_libnebuild/win64.json19
4 files changed, 61 insertions, 0 deletions
diff --git a/examples/example_02_libnebuild/README.md b/examples/example_02_libnebuild/README.md
new file mode 100644
index 0000000..21e64be
--- /dev/null
+++ b/examples/example_02_libnebuild/README.md
@@ -0,0 +1,7 @@
+# Notice for Deployment.
+
+In order to use libNeBuild, it shall live on the same directory,
+<br/>
+or within a directory recognized in the `$LD_LIBRARY_PATH` or `$DYLD_LIBRARY_PATH` variable.
+
+## Thanks in advance. \ No newline at end of file
diff --git a/examples/example_02_libnebuild/libnebuild.cc b/examples/example_02_libnebuild/libnebuild.cc
new file mode 100644
index 0000000..5540503
--- /dev/null
+++ b/examples/example_02_libnebuild/libnebuild.cc
@@ -0,0 +1,15 @@
+#include <BuildKit/JSONManifestBuilder.h>
+#include <cstdlib>
+
+#ifndef _WIN32
+static auto kPath = "./posix.json";
+#else
+static auto kPath = ".\\win64.json";
+#endif
+
+int main(int argc, char** argv) {
+ auto builder = new NeBuild::JSONManifestBuilder();
+ if (!builder) return EXIT_FAILURE;
+
+ return builder->BuildTarget(kPath);
+}
diff --git a/examples/example_02_libnebuild/posix.json b/examples/example_02_libnebuild/posix.json
new file mode 100644
index 0000000..989e712
--- /dev/null
+++ b/examples/example_02_libnebuild/posix.json
@@ -0,0 +1,20 @@
+{
+ "compiler_path": "g++",
+ "compiler_std": "c++20",
+ "headers_path": [
+ "../../dev",
+ "../../vendor"
+ ],
+ "sources_path": [
+ "libnebuild.cc"
+ ],
+ "output_name": "libnebuild.elf",
+ "compiler_flags": [
+ "-L/usr/local/lib",
+ "-lNeBuild"
+ ],
+ "cpp_macros": [
+ "FOO_MACRO"
+ ],
+ "run_after_build": true
+} \ No newline at end of file
diff --git a/examples/example_02_libnebuild/win64.json b/examples/example_02_libnebuild/win64.json
new file mode 100644
index 0000000..3118a36
--- /dev/null
+++ b/examples/example_02_libnebuild/win64.json
@@ -0,0 +1,19 @@
+{
+ "compiler_path": "x86_64-w64-mingw32-g++",
+ "compiler_std": "c++20",
+ "headers_path": [
+ "../../dev",
+ "../../vendor"
+ ],
+ "sources_path": [
+ "libbtb.cc"
+ ],
+ "output_name": "libbtb.exe",
+ "compiler_flags": [
+ "-lNeBuild"
+ ],
+ "cpp_macros": [
+ "FOO_MACRO"
+ ],
+ "run_after_build": true
+} \ No newline at end of file