Add minimal example

This commit is contained in:
Lexi / Zoe 2025-10-18 00:03:29 +02:00
parent 1827006b02
commit 1402505a6d
Signed by: binaryDiv
GPG Key ID: F8D4956E224DA232
7 changed files with 48 additions and 0 deletions

4
examples/minimal/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Build files
/build
/build.ninja
/shuriken.override.yaml

View File

@ -0,0 +1,11 @@
# Example shuriken.yaml config for a minimal C++ project with modules.
defaults:
cpp_standard: c++20
cpp_flags: -Wall -Wextra -Werror -pedantic
default_target: linux
targets:
linux:
output_file: minimal_example

View File

@ -0,0 +1,6 @@
export module generators.number;
// Example function that returns a number
export int get_number() {
return 42;
}

View File

@ -0,0 +1,6 @@
export module generators.text;
// Example function that returns a string
export const char* get_text() {
return "meow!";
}

View File

@ -0,0 +1,6 @@
import printing;
// Example main function that calls a function from a module to print things
int main() {
print_things();
}

View File

@ -0,0 +1,14 @@
module;
#include <iostream>
import generators.number;
import generators.text;
export module printing;
// Example function that prints things from the generator functions
export void print_things() {
std::cout << get_text() << '\n';
std::cout << get_number() << '\n';
}

View File

@ -0,0 +1 @@
../../../src/shuriken.py