diff --git a/services/tunnelbroker/CMakeLists.txt b/services/tunnelbroker/CMakeLists.txt --- a/services/tunnelbroker/CMakeLists.txt +++ b/services/tunnelbroker/CMakeLists.txt @@ -9,6 +9,7 @@ endif(COMMAND cmake_policy) set(CMAKE_CXX_STANDARD 17) + # For C++17 on MacOS, we must set minimum target to 10.14+ set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14) @@ -67,11 +68,10 @@ find_package(OpenSSL REQUIRED) find_package(glog) -# Corrosion Rust integration +# Corrosion and CXX Rust integration find_package(Corrosion REQUIRED) -corrosion_import_crate(MANIFEST_PATH "rust-notifications/Cargo.toml") -set(RUST_HEADERS_INCLUDE_DIR "rust-notifications/extern") -set(RUST_LIBS "rust-notifications") +include(../lib/cmake-components/corrosion-cxx.cmake) +add_library_rust(PATH rust-notifications NAMESPACE rustlib) file(GLOB_RECURSE SOURCE_CODE "./src/*.cpp") @@ -101,6 +101,7 @@ glog::glog double-conversion::double-conversion Folly::folly + rustlib::rust-notifications ) # SERVER diff --git a/services/tunnelbroker/rust-notifications/build.rs b/services/tunnelbroker/rust-notifications/build.rs new file mode 100644 --- /dev/null +++ b/services/tunnelbroker/rust-notifications/build.rs @@ -0,0 +1,4 @@ +fn main() { + let _build = cxx_build::bridge("src/lib.rs"); + println!("cargo:rerun-if-changed=src/lib.rs"); +}