File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -311,6 +311,33 @@ add_custom_command(TARGET gpubench POST_BUILD
311311 COMMENT "Copying kernels directory to project root"
312312)
313313
314+ # Build and package Rust GUI if Cargo is available
315+ find_program (CARGO_EXECUTABLE cargo )
316+ if (CARGO_EXECUTABLE)
317+ message (STATUS "Cargo found: ${CARGO_EXECUTABLE} . Configuring Rust GUI build." )
318+
319+ # Custom target to compile Rust workspace
320+ add_custom_target (gpubench_rust_gui ALL
321+ COMMAND ${CARGO_EXECUTABLE} build --release --workspace
322+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR }
323+ COMMENT "Building Rust GUI and core library"
324+ )
325+
326+ # Ensure C++ gpubench target depends on it
327+ add_dependencies (gpubench gpubench_rust_gui )
328+
329+ # Install the Rust GUI binary
330+ if (WIN32 )
331+ install (FILES "${CMAKE_CURRENT_SOURCE_DIR } /target/release/gpubench-gui.exe"
332+ DESTINATION bin)
333+ else ()
334+ install (FILES "${CMAKE_CURRENT_SOURCE_DIR } /target/release/gpubench-gui"
335+ DESTINATION bin)
336+ endif ()
337+ else ()
338+ message (WARNING "Cargo not found. Rust GUI will not be built and packaged." )
339+ endif ()
340+
314341# Install targets
315342install (TARGETS gpubench DESTINATION bin)
316343
You can’t perform that action at this time.
0 commit comments