Skip to content

Commit

Permalink
cmake: use project name instead of hardcoded name
Browse files Browse the repository at this point in the history
This commit offers to give an arbitrary name to the Rust application
project under CMake.

Indeed, before this commit, the CMake project for the Rust application
had the name `librustapp`. Now, it can be set with any value.
  • Loading branch information
jpeeters committed Dec 9, 2024
1 parent ce42e4b commit d8862c8
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit d8862c8

Please sign in to comment.