misc(ci): detect gha build

This commit is contained in:
Morgan Funtowicz 2025-01-09 23:17:46 +01:00
parent 1179fdff7e
commit 5ac2b15c00
2 changed files with 9 additions and 11 deletions

View File

@ -82,7 +82,7 @@ endif ()
#### Unit Tests #### #### Unit Tests ####
if (${TGI_TRTLLM_BACKEND_BUILD_TESTS}) if (${TGI_TRTLLM_BACKEND_BUILD_TESTS} AND CMAKE_BUILD_TYPE MATCHES "Debug")
message(STATUS "Building tests") message(STATUS "Building tests")
option(TGI_TRTLLM_BACKEND_ENABLE_ASAN "Enable AddressSanitizer") option(TGI_TRTLLM_BACKEND_ENABLE_ASAN "Enable AddressSanitizer")
option(TGI_TRTLLM_BACKEND_ENABLE_UBSAN "Enable UndefinedSanitizer") option(TGI_TRTLLM_BACKEND_ENABLE_UBSAN "Enable UndefinedSanitizer")
@ -113,7 +113,6 @@ if (${TGI_TRTLLM_BACKEND_BUILD_TESTS})
target_link_libraries(tgi_trtllm_backend_tests PUBLIC Catch2::Catch2WithMain nlohmann_json::nlohmann_json spdlog::spdlog tgi_trtllm_backend_impl) target_link_libraries(tgi_trtllm_backend_tests PUBLIC Catch2::Catch2WithMain nlohmann_json::nlohmann_json spdlog::spdlog tgi_trtllm_backend_impl)
target_link_libraries(tgi_trtllm_backend_tests PRIVATE tensorrt_llm nvinfer_plugin_tensorrt_llm tensorrt_llm_nvrtc_wrapper) target_link_libraries(tgi_trtllm_backend_tests PRIVATE tensorrt_llm nvinfer_plugin_tensorrt_llm tensorrt_llm_nvrtc_wrapper)
if (CMAKE_BUILD_TYPE MATCHES "Debug")
if (${TGI_TRTLLM_BACKEND_ENABLE_ASAN}) if (${TGI_TRTLLM_BACKEND_ENABLE_ASAN})
message(STATUS "Enabled AddressSanitizer") message(STATUS "Enabled AddressSanitizer")
target_link_options(tgi_trtllm_backend_tests BEFORE PUBLIC -fsanitize=address) target_link_options(tgi_trtllm_backend_tests BEFORE PUBLIC -fsanitize=address)
@ -123,7 +122,6 @@ if (${TGI_TRTLLM_BACKEND_BUILD_TESTS})
message(STATUS "Enabled UndefinedSanitizer") message(STATUS "Enabled UndefinedSanitizer")
target_link_options(tgi_trtllm_backend_tests BEFORE PUBLIC -fsanitize=undefined) target_link_options(tgi_trtllm_backend_tests BEFORE PUBLIC -fsanitize=undefined)
endif () endif ()
endif ()
install(TARGETS tgi_trtllm_backend_tests) install(TARGETS tgi_trtllm_backend_tests)

View File

@ -209,7 +209,7 @@ fn build_ffi_layer(deps_folder: &PathBuf, is_debug: bool) {
fn main() { fn main() {
// Misc variables // Misc variables
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
let build_profile = env::var("DEBUG").unwrap(); let build_profile = env::var("PROFILE").unwrap();
let (is_debug, opt_level) = match build_profile.as_ref() { let (is_debug, opt_level) = match build_profile.as_ref() {
"debug" => (true, "0"), "debug" => (true, "0"),
"dev" => (true, "0"), "dev" => (true, "0"),