Changeset View
Changeset View
Standalone View
Standalone View
shared/cmake/corrosion-cxx.cmake
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | function(add_library_rust) | ||||
get_filename_component(_LIB_PATH_STEM ${lib_path} NAME) | get_filename_component(_LIB_PATH_STEM ${lib_path} NAME) | ||||
message(STATUS "Library stem path: ${_LIB_PATH_STEM}") | message(STATUS "Library stem path: ${_LIB_PATH_STEM}") | ||||
# Set AR env var if it's present (Android-specific) | # Set AR env var if it's present (Android-specific) | ||||
if(AR) | if(AR) | ||||
corrosion_set_env_vars(${_LIB_PATH_STEM} "AR=${AR}") | corrosion_set_env_vars(${_LIB_PATH_STEM} "AR=${AR}") | ||||
endif() | endif() | ||||
# Resolve directory path which can be consumed globally | |||||
get_filename_component(REALPATH_BINARY_DIR | |||||
"${CMAKE_CURRENT_BINARY_DIR}" | |||||
REALPATH | |||||
) | |||||
# Set cxxbridge values | # Set cxxbridge values | ||||
set( | set( | ||||
cxx_bridge_binary_folder | cxx_bridge_binary_folder | ||||
${CMAKE_BINARY_DIR}/cargo/build/${Rust_CARGO_TARGET}/cxxbridge) | ${REALPATH_BINARY_DIR}/cargo/build/${Rust_CARGO_TARGET}/cxxbridge) | ||||
set( | set( | ||||
common_header | common_header | ||||
${cxx_bridge_binary_folder}/rust/cxx.h) | ${cxx_bridge_binary_folder}/rust/cxx.h) | ||||
# We name the variable dynamically in case a single | # We name the variable dynamically in case a single | ||||
# build has multiple entrypoints into this script | # build has multiple entrypoints into this script | ||||
# cmake-lint: disable=C0103 | # cmake-lint: disable=C0103 | ||||
set( | set( | ||||
"${_LIB_PATH_STEM}_include_dir" | "${_LIB_PATH_STEM}_include_dir" | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |