diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 9f69a9da0c..2c9460330e 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -37,6 +37,7 @@ jobs: cargo clippy -p riddle && cargo clippy -p sample_bits && cargo clippy -p sample_com_uri && + cargo clippy -p sample_component_hello_world && cargo clippy -p sample_consent && cargo clippy -p sample_core_app && cargo clippy -p sample_counter && diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f1d9777ad..502246fc44 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,6 +44,7 @@ jobs: cargo test -p riddle && cargo test -p sample_bits && cargo test -p sample_com_uri && + cargo test -p sample_component_hello_world && cargo test -p sample_consent && cargo test -p sample_core_app && cargo test -p sample_counter && diff --git a/Cargo.toml b/Cargo.toml index 4cb7f88c48..0babf1a2aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,7 @@ members = [ "crates/libs/*", "crates/samples/windows-sys/*", "crates/samples/windows/*", + "crates/samples/components/*", "crates/targets/*", "crates/tests/*", "crates/tools/*", diff --git a/crates/samples/components/hello_world/Cargo.toml b/crates/samples/components/hello_world/Cargo.toml new file mode 100644 index 0000000000..566bddc6ce --- /dev/null +++ b/crates/samples/components/hello_world/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "sample_component_hello_world" +version = "0.0.0" +edition = "2021" +publish = false + +[lib] +crate-type = ["cdylib"] diff --git a/crates/samples/components/hello_world/readme.md b/crates/samples/components/hello_world/readme.md new file mode 100644 index 0000000000..99f3599817 --- /dev/null +++ b/crates/samples/components/hello_world/readme.md @@ -0,0 +1 @@ +Sample for [Creating your first DLL in Rust](https://kennykerr.ca/rust-getting-started/creating-your-first-dll.html) in [Getting Started with Rust](https://kennykerr.ca/rust-getting-started). diff --git a/crates/samples/components/hello_world/src/lib.rs b/crates/samples/components/hello_world/src/lib.rs new file mode 100644 index 0000000000..bb832afa85 --- /dev/null +++ b/crates/samples/components/hello_world/src/lib.rs @@ -0,0 +1,4 @@ +#[no_mangle] +extern "system" fn HelloWorld() -> i32 { + 123 +}