From 2ddbf4404f220f24cc3bd1c6eba80a82889bf6f9 Mon Sep 17 00:00:00 2001 From: Misha Chornyi Date: Wed, 26 Nov 2025 19:46:13 -0800 Subject: [PATCH 1/3] Update cmake configuration --- CMakeLists.txt | 12 ++++++------ conanfile.txt | 17 +++++++++++++++++ protobuf/CMakeLists.txt | 3 ++- src/CMakeLists.txt | 2 +- src/test/triton_json/CMakeLists.txt | 5 ++++- 5 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 conanfile.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 128da4b..b62dd40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,14 +39,15 @@ set(TRITON_MIN_CXX_STANDARD 17 CACHE STRING "The minimum C++ standard whose feat # Some components are expensive to build and have extensive # dependencies, so those parts of the build must be enabled # explicitly. -option(TRITON_COMMON_ENABLE_PROTOBUF "Build protobuf artifacts" OFF) +option(TRITON_COMMON_ENABLE_PROTOBUF "Build protobuf artifacts" ON) option(TRITON_COMMON_ENABLE_PROTOBUF_PYTHON "Build protobuf artifacts for python" ON) -option(TRITON_COMMON_ENABLE_GRPC "Build grpc artifacts" OFF) +option(TRITON_COMMON_ENABLE_GRPC "Build grpc artifacts" ON) option(TRITON_COMMON_ENABLE_JSON "Build json-related libs" ON) if(TRITON_COMMON_ENABLE_JSON) find_package(RapidJSON CONFIG REQUIRED) - message(STATUS "RapidJSON found. Headers: ${RAPIDJSON_INCLUDE_DIRS}") + message(STATUS "RapidJSON found. Headers: ${RapidJSON_INCLUDE_DIRS}") + message(STATUS "RapidJSON version: ${RapidJSON_DIR}") endif() set(THREADS_PREFER_PTHREAD_FLAG TRUE) @@ -103,9 +104,9 @@ if(TRITON_COMMON_ENABLE_JSON) triton-common-json INTERFACE $ - $ + $ $ - $ + $ ) endif() @@ -140,7 +141,6 @@ if(${TRITON_COMMON_ENABLE_PROTOBUF} OR ${TRITON_COMMON_ENABLE_GRPC}) $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src - ${Protobuf_INCLUDE_DIRS} ) target_link_libraries( diff --git a/conanfile.txt b/conanfile.txt new file mode 100644 index 0000000..7fc31ea --- /dev/null +++ b/conanfile.txt @@ -0,0 +1,17 @@ +[requires] +abseil/20230802.1 +c-ares/1.34.5 +grpc/1.54.3 +openssl/3.6.0 +protobuf/3.21.12 +rapidjson/1.1.0 +re2/20230301 +zlib/1.3.1 + + +[generators] +CMakeDeps +CMakeToolchain + +[layout] +cmake_layout diff --git a/protobuf/CMakeLists.txt b/protobuf/CMakeLists.txt index 3b70113..cedfae0 100644 --- a/protobuf/CMakeLists.txt +++ b/protobuf/CMakeLists.txt @@ -29,7 +29,8 @@ cmake_minimum_required (VERSION 3.31.8) set(protobuf_MODULE_COMPATIBLE TRUE CACHE BOOL "protobuf_MODULE_COMPATIBLE" FORCE) find_package(Protobuf CONFIG REQUIRED) message(STATUS "Using protobuf ${Protobuf_VERSION}") -include_directories(${Protobuf_INCLUDE_DIRS}) +message(STATUS "Protobuf includes: ${protobuf_INCLUDE_DIRS}") +include_directories(${protobuf_INCLUDE_DIRS}) if(${TRITON_COMMON_ENABLE_GRPC}) find_package(gRPC CONFIG REQUIRED) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4c98094..1b20092 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -66,7 +66,7 @@ target_include_directories( $ $ PRIVATE - ${RAPIDJSON_INCLUDE_DIRS} + ${RapidJSON_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/src/test/triton_json/CMakeLists.txt b/src/test/triton_json/CMakeLists.txt index 4b112d6..a1919b2 100644 --- a/src/test/triton_json/CMakeLists.txt +++ b/src/test/triton_json/CMakeLists.txt @@ -31,12 +31,15 @@ target_link_libraries( GTest::gtest GTest::gtest_main) +message(STATUS "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}") +find_package(RapidJSON CONFIG REQUIRED) +message(STATUS "RapidJSON found. Headers: ${rapidjson_INCLUDE_DIRS}") target_include_directories( triton-json-test PUBLIC $ $ - $ + $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) From 746eacfc56b64da8b24e31a064dce472cb2412a8 Mon Sep 17 00:00:00 2001 From: Misha Chornyi Date: Wed, 26 Nov 2025 19:56:43 -0800 Subject: [PATCH 2/3] Disable options --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b62dd40..0eddb5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,9 +39,9 @@ set(TRITON_MIN_CXX_STANDARD 17 CACHE STRING "The minimum C++ standard whose feat # Some components are expensive to build and have extensive # dependencies, so those parts of the build must be enabled # explicitly. -option(TRITON_COMMON_ENABLE_PROTOBUF "Build protobuf artifacts" ON) +option(TRITON_COMMON_ENABLE_PROTOBUF "Build protobuf artifacts" OFF) option(TRITON_COMMON_ENABLE_PROTOBUF_PYTHON "Build protobuf artifacts for python" ON) -option(TRITON_COMMON_ENABLE_GRPC "Build grpc artifacts" ON) +option(TRITON_COMMON_ENABLE_GRPC "Build grpc artifacts" OFF) option(TRITON_COMMON_ENABLE_JSON "Build json-related libs" ON) if(TRITON_COMMON_ENABLE_JSON) From b3332795cc8593ee776ad3b765a5e4de069f0a7d Mon Sep 17 00:00:00 2001 From: Misha Chornyi Date: Wed, 26 Nov 2025 21:57:51 -0800 Subject: [PATCH 3/3] Add default build type --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0eddb5c..7e99afc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ project(tritoncommon LANGUAGES C CXX) # C++ standard # set(TRITON_MIN_CXX_STANDARD 17 CACHE STRING "The minimum C++ standard whose features are requested to build this target.") - +set(CMAKE_BUILD_TYPE Release) # # Options #