Skip to content

Commit 1a249a5

Browse files
LegNeatoclaude
andcommitted
Set SPIRV_RUST_TARGET_ENV_DEFINE=1 in CMake cargo invocation
When building the Rust FFI library via CMake, we need to set SPIRV_RUST_TARGET_ENV_DEFINE=1 so that context_bridge.cc compiles with stub implementations that don't depend on SPIRV-Tools-reduce. Without this, context_bridge.cc includes full C++ implementations that reference the Reducer class, but the shared library doesn't link against SPIRV-Tools-reduce, causing undefined symbol errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 11d2477 commit 1a249a5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ if(SPIRV_ENABLE_RUST_TARGET_ENV)
163163

164164
add_custom_command(
165165
OUTPUT ${SPIRV_RUST_LIB_PATH}
166-
COMMAND ${CMAKE_COMMAND} -E env SPIRV_TOOLS_FFI_SKIP_CPP_LINK=1
166+
COMMAND ${CMAKE_COMMAND} -E env
167+
SPIRV_TOOLS_FFI_SKIP_CPP_LINK=1
168+
SPIRV_RUST_TARGET_ENV_DEFINE=1
167169
cargo build --manifest-path ${SPIRV_RUST_MANIFEST} -p spirv-tools-ffi
168170
${SPIRV_RUST_CARGO_ARGS}
169171
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}

0 commit comments

Comments
 (0)