Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: use project name instead of hardcoded name #38

Open
wants to merge 1 commit into
base: main
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
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ function(rust_cargo_application)
endif()
set(BUILD_LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${RUST_TARGET}/${RUST_BUILD_TYPE}")

set(RUST_LIBRARY_NAME "${CMAKE_PROJECT_NAME}")
set(CARGO_TARGET_DIR "${CMAKE_CURRENT_BINARY_DIR}/rust/target")
set(RUST_LIBRARY "${CARGO_TARGET_DIR}/${RUST_TARGET}/${RUST_BUILD_TYPE}/librustapp.a")
set(RUST_LIBRARY "${CARGO_TARGET_DIR}/${RUST_TARGET}/${RUST_BUILD_TYPE}/lib${RUST_LIBRARY_NAME}.a")
set(SAMPLE_CARGO_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/rust/sample-cargo-config.toml")

# The generated C binding wrappers. These are bindgen-generated wrappers for the inline functions
Expand Down
2 changes: 1 addition & 1 deletion samples/hello_world/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(hello_rust_world)
project(hello_world)
rust_cargo_application()
2 changes: 1 addition & 1 deletion samples/hello_world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[package]
# This must be rustapp for now.
name = "rustapp"
name = "hello_world"
version = "3.7.0"
edition = "2021"
description = "A sample hello world application in Rust"
Expand Down
2 changes: 1 addition & 1 deletion samples/hello_world/sample.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sample:
description: Hello world, but in Rust
name: hello rust world
name: hello world
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll be real curious about this. At one point, I ran into twister failures if there were two samples, across the whole system, that had the same name.

common:
harness: console
harness_config:
Expand Down
2 changes: 1 addition & 1 deletion samples/philosophers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[package]
# This must be rustapp for now.
name = "rustapp"
name = "philosophers"
version = "3.7.0"
edition = "2021"
description = "A sample hello world application in Rust"
Expand Down
2 changes: 1 addition & 1 deletion tests/time/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(time_rust)
project(time)

target_sources(app PRIVATE src/times.c)

Expand Down
2 changes: 1 addition & 1 deletion tests/time/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[package]
# This must be rustapp for now.
name = "rustapp"
name = "time"
version = "3.7.0"
edition = "2021"
description = "Tests of time"
Expand Down
2 changes: 1 addition & 1 deletion tests/timer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(timer_rust)
project(timer)

rust_cargo_application()
2 changes: 1 addition & 1 deletion tests/timer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[package]
# This must be rustapp for now.
name = "rustapp"
name = "timer"
version = "3.7.0"
edition = "2021"
description = "Tests of timeers"
Expand Down
Loading