Skip to content

Commit

Permalink
feat: added workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashart17 committed May 26, 2023
1 parent 0134af0 commit 618a131
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@ set(VERIFY_CMD python3 ${CMAKE_CURRENT_BINARY_DIR}/verify)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include)
include_directories(${SEAHORN_ROOT}/include)

corrosion_import_crate(MANIFEST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml)

add_subdirectory(src)

41 changes: 41 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
cargo-features = ["profile-rustflags"]

[workspace]

members = [
"src/rust-jobs/add",
"src/rust-jobs/enum-as-param",
"src/rust-jobs/option",
"src/rust-jobs/option-and-then",
"src/rust-jobs/option-is-some-and",
"src/rust-jobs/option-or",
"src/rust-jobs/option-unwrap-or",
"src/rust-jobs/option-vec-map",
"src/rust-jobs/pointer",
"src/rust-jobs/string-parse",
"src/rust-jobs/vec",
"src/rust-jobs/vec-filter",
"src/rust-jobs/vec-sort-reverse"
]

[profile.dev]
panic = "abort"
opt-level = 2

rustflags = [
"-Clinker-plugin-lto",
"-Clinker=clang-14",
"-Clink-arg=-fuse-ld=lld",
"-Zemit-thin-lto=no",
]

[profile.release]
panic = "abort"
opt-level = 2

rustflags = [
"-Clinker-plugin-lto",
"-Clinker=clang-14",
"-Clink-arg=-fuse-ld=lld",
"-Zemit-thin-lto=no"
]
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly-2022-08-01"
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endfunction()
function(c_rust_llvm TARGET SRC_FILES)
generate_c_bindings(${TARGET})

corrosion_import_crate(MANIFEST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml)
# corrosion_import_crate(MANIFEST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml)
corrosion_set_cargo_flags(${TARGET}-lib "-Zbuild-std=panic_abort,std"
"-Zbuild-std-features=panic_immediate_abort")

Expand Down

0 comments on commit 618a131

Please sign in to comment.