From 15e9728c954ff6886c48c2cc8b9e6ce7ffe0877e Mon Sep 17 00:00:00 2001 From: Olivier Le Doeuff Date: Mon, 29 Apr 2024 20:54:07 +0200 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20spdlog=20v1.12.0=20(#7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmake/Dependencies.cmake | 2 +- cmake/FetchSpdlog.cmake | 13 +++++++++++-- src/SocketWorker.cpp | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 7b86c59..c3a66e9 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -3,4 +3,4 @@ set(QOLM_REPOSITORY "https://github.com/OlivierLDff/QOlm.git" CACHE STRING "QOlm set(QOLM_TAG "v3.1.1" CACHE STRING "QOlm git tag") set(SPDLOG_REPOSITORY "https://github.com/gabime/spdlog" CACHE STRING "Repository of spdlog") -set(SPDLOG_TAG "fa659bf7ad327a13e2e7134d1004d0cda0c3ed96" CACHE STRING "Git tag/branch of spdlog") +set(SPDLOG_TAG "v1.12.0" CACHE STRING "Git tag/branch of spdlog") diff --git a/cmake/FetchSpdlog.cmake b/cmake/FetchSpdlog.cmake index cdcd4a3..939192b 100644 --- a/cmake/FetchSpdlog.cmake +++ b/cmake/FetchSpdlog.cmake @@ -15,5 +15,14 @@ CPMAddPackage( GIT_TAG ${SPDLOG_TAG} ) -set_target_properties(spdlog PROPERTIES FOLDER "Dependencies") -set_target_properties(spdlog PROPERTIES POSITION_INDEPENDENT_CODE ON) +if(NOT TARGET spdlog) + # Create an alias spdlog for other FetchSpdlog + # dependencies to work that don't have the if(TARGET spdlog) condition + add_library(spdlog INTERFACE) + target_link_libraries(spdlog INTERFACE spdlog::spdlog) + message(STATUS "spdlog target didn't exist, created an alias target") +endif() + +if(TARGET spdlog) + set_target_properties(spdlog PROPERTIES FOLDER "Dependencies") +endif() diff --git a/src/SocketWorker.cpp b/src/SocketWorker.cpp index d631b11..77b2cd6 100644 --- a/src/SocketWorker.cpp +++ b/src/SocketWorker.cpp @@ -196,7 +196,7 @@ void SocketWorker::onSocketError(const QAbstractSocket::SocketError e) void SocketWorker::onSocketStateChanged(QAbstractSocket::SocketState socketState) { - LOG_INFO("New Socket state : {}", socketState); + LOG_INFO("New Socket state : {}", (int)socketState); if(socketState == QAbstractSocket::UnconnectedState) { onDisconnected();