From feb7c46c6e0c1e6f8f020c9af0ac8033d562199b Mon Sep 17 00:00:00 2001 From: oandreeva-nv Date: Wed, 20 Dec 2023 10:54:03 -0800 Subject: [PATCH] Added TRITON_MIN_CXX_STANDARD --- CMakeLists.txt | 4 ++++ src/c++/library/CMakeLists.txt | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4db8144b6..b1fc6ccf0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,9 @@ cmake_minimum_required(VERSION 3.17) project(tritonclient LANGUAGES C CXX) +# Use C++17 standard as Triton's minimum required. +set(TRITON_MIN_CXX_STANDARD 17 CACHE STRING "The minimum C++ standard which features are requested to build this target.") + # # Options # @@ -168,6 +171,7 @@ if(TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_CC_GRPC OR TRITON_ENABLE_PERF_ANALYZER -DTRITON_ENABLE_TESTS:BOOL=${TRITON_ENABLE_TESTS} -DTRITON_ENABLE_GPU:BOOL=${TRITON_ENABLE_GPU} -DTRITON_ENABLE_ZLIB:BOOL=${TRITON_ENABLE_ZLIB} + -DTRITON_MIN_CXX_STANDARD:STRING=${TRITON_MIN_CXX_STANDARD} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=${TRITON_INSTALL_PREFIX} DEPENDS ${_cc_client_depends} diff --git a/src/c++/library/CMakeLists.txt b/src/c++/library/CMakeLists.txt index 349feda5f..cdee03e1a 100644 --- a/src/c++/library/CMakeLists.txt +++ b/src/c++/library/CMakeLists.txt @@ -155,7 +155,7 @@ if(TRITON_ENABLE_CC_GRPC OR TRITON_ENABLE_PERF_ANALYZER) ) foreach(_client_target grpc-client-library grpcclient_static grpcclient) - target_compile_features(${_client_target} PRIVATE cxx_std_17) + target_compile_features(${_client_target} PRIVATE cxx_std_${TRITON_MIN_CXX_STANDARD}) target_compile_options( ${_client_target} PRIVATE $<$,$,$>: @@ -338,7 +338,7 @@ if(TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_PERF_ANALYZER) ) foreach(_client_target http-client-library httpclient_static httpclient) - target_compile_features(${_client_target} PRIVATE cxx_std_17) + target_compile_features(${_client_target} PRIVATE cxx_std_${TRITON_MIN_CXX_STANDARD}) target_compile_options( ${_client_target} PRIVATE $<$,$,$>: