1
- # Copyright (c) 2020-2023 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1
+ # Copyright (c) 2020-2024 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
2
#
3
3
# Redistribution and use in source and binary forms, with or without
4
4
# modification, are permitted provided that the following conditions
@@ -60,7 +60,58 @@ if(TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_PERF_ANALYZER OR TRITON_ENABLE_EXAMPLE
60
60
PRIVATE
61
61
client-common-library
62
62
)
63
- endif ()
63
+
64
+ add_library (
65
+ json_utils_static STATIC
66
+ $<TARGET_OBJECTS:json-utils-library>
67
+ )
68
+
69
+ add_library (
70
+ TritonClient::json_utils_static ALIAS json_utils_static
71
+ )
72
+
73
+ foreach (_json_target json-utils-library json_utils_static)
74
+ target_compile_features (${_json_target} PRIVATE cxx_std_${TRITON_MIN_CXX_STANDARD} )
75
+ target_compile_options (
76
+ ${_json_target} PRIVATE
77
+ $<$<OR :$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
78
+ -Wall -Wextra -Wno-unused-parameter -Werror>
79
+ $<$<CXX_COMPILER_ID:MSVC >:/W0 /D_WIN32_WINNT=0x0A00 /EHsc>
80
+ )
81
+
82
+ set_target_properties (
83
+ ${_json_target}
84
+ PROPERTIES
85
+ POSITION_INDEPENDENT_CODE ON
86
+ )
87
+
88
+ target_include_directories (
89
+ ${_json_target}
90
+ PUBLIC
91
+ $<INSTALL_INTERFACE:include >
92
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} >
93
+ PRIVATE
94
+ ${CMAKE_CURRENT_SOURCE_DIR}
95
+ )
96
+
97
+ install (
98
+ FILES
99
+ ${CMAKE_CURRENT_SOURCE_DIR} /json_utils.h
100
+ DESTINATION include
101
+ )
102
+ endforeach ()
103
+
104
+ install (
105
+ TARGETS
106
+ json_utils_static
107
+ EXPORT
108
+ triton-client-targets
109
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
110
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
111
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
112
+ )
113
+
114
+ endif () # TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_PERF_ANALYZER OR TRITON_ENABLE_EXAMPLES
64
115
65
116
#
66
117
# shm_utils
@@ -75,6 +126,56 @@ target_link_libraries(
75
126
client-common-library
76
127
)
77
128
129
+ add_library (
130
+ shm_utils_static STATIC
131
+ $<TARGET_OBJECTS:shm-utils-library>
132
+ )
133
+
134
+ add_library (
135
+ TritonClient::shm_utils_static ALIAS shm_utils_static
136
+ )
137
+
138
+ foreach (_shm_target shm-utils-library shm_utils_static)
139
+ target_compile_features (${_shm_target} PRIVATE cxx_std_${TRITON_MIN_CXX_STANDARD} )
140
+ target_compile_options (
141
+ ${_shm_target} PRIVATE
142
+ $<$<OR :$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
143
+ -Wall -Wextra -Wno-unused-parameter -Werror>
144
+ $<$<CXX_COMPILER_ID:MSVC >:/W0 /D_WIN32_WINNT=0x0A00 /EHsc>
145
+ )
146
+
147
+ set_target_properties (
148
+ ${_shm_target}
149
+ PROPERTIES
150
+ POSITION_INDEPENDENT_CODE ON
151
+ )
152
+
153
+ target_include_directories (
154
+ ${_shm_target}
155
+ PUBLIC
156
+ $<INSTALL_INTERFACE:include >
157
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} >
158
+ PRIVATE
159
+ ${CMAKE_CURRENT_SOURCE_DIR}
160
+ )
161
+
162
+ install (
163
+ FILES
164
+ ${CMAKE_CURRENT_SOURCE_DIR} /shm_utils.h
165
+ DESTINATION include
166
+ )
167
+ endforeach ()
168
+
169
+ install (
170
+ TARGETS
171
+ shm_utils_static
172
+ EXPORT
173
+ triton-client-targets
174
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
175
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
176
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
177
+ )
178
+
78
179
if (TRITON_ENABLE_CC_GRPC OR TRITON_ENABLE_PERF_ANALYZER)
79
180
#
80
181
# libgrpcclient.so and libgrpcclient_static.a
@@ -400,6 +501,7 @@ if(TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_CC_GRPC OR TRITON_ENABLE_PERF_ANALYZER
400
501
FILES
401
502
${CMAKE_CURRENT_SOURCE_DIR} /common.h
402
503
${CMAKE_CURRENT_SOURCE_DIR} /ipc.h
504
+ ${CMAKE_CURRENT_SOURCE_DIR} /cencode.h
403
505
DESTINATION include
404
506
)
405
507
0 commit comments