This is an automated email from the ASF dual-hosted git repository.

pnoltes pushed a commit to branch feature/599-rust-hello-world-bundle
in repository https://gitbox.apache.org/repos/asf/celix.git

commit 211e70fae9111c552e51123059d9414a17d52d2c
Author: Pepijn Noltes <[email protected]>
AuthorDate: Sun Jul 30 22:56:08 2023 +0200

    599: Refactor cargo -> cmake target handling
---
 misc/experimental/rust/CMakeLists.txt                         |  7 ++++---
 misc/experimental/rust/{hello_world_activator => }/Cargo.toml | 10 ++++------
 misc/experimental/rust/hello_world_activator/Cargo.toml       |  2 +-
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/misc/experimental/rust/CMakeLists.txt 
b/misc/experimental/rust/CMakeLists.txt
index cedd5303..3216c3dc 100644
--- a/misc/experimental/rust/CMakeLists.txt
+++ b/misc/experimental/rust/CMakeLists.txt
@@ -25,11 +25,12 @@ if (CELIX_RUST_EXPERIMENTAL)
     )
     FetchContent_MakeAvailable(Corrosion)
 
-    corrosion_import_crate(MANIFEST_PATH hello_world_activator/Cargo.toml)
+    corrosion_import_crate(MANIFEST_PATH Cargo.toml)
 
     #Note corrosion_import_crate import creates a rust_bundle_activator CMake 
target, but this is a INTERFACE target.
-    #For no using abs path to expected bundle activator lib as ACTIVATOR 
argument
-    add_celix_bundle(rust_bundle ACTIVATOR 
${CMAKE_BINARY_DIR}/misc/experimental/bundles/rust/librust_bundle_activator.so)
+    #Using the INTERFACE_LINK_LIBRARIES property we can get the actual target.
+    get_target_property(ACTUAL_LIB_TARGET rust_bundle_activator 
INTERFACE_LINK_LIBRARIES)
+    add_celix_bundle(rust_bundle ACTIVATOR ${ACTUAL_LIB_TARGET})
     add_dependencies(rust_bundle rust_bundle_activator)
 
     add_celix_container(rust_container
diff --git a/misc/experimental/rust/hello_world_activator/Cargo.toml 
b/misc/experimental/rust/Cargo.toml
similarity index 86%
copy from misc/experimental/rust/hello_world_activator/Cargo.toml
copy to misc/experimental/rust/Cargo.toml
index bcfb71a8..6e21189d 100644
--- a/misc/experimental/rust/hello_world_activator/Cargo.toml
+++ b/misc/experimental/rust/Cargo.toml
@@ -15,10 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-[package]
-name = "rust_bundle_example"
-version = "0.1.0"
 
-[lib]
-name = "rust_bundle_activator"
-crate-type = ["cdylib"]
+[workspace]
+members = [
+    "hello_world_activator",
+]
diff --git a/misc/experimental/rust/hello_world_activator/Cargo.toml 
b/misc/experimental/rust/hello_world_activator/Cargo.toml
index bcfb71a8..e3795ca0 100644
--- a/misc/experimental/rust/hello_world_activator/Cargo.toml
+++ b/misc/experimental/rust/hello_world_activator/Cargo.toml
@@ -16,7 +16,7 @@
 # under the License.
 
 [package]
-name = "rust_bundle_example"
+name = "rust_bundle_activator"
 version = "0.1.0"
 
 [lib]

Reply via email to