Replaces cherry-picked upstream_ref with complete source trees. xllm/ — Iluvatar official C++ inference engine (15MB, 1470 files) Complete: kernels → layers → models → runtime → scheduler → api Excluded: .git, binary images, third_party submodule checkouts ds_vllm/ — Iluvatar official vllm fork (8MB, 703 files) Included: csrc/ (ALL CUDA kernels), fused_moe/, qwen3_5 model, _custom_ops Excluded: tests, benchmarks, docs, examples (not needed for reference) Critical call chains now fully traceable: MoE: moe_topk_softmax_kernels.cuh → ixformer.h → fused_moe.cpp → layer GDN: qwen3_gated_delta_net_base.cpp → qwen3_5_gated_delta_net.cpp Attention: ixformer.h → xllm_paged_attention → attention.cpp
74 lines
2.0 KiB
CMake
74 lines
2.0 KiB
CMake
# ported from https://github.com/Devolutions/CMakeRust
|
|
set(_CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${CMAKE_FIND_ROOT_PATH_MODE_PROGRAM})
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
|
|
set(_CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ${CMAKE_FIND_ROOT_PATH_MODE_INCLUDE})
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
|
|
|
|
if(CMAKE_HOST_WIN32)
|
|
set(USER_HOME "$ENV{USERPROFILE}")
|
|
else()
|
|
set(USER_HOME "$ENV{HOME}")
|
|
endif()
|
|
|
|
if(NOT DEFINED CARGO_HOME)
|
|
if("$ENV{CARGO_HOME}" STREQUAL "")
|
|
set(CARGO_HOME "${USER_HOME}/.cargo")
|
|
else()
|
|
set(CARGO_HOME "$ENV{CARGO_HOME}")
|
|
endif()
|
|
endif()
|
|
|
|
# Find cargo executable
|
|
find_program(CARGO_EXECUTABLE cargo
|
|
HINTS "${CARGO_HOME}"
|
|
PATH_SUFFIXES "bin")
|
|
mark_as_advanced(CARGO_EXECUTABLE)
|
|
|
|
# Find rustc executable
|
|
find_program(RUSTC_EXECUTABLE rustc
|
|
HINTS "${CARGO_HOME}"
|
|
PATH_SUFFIXES "bin")
|
|
mark_as_advanced(RUSTC_EXECUTABLE)
|
|
|
|
# Find rustdoc executable
|
|
find_program(RUSTDOC_EXECUTABLE rustdoc
|
|
HINTS "${CARGO_HOME}"
|
|
PATH_SUFFIXES "bin")
|
|
mark_as_advanced(RUSTDOC_EXECUTABLE)
|
|
|
|
# Find rust-gdb executable
|
|
find_program(RUST_GDB_EXECUTABLE rust-gdb
|
|
HINTS "${CARGO_HOME}"
|
|
PATH_SUFFIXES "bin")
|
|
mark_as_advanced(RUST_GDB_EXECUTABLE)
|
|
|
|
# Find rust-lldb executable
|
|
find_program(RUST_LLDB_EXECUTABLE rust-lldb
|
|
HINTS "${CARGO_HOME}"
|
|
PATH_SUFFIXES "bin")
|
|
mark_as_advanced(RUST_LLDB_EXECUTABLE)
|
|
|
|
# Find rustup executable
|
|
find_program(RUSTUP_EXECUTABLE rustup
|
|
HINTS "${CARGO_HOME}"
|
|
PATH_SUFFIXES "bin")
|
|
mark_as_advanced(RUSTUP_EXECUTABLE)
|
|
|
|
set(RUST_FOUND FALSE CACHE INTERNAL "")
|
|
|
|
if(CARGO_EXECUTABLE AND RUSTC_EXECUTABLE AND RUSTDOC_EXECUTABLE)
|
|
set(RUST_FOUND TRUE CACHE INTERNAL "")
|
|
|
|
set(CARGO_HOME "${CARGO_HOME}" CACHE PATH "Rust Cargo Home")
|
|
|
|
execute_process(COMMAND ${RUSTC_EXECUTABLE} --version OUTPUT_VARIABLE RUSTC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
string(REGEX REPLACE "rustc ([^ ]+) .*" "\\1" RUSTC_VERSION "${RUSTC_VERSION}")
|
|
endif()
|
|
|
|
if(NOT RUST_FOUND)
|
|
message(FATAL_ERROR "Could not find Rust!")
|
|
endif()
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${_CMAKE_FIND_ROOT_PATH_MODE_PROGRAM})
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ${_CMAKE_FIND_ROOT_PATH_MODE_INCLUDE})
|