8000 Fix libfmt linking by cyyever · Pull Request #1106 · pytorch/kineto · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix libfmt linking #1106

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 3 additions & 8 deletions libkineto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ endif()
target_compile_options(kineto_base PRIVATE "${KINETO_COMPILE_OPTIONS}")
target_compile_options(kineto_api PRIVATE "${KINETO_COMPILE_OPTIONS}")

if(NOT TARGET fmt)
if(NOT TARGET fmt::fmt-header-only)
if(NOT FMT_SOURCE_DIR)
set(FMT_SOURCE_DIR "${LIBKINETO_THIRDPARTY_DIR}/fmt"
CACHE STRING "fmt source directory from submodules")
Expand All @@ -208,12 +208,7 @@ if(NOT TARGET fmt)
# FMT and some other libraries use BUILD_SHARED_LIBS to control
# the library type.
# Save and restore the value after configuring FMT
set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
set(FMT_LIBRARY_TYPE static CACHE STRING "Set lib type to static")
add_subdirectory("${FMT_SOURCE_DIR}" "${LIBKINETO_BINARY_DIR}/fmt")
set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)
set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE)
endif()

set(FMT_INCLUDE_DIR "${FMT_SOURCE_DIR}/include")
Expand Down Expand Up @@ -247,7 +242,6 @@ target_include_directories(kineto_base PUBLIC
$<BUILD_INTERFACE:${LIBKINETO_INCLUDE_DIR}>
$<BUILD_INTERFACE:${LIBKINETO_SOURCE_DIR}>
$<BUILD_INTERFACE:${DYNOLOG_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FMT_INCLUDE_DIR}>
$<BUILD_INTERFACE:${IPCFABRIC_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CUPTI_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CUDA_INCLUDE_DIRS}>
Expand All @@ -257,10 +251,11 @@ target_include_directories(kineto_base PUBLIC
if(DEFINED LIBKINETO_NOXPUPTI AND NOT LIBKINETO_NOXPUPTI)
target_include_directories(kineto_base PUBLIC ${XPUPTI_INCLUDE_DIR})
endif()
target_link_libraries(kineto_base PRIVATE fmt::fmt-header-only)

target_include_directories(kineto_api PUBLIC
$<BUILD_INTERFACE:${FMT_INCLUDE_DIR}>
$<BUILD_INTERFACE:${LIBKINETO_INCLUDE_DIR}>)
target_link_libraries(kineto_api PRIVATE fmt::fmt-header-only)

if(KINETO_LIBRARY_TYPE STREQUAL "static")
add_library(kineto STATIC
Expand Down
2 changes: 1 addition & 1 deletion libkineto/third_party/fmt
Submodule fmt updated 64 files
+7 −0 .clang-format
+5 −3 .github/workflows/cifuzz.yml
+3 −4 .github/workflows/doc.yml
+8 −35 .github/workflows/lint.yml
+105 −45 .github/workflows/linux.yml
+7 −3 .github/workflows/macos.yml
+4 −4 .github/workflows/scorecard.yml
+5 −10 .github/workflows/windows.yml
+1 −0 .gitignore
+37 −18 CMakeLists.txt
+470 −0 ChangeLog.md
+12 −11 README.md
+61 −32 doc/api.md
+1 −1 doc/get-started.md
+2 −2 doc/index.md
+4 −5 doc/syntax.md
+20 −28 include/fmt/args.h
+2,092 −2,164 include/fmt/base.h
+507 −609 include/fmt/chrono.h
+132 −107 include/fmt/color.h
+54 −44 include/fmt/compile.h
+99 −55 include/fmt/format-inl.h
+1,118 −1,293 include/fmt/format.h
+43 −55 include/fmt/os.h
+45 −89 include/fmt/ostream.h
+109 −132 include/fmt/printf.h
+103 −135 include/fmt/ranges.h
+133 −70 include/fmt/std.h
+102 −55 include/fmt/xchar.h
+19 −1 src/fmt.cc
+4 −1 8000 src/format.cc
+6 −11 src/os.cc
+1 −1 support/bazel/.bazelversion
+2 −0 support/bazel/BUILD.bazel
+2 −1 support/bazel/MODULE.bazel
+1 −1 support/bazel/README.md
+43 −0 support/check-commits
+35 −3 support/mkdocs
+311 −290 support/python/mkdocstrings_handlers/cxx/__init__.py
+42 −61 support/release.py
+12 −20 test/CMakeLists.txt
+14 −0 test/args-test.cc
+162 −141 test/base-test.cc
+189 −229 test/chrono-test.cc
+58 −1 test/color-test.cc
+1 −27 test/compile-error-test/CMakeLists.txt
+51 −13 test/compile-test.cc
+6 −5 test/format-impl-test.cc
+197 −52 test/format-test.cc
+19 −11 test/gtest/gmock-gtest-all.cc
+24 −10 test/gtest/gmock/gmock.h
+4 −3 test/gtest/gtest/gtest.h
+25 −0 test/no-builtin-types-test.cc
+77 −1 test/os-test.cc
+25 −0 test/perf-sanity.cc
+4 −0 test/printf-test.cc
+56 −34 test/ranges-test.cc
+3 −3 test/scan-test.cc
+10 −7 test/scan.h
+64 −13 test/std-test.cc
+1 −1 test/test-assert.h
+1 −1 test/unicode-test.cc
+4 −5 test/util.cc
+25 −204 test/xchar-test.cc
0