Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add dependency file and compile script #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
{
"root_module": "src/main.rs",
"edition": "2018",
"deps": [{
"crate": 1,
"name": "hello",
}],
},
{
"root_module": "include/hello.rs",
"edition": "2018",
"deps": [],
},
]
Expand Down
2 changes: 2 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rustc --crate-type=lib include/hello.rs
rustc --extern hello=libhello.rlib src/main.rs
4 changes: 4 additions & 0 deletions include/hello.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// prints a hello world message
pub fn print_hello() {
println!("Hello World!");
}
5 changes: 2 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::collections::HashMap;

fn foo() {}
fn main() {
std::asm!()
println!("Hello, world!");
std::assert!(true);
hello::print_hello();
}