Changeset View
Changeset View
Standalone View
Standalone View
shared/cmake/corrosion-cxx.cmake
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | function(add_library_rust) | ||||
) | ) | ||||
add_library(${_LIB_PATH_STEM}_cxxbridge | add_library(${_LIB_PATH_STEM}_cxxbridge | ||||
${common_header} | ${common_header} | ||||
${binding_header} | ${binding_header} | ||||
${binding_source} | ${binding_source} | ||||
) | ) | ||||
target_include_directories(${_LIB_PATH_STEM}_cxxbridge | target_include_directories(${_LIB_PATH_STEM}_cxxbridge | ||||
PUBLIC ${cxx_binding_include_dir} | PUBLIC ${cxx_binding_include_dir} | ||||
# Try to pick up any other headers exposed by target | |||||
${CMAKE_CURRENT_LIST_DIR}/${rust_lib_PATH} | |||||
) | ) | ||||
# Create total target with alias with given namespace | # Create total target with alias with given namespace | ||||
add_library(${_LIB_PATH_STEM}-total INTERFACE) | add_library(${_LIB_PATH_STEM}-total INTERFACE) | ||||
target_link_libraries(${_LIB_PATH_STEM}-total | target_link_libraries(${_LIB_PATH_STEM}-total | ||||
INTERFACE | INTERFACE | ||||
${_LIB_PATH_STEM}_cxxbridge | ${_LIB_PATH_STEM}_cxxbridge | ||||
${_LIB_PATH_STEM} | ${_LIB_PATH_STEM} | ||||
) | ) | ||||
# For end-user to link into project | # For end-user to link into project | ||||
add_library(${namespace}::${_LIB_PATH_STEM} ALIAS ${_LIB_PATH_STEM}-total) | add_library(${namespace}::${_LIB_PATH_STEM} ALIAS ${_LIB_PATH_STEM}-total) | ||||
endfunction(add_library_rust) | endfunction(add_library_rust) |