Skip to content

Commit 5b99e0c

Browse files
committed
cmake: use project name instead of hardcoded name
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.
1 parent eda3a85 commit 5b99e0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ function(rust_cargo_application)
8686
endif()
8787
set(BUILD_LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${RUST_TARGET}/${RUST_BUILD_TYPE}")
8888

89+
set(RUST_LIBRARY_NAME "${CMAKE_PROJECT_NAME}")
8990
set(CARGO_TARGET_DIR "${CMAKE_CURRENT_BINARY_DIR}/rust/target")
90-
set(RUST_LIBRARY "${CARGO_TARGET_DIR}/${RUST_TARGET}/${RUST_BUILD_TYPE}/librustapp.a")
91+
set(RUST_LIBRARY "${CARGO_TARGET_DIR}/${RUST_TARGET}/${RUST_BUILD_TYPE}/lib${RUST_LIBRARY_NAME}.a")
9192
set(SAMPLE_CARGO_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/rust/sample-cargo-config.toml")
9293

9394
# The generated C binding wrappers. These are bindgen-generated wrappers for the inline functions

0 commit comments

Comments
 (0)