1message(STATUS "Adding rust ${CMAKE_CURRENT_LIST_DIR}/Cargo.toml") 2 3corrosion_set_env_vars(netsim-proto RUST_BACKTRACE=full) 4 5cmake_path(APPEND PROTOBUF_INCLUDE_DIR "${AOSP_ROOT}" "external" "protobuf" 6 "src") 7cmake_path(CONVERT ${PROTOBUF_INCLUDE_DIR} TO_NATIVE_PATH_LIST 8 NATIVE_PROTOBUF_INCLUDE_DIR) 9 10corrosion_set_env_vars(netsim-proto 11 PROTOBUF_INCLUDE_DIR=${NATIVE_PROTOBUF_INCLUDE_DIR}) 12 13# Set CMake executable filepath because it's not found by cmake Rust crate. From 14# https://github.com/rust-lang/cmake-rs, the CMake executable is assumed to be 15# cmake unless the CMAKE environmental variable is set. 16 17corrosion_set_env_vars(netsim-proto CMAKE=${CMAKE_COMMAND}) 18 19if(LINUX) 20 # b/260271048 21 corrosion_add_target_rustflags( 22 netsim-proto "-Clink-args=-Wl,-rpath,${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") 23endif() 24