HomePhabricator
Diffusion Comm d488b5bc4f82

[services] Add CMake file with functions for Corrosion and CXX integration

Description

[services] Add CMake file with functions for Corrosion and CXX integration

Summary:
This diff introduces CMake file with functions to integrate Rust library code into CMake project using Corrosion and CXX.
Inspired by the https://github.com/trondhe/rusty_cmake but with the following modifications:

  • Windows-related code was removed.
  • Using of the get_filename_component to get stem instead of _get_stem_name_of_path function.
  • Check for an empty Rust_CARGO_TARGET.
  • Code fixes according to our code standard.

The purposes of functions:

  • add_library_rust: Running corrosion and integrating CXX headers and bindings.

Related Linear task: ENG-1438

Test Plan:
This diff can be tested in a stack diff D4807.
Successfully built the service, and Rust library, and link it in test in D4807 (end of the stack).

Reviewers: karol, varun, tomek, jon

Reviewed By: varun, tomek, jon

Subscribers: ashoat, tomek, adrian, atul, karol, abosh

Differential Revision: https://phab.comm.dev/D4805

Details

Provenance
maxAuthored on Aug 11 2022, 2:45 AM
Reviewer
varun
Differential Revision
D4805: [services] Add CMake file with functions for Corrosion and CXX integration
Parents
rCOMM9963297ebc1e: [native] wallet login method for gRPC client
Branches
Unknown
Tags
Unknown