@@ -104,26 +104,21 @@ set(RUST_FFI_DEPENDS
104104 ${CMAKE_CURRENT_LIST_DIR } /rust/lib.rs
105105 ${CMAKE_CURRENT_LIST_DIR } /rust/scanner.rs
106106 ${CMAKE_CURRENT_LIST_DIR } /rust/types.rs
107- ${CMAKE_CURRENT_LIST_DIR } /rust/writer.rs)
107+ ${CMAKE_CURRENT_LIST_DIR } /rust/writer.rs
108+ ${CMAKE_CURRENT_LIST_DIR } /scripts/protoc_wrapper.sh
109+ ${CMAKE_CURRENT_LIST_DIR } /scripts/protoc_wrapper.cmd)
108110
109111set (PROTOC_BIN "" )
110- if (DEFINED ENV{VCPKG_ROOT})
111- if (DEFINED ENV{VCPKG_HOST_TRIPLET})
112- set (PROTOC_BIN "$ENV{VCPKG_ROOT} /installed/$ENV{VCPKG_HOST_TRIPLET} /tools/protobuf/protoc" )
113- elseif (DEFINED ENV{VCPKG_TARGET_TRIPLET})
114- set (PROTOC_BIN "$ENV{VCPKG_ROOT} /installed/$ENV{VCPKG_TARGET_TRIPLET} /tools/protobuf/protoc" )
115- endif ()
116- endif ()
117- if (WIN32 AND NOT PROTOC_BIN STREQUAL "" AND NOT PROTOC_BIN MATCHES "\\ .exe$" )
118- set (PROTOC_BIN "${PROTOC_BIN} .exe" )
112+ if (WIN32 )
113+ set (PROTOC_BIN "${CMAKE_CURRENT_LIST_DIR } /scripts/protoc_wrapper.cmd" )
114+ else ()
115+ set (PROTOC_BIN "${CMAKE_CURRENT_LIST_DIR } /scripts/protoc_wrapper.sh" )
119116endif ()
120117
121118set (RUST_CARGO_ENV
122119 CARGO_TARGET_DIR=${RUST_TARGET_DIR}
123120 MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} )
124- if (NOT PROTOC_BIN STREQUAL "" )
125- list (APPEND RUST_CARGO_ENV PROTOC=${PROTOC_BIN} )
126- endif ()
121+ list (APPEND RUST_CARGO_ENV PROTOC=${PROTOC_BIN} )
127122
128123# Building both debug and release Rust artifacts is expensive and can trigger OOMs in CI.
129124# For single-config generators (Ninja/Makefiles), only build the active configuration's artifact.
0 commit comments