diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-29 10:56:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-29 10:56:20 +0200 |
| commit | 50c2c9773d5660b1497a1132ffa96a7ab10d9c45 (patch) | |
| tree | 9e38258948019249d64b90a27707ad3ed36bb186 /examples | |
| parent | dab3762388278d1efadec1040a8f5c5ebd286b24 (diff) | |
| parent | 61fc36d7fb3d147b577c1d25a72e22e45f6c6c83 (diff) | |
Merge pull request #2 from nekernel-org/dev
0.0.2
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/example_01/example.cc | 8 | ||||
| -rw-r--r-- | examples/example_01_hello_world/hello_world.cc | 7 | ||||
| -rw-r--r-- | examples/example_01_hello_world/posix.json (renamed from examples/example_01/posix.json) | 4 | ||||
| -rw-r--r-- | examples/example_01_hello_world/win64.json (renamed from examples/example_01/win64.json) | 4 | ||||
| -rw-r--r-- | examples/example_02_libbtb/README.md | 7 | ||||
| -rw-r--r-- | examples/example_02_libbtb/libbtb.cc | 12 | ||||
| -rw-r--r-- | examples/example_02_libbtb/posix.json | 20 | ||||
| -rw-r--r-- | examples/example_02_libbtb/win64.json | 19 |
8 files changed, 69 insertions, 12 deletions
diff --git a/examples/example_01/example.cc b/examples/example_01/example.cc deleted file mode 100644 index aa2d8b0..0000000 --- a/examples/example_01/example.cc +++ /dev/null @@ -1,8 +0,0 @@ -#include <string> -#include <iostream> - -int main(int argc, char** argv) -{ - std::cout << "hello, world!\n"; - return 0; -} diff --git a/examples/example_01_hello_world/hello_world.cc b/examples/example_01_hello_world/hello_world.cc new file mode 100644 index 0000000..ae47ce8 --- /dev/null +++ b/examples/example_01_hello_world/hello_world.cc @@ -0,0 +1,7 @@ +#include <iostream> +#include <string> + +int main(int argc, char** argv) { + std::cout << "hello, world!\n"; + return 0; +} diff --git a/examples/example_01/posix.json b/examples/example_01_hello_world/posix.json index 17a6022..c3c8151 100644 --- a/examples/example_01/posix.json +++ b/examples/example_01_hello_world/posix.json @@ -2,8 +2,8 @@ "compiler_path": "g++", "compiler_std": "c++20", "headers_path": ["lib"], - "sources_path": ["example.cc"], - "output_name": "example.elf", + "sources_path": ["hello_world.cc"], + "output_name": "hello_world.elf", "compiler_flags": ["-fPIC"], "cpp_macros": ["FOO_MACRO"], "run_after_build": true diff --git a/examples/example_01/win64.json b/examples/example_01_hello_world/win64.json index 1712d8b..4af5bdd 100644 --- a/examples/example_01/win64.json +++ b/examples/example_01_hello_world/win64.json @@ -2,8 +2,8 @@ "compiler_path": "x86_64-w64-mingw32-g++", "compiler_std": "c++20", "headers_path": ["lib"], - "sources_path": ["example.cc"], - "output_name": "example.elf", + "sources_path": ["hello_world.cc"], + "output_name": "hello_world.elf", "compiler_flags": ["-fPIC"], "cpp_macros": ["FOO_MACRO"], "run_after_build": true diff --git a/examples/example_02_libbtb/README.md b/examples/example_02_libbtb/README.md new file mode 100644 index 0000000..26ccb72 --- /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 `$LD_LIBRARY_PATH` or `$DYLD_LIBRARY_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 |
