From 1e08e9c4937a9c558a5463169a714fa7aba810f0 Mon Sep 17 00:00:00 2001 From: Morgan Funtowicz Date: Thu, 9 Jan 2025 23:17:46 +0100 Subject: [PATCH] misc(ci): detect gha build --- backends/trtllm/CMakeLists.txt | 18 ++++++++---------- backends/trtllm/build.rs | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/backends/trtllm/CMakeLists.txt b/backends/trtllm/CMakeLists.txt index 6b22ae6c..c712e2dd 100644 --- a/backends/trtllm/CMakeLists.txt +++ b/backends/trtllm/CMakeLists.txt @@ -82,7 +82,7 @@ endif () #### Unit Tests #### -if (${TGI_TRTLLM_BACKEND_BUILD_TESTS}) +if (${TGI_TRTLLM_BACKEND_BUILD_TESTS} AND CMAKE_BUILD_TYPE MATCHES "Debug") message(STATUS "Building tests") option(TGI_TRTLLM_BACKEND_ENABLE_ASAN "Enable AddressSanitizer") option(TGI_TRTLLM_BACKEND_ENABLE_UBSAN "Enable UndefinedSanitizer") @@ -113,16 +113,14 @@ 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 PRIVATE tensorrt_llm nvinfer_plugin_tensorrt_llm tensorrt_llm_nvrtc_wrapper) - if (CMAKE_BUILD_TYPE MATCHES "Debug") - if (${TGI_TRTLLM_BACKEND_ENABLE_ASAN}) - message(STATUS "Enabled AddressSanitizer") - target_link_options(tgi_trtllm_backend_tests BEFORE PUBLIC -fsanitize=address) - endif () + if (${TGI_TRTLLM_BACKEND_ENABLE_ASAN}) + message(STATUS "Enabled AddressSanitizer") + target_link_options(tgi_trtllm_backend_tests BEFORE PUBLIC -fsanitize=address) + endif () - if (${TGI_TRTLLM_BACKEND_ENABLE_UBSAN}) - message(STATUS "Enabled UndefinedSanitizer") - target_link_options(tgi_trtllm_backend_tests BEFORE PUBLIC -fsanitize=undefined) - endif () + if (${TGI_TRTLLM_BACKEND_ENABLE_UBSAN}) + message(STATUS "Enabled UndefinedSanitizer") + target_link_options(tgi_trtllm_backend_tests BEFORE PUBLIC -fsanitize=undefined) endif () install(TARGETS tgi_trtllm_backend_tests) diff --git a/backends/trtllm/build.rs b/backends/trtllm/build.rs index 1a229940..88901fb6 100644 --- a/backends/trtllm/build.rs +++ b/backends/trtllm/build.rs @@ -209,7 +209,7 @@ fn build_ffi_layer(deps_folder: &PathBuf, is_debug: bool) { fn main() { // Misc variables 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() { "debug" => (true, "0"), "dev" => (true, "0"),