Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump min cxx standard to 17 #6742

Merged
merged 4 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ project(tritonserver LANGUAGES C CXX)

include(CMakeDependentOption)

# 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.")

set(TRITON_VERSION "0.0.0" CACHE STRING "The version of the Triton shared library" )

option(TRITON_ENABLE_LOGGING "Include logging support in server" ON)
Expand Down Expand Up @@ -260,6 +263,7 @@ ExternalProject_Add(triton-server
-DTRITON_ENABLE_S3:BOOL=${TRITON_ENABLE_S3}
-DTRITON_ENABLE_TENSORRT:BOOL=${TRITON_ENABLE_TENSORRT}
-DTRITON_ENABLE_ENSEMBLE:BOOL=${TRITON_ENABLE_ENSEMBLE}
-DTRITON_MIN_CXX_STANDARD:STRING=${TRITON_MIN_CXX_STANDARD}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX:PATH=${TRITON_INSTALL_PREFIX}
-DTRITON_VERSION:STRING=${TRITON_VERSION}
Expand Down
12 changes: 6 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if (NOT WIN32)
set_property(TARGET main PROPERTY OUTPUT_NAME tritonserver)
endif()

target_compile_features(main PRIVATE cxx_std_11)
target_compile_features(main PRIVATE cxx_std_${TRITON_MIN_CXX_STANDARD})
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
message("Using MSVC as compiler, default target on Windows 10. "
"If the target system is not Windows 10, please update _WIN32_WINNT "
Expand Down Expand Up @@ -353,7 +353,7 @@ if(${TRITON_ENABLE_HTTP}
${HTTP_ENDPOINT_SRCS} ${HTTP_ENDPOINT_HDRS}
)

target_compile_features(http-endpoint-library PRIVATE cxx_std_11)
target_compile_features(http-endpoint-library PRIVATE cxx_std_${TRITON_MIN_CXX_STANDARD})
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(
http-endpoint-library
Expand Down Expand Up @@ -508,7 +508,7 @@ if(${TRITON_ENABLE_TRACING})
)

if (NOT WIN32)
target_compile_features(tracing-library PRIVATE cxx_std_17)
target_compile_features(tracing-library PRIVATE cxx_std_${TRITON_MIN_CXX_STANDARD})

target_include_directories(
tracing-library
Expand Down Expand Up @@ -592,7 +592,7 @@ if (NOT WIN32)
simple.cc
)

target_compile_features(simple PRIVATE cxx_std_11)
target_compile_features(simple PRIVATE cxx_std_${TRITON_MIN_CXX_STANDARD})
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
message("Using MSVC as compiler, default target on Windows 10. "
"If the target system is not Windows 10, please update _WIN32_WINNT "
Expand Down Expand Up @@ -656,7 +656,7 @@ if (NOT WIN32)
multi_server.cc
)

target_compile_features(multi_server PRIVATE cxx_std_11)
target_compile_features(multi_server PRIVATE cxx_std_${TRITON_MIN_CXX_STANDARD})
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
message("Using MSVC as compiler, default target on Windows 10. "
"If the target system is not Windows 10, please update _WIN32_WINNT "
Expand Down Expand Up @@ -721,7 +721,7 @@ if (NOT WIN32)
memory_alloc.cc
)

target_compile_features(memory_alloc PRIVATE cxx_std_11)
target_compile_features(memory_alloc PRIVATE cxx_std_${TRITON_MIN_CXX_STANDARD})
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
message("Using MSVC as compiler, default target on Windows 10. "
"If the target system is not Windows 10, please update _WIN32_WINNT "
Expand Down
2 changes: 1 addition & 1 deletion src/grpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ add_library(
stream_infer_handler.cc
)

target_compile_features(grpc-endpoint-library PRIVATE cxx_std_11)
target_compile_features(grpc-endpoint-library PRIVATE cxx_std_${TRITON_MIN_CXX_STANDARD})
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(
grpc-endpoint-library
Expand Down
Loading