Skip to content

Commit

Permalink
chore: remove std::format supports for spdlog
Browse files Browse the repository at this point in the history
Just use the fmt lib bundled with it.

Change-Id: I83d9974ebe63e74dee947f7b7d6cabfb959c6c83
  • Loading branch information
narnaud committed Jun 7, 2024
1 parent 58adfca commit 4b67296
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 310 deletions.
1 change: 0 additions & 1 deletion 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
check_submodule(spdlog spdlog)
# See https://github.com/gabime/spdlog/issues/1190
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(SPDLOG_USE_STD_FORMAT ${KNUT_USE_STD_FORMAT})
add_subdirectory(spdlog)

# nlohmann/json
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ include(InstallDependency)
include(CheckSubmodule)

option(USE_ASAN "use Address Sanitizer" OFF)
option(KNUT_USE_STD_FORMAT "Use std format library for speed log library" ON)
# It's best practice to only enable -Werror in CI & development builds.
# We enable this option in the appropriate CMakePresets.
# If you just want to have a working build of knut, -Werror can be very annoying, so keep it off by default.
Expand Down
3 changes: 1 addition & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
"generator": "Ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"KNUT_ERROR_ON_WARN": "ON",
"KNUT_USE_STD_FORMAT": "OFF"
"KNUT_ERROR_ON_WARN": "ON"
}
},
{
Expand Down
7 changes: 1 addition & 6 deletions src/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@

project(knut-utils LANGUAGES CXX)
find_package(Qt6 REQUIRED COMPONENTS Core Gui)
set(PROJECT_SOURCES json.h qt_fmt_helpers.h strings.h strings.cpp log.h)
set(PROJECT_SOURCES json.h qt_fmt_helpers.h qt_fmt_format.h strings.h strings.cpp log.h)
add_library(${PROJECT_NAME} STATIC ${PROJECT_SOURCES})
if(KNUT_USE_STD_FORMAT)
target_sources(${PROJECT_NAME} PUBLIC qt_std_format.h)
else()
target_sources(${PROJECT_NAME} PUBLIC qt_fmt_format.h)
endif()

target_link_libraries(${PROJECT_NAME} PUBLIC nlohmann_json::nlohmann_json
spdlog::spdlog Qt6::Core Qt6::Gui)
Expand Down
51 changes: 0 additions & 51 deletions src/utils/qt_std_format.h

This file was deleted.

7 changes: 0 additions & 7 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ add_knut_test(tst_client tst_client.cpp knut-lsp)

add_knut_test(tst_settings tst_settings.cpp)

# tst_qt_std_format tests qt_format with std::format
# However, std::format isn't currently well-supported by the major compilers.
# So for now, disable this test. It can be reenabled once we can finally switch to std::format
# add_knut_test(tst_qt_std_format tst_qt_std_format.cpp)
# Use the fmt library that's bundled with spdlog instead.
add_knut_test(tst_qt_fmt_format tst_qt_fmt_format.cpp)

add_knut_test(tst_stringutils tst_stringutils.cpp)

add_knut_test(tst_textdocument tst_textdocument.cpp)
Expand Down
121 changes: 0 additions & 121 deletions tests/tst_qt_fmt_format.cpp

This file was deleted.

121 changes: 0 additions & 121 deletions tests/tst_qt_std_format.cpp

This file was deleted.

0 comments on commit 4b67296

Please sign in to comment.