@@ -122,10 +122,7 @@ set(KINETO_COMPILE_OPTIONS "-DKINETO_NAMESPACE=libkineto")
122
122
list (APPEND KINETO_COMPILE_OPTIONS "-DFMT_HEADER_ONLY" )
123
123
list (APPEND KINETO_COMPILE_OPTIONS "-DENABLE_IPC_FABRIC" )
124
124
list (APPEND KINETO_COMPILE_OPTIONS )
125
- if (NOT MSVC )
126
- list (APPEND KINETO_COMPILE_OPTIONS "-std=c++17" )
127
- else ()
128
- list (APPEND KINETO_COMPILE_OPTIONS "/std:c++17" )
125
+ if (MSVC )
129
126
list (APPEND KINETO_COMPILE_OPTIONS "-DWIN32_LEAN_AND_MEAN" )
130
127
list (APPEND KINETO_COMPILE_OPTIONS "-DNOGDI" )
131
128
endif ()
@@ -147,24 +144,6 @@ endif()
147
144
target_compile_options (kineto_base PRIVATE "${KINETO_COMPILE_OPTIONS} " )
148
145
target_compile_options (kineto_api PRIVATE "${KINETO_COMPILE_OPTIONS} " )
149
146
150
- if (NOT TARGET fmt )
151
- if (NOT FMT_SOURCE_DIR )
152
- set (FMT_SOURCE_DIR "${LIBKINETO_THIRDPARTY_DIR} /fmt"
153
- CACHE STRING "fmt source directory from submodules" )
154
- endif ()
155
-
156
- # Build FMT.
157
- # FMT and some other libraries use BUILD_SHARED_LIBS to control
158
- # the library type.
159
- # Save and restore the value after configuring FMT
160
- set (TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS} )
161
- set (BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE )
162
- set (FMT_LIBRARY_TYPE static CACHE STRING "Set lib type to static" )
163
- add_subdirectory ("${FMT_SOURCE_DIR} " "${LIBKINETO_BINARY_DIR} /fmt" )
164
- set_property (TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON )
165
- set (BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE )
166
- endif ()
167
-
168
147
set (FMT_INCLUDE_DIR "${FMT_SOURCE_DIR} /include" )
169
148
message (STATUS "Kineto: FMT_SOURCE_DIR = ${FMT_SOURCE_DIR} " )
170
149
message (STATUS "Kineto: FMT_INCLUDE_DIR = ${FMT_INCLUDE_DIR} " )
@@ -231,6 +210,7 @@ else()
231
210
message (FATAL_ERROR "Unsupported library type ${KINETO_LIBRARY_TYPE} " )
232
211
endif ()
233
212
target_link_libraries (kineto kineto_base kineto_api )
213
+ target_link_libraries (kineto $< BUILD_INTERFACE:fmt::fmt-header-only> )
234
214
235
215
if (NOT LIBKINETO_NOROCTRACER )
236
216
find_library (ROCTRACER_LIBRARY NAMES libroctracer64.so HINTS
0 commit comments