summaryrefslogtreecommitdiffhomepage
path: root/examples/example_01
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-03-28 05:03:12 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-03-28 05:03:12 +0100
commit004bc5ccdf1a8499e2c937dcc687843cea89160d (patch)
tree2a3ba3f41e3cdead9ef5e5c33f88ef5dc3e58ecd /examples/example_01
parent842bc7b58dca972a560a8ab056d7bc35ea3b5567 (diff)
examples: move example files from tests/ to examples/example_01/
Relocate the generic C++ example and its build configs into a dedicated examples/example_01/ directory to better separate tests from usage samples. No content changes were made; files were renamed only. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'examples/example_01')
-rw-r--r--examples/example_01/example.cc8
-rw-r--r--examples/example_01/posix.json10
-rw-r--r--examples/example_01/win64.json10
3 files changed, 28 insertions, 0 deletions
diff --git a/examples/example_01/example.cc b/examples/example_01/example.cc
new file mode 100644
index 0000000..dfef2e4
--- /dev/null
+++ b/examples/example_01/example.cc
@@ -0,0 +1,8 @@
+#include <string>
+#include <iostream>
+
+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/posix.json
new file mode 100644
index 0000000..17a6022
--- /dev/null
+++ b/examples/example_01/posix.json
@@ -0,0 +1,10 @@
+{
+ "compiler_path": "g++",
+ "compiler_std": "c++20",
+ "headers_path": ["lib"],
+ "sources_path": ["example.cc"],
+ "output_name": "example.elf",
+ "compiler_flags": ["-fPIC"],
+ "cpp_macros": ["FOO_MACRO"],
+ "run_after_build": true
+}
diff --git a/examples/example_01/win64.json b/examples/example_01/win64.json
new file mode 100644
index 0000000..1712d8b
--- /dev/null
+++ b/examples/example_01/win64.json
@@ -0,0 +1,10 @@
+{
+ "compiler_path": "x86_64-w64-mingw32-g++",
+ "compiler_std": "c++20",
+ "headers_path": ["lib"],
+ "sources_path": ["example.cc"],
+ "output_name": "example.elf",
+ "compiler_flags": ["-fPIC"],
+ "cpp_macros": ["FOO_MACRO"],
+ "run_after_build": true
+}