Fixed build due to recent changes.

This commit is contained in:
Vitaly Zaitsev 2019-12-18 15:50:21 +01:00
parent 97df4e0a08
commit a1a7653aa6
No known key found for this signature in database
GPG Key ID: BF99FC6DD45AB90A
3 changed files with 96 additions and 12 deletions

51
spdlog-fix-cassert.patch Normal file
View File

@ -0,0 +1,51 @@
From 1fff2d8ae3afeebfeb1dcfe69920306966bae69e Mon Sep 17 00:00:00 2001
From: Vitaly Zaitsev <vitaly@easycoding.org>
Date: Wed, 18 Dec 2019 15:11:48 +0100
Subject: [PATCH] Backported upstream patch with assert() fixes.
---
include/spdlog/details/circular_q.h | 1 +
include/spdlog/details/pattern_formatter-inl.h | 2 --
include/spdlog/details/thread_pool-inl.h | 1 +
3 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/spdlog/details/circular_q.h b/include/spdlog/details/circular_q.h
index fee3a3bf..d147c5e0 100644
--- a/include/spdlog/details/circular_q.h
+++ b/include/spdlog/details/circular_q.h
@@ -5,6 +5,7 @@
#pragma once
#include <vector>
+#include <cassert>
namespace spdlog {
namespace details {
diff --git a/include/spdlog/details/pattern_formatter-inl.h b/include/spdlog/details/pattern_formatter-inl.h
index 1b95eb6d..9a657970 100644
--- a/include/spdlog/details/pattern_formatter-inl.h
+++ b/include/spdlog/details/pattern_formatter-inl.h
@@ -72,8 +72,6 @@ public:
private:
void pad_it(size_t count)
{
- // count = std::min(count, spaces_.size());
- assert(count <= spaces_.size());
fmt_helper::append_string_view(string_view_t(spaces_.data(), count), dest_);
}
diff --git a/include/spdlog/details/thread_pool-inl.h b/include/spdlog/details/thread_pool-inl.h
index 77d0b1fb..6b740ca2 100644
--- a/include/spdlog/details/thread_pool-inl.h
+++ b/include/spdlog/details/thread_pool-inl.h
@@ -8,6 +8,7 @@
#endif
#include "spdlog/common.h"
+#include <cassert>
namespace spdlog {
namespace details {
--
2.24.1

22
spdlog-fix-cmake.patch Normal file
View File

@ -0,0 +1,22 @@
From 4858d7e454e66d347024a074749535b91ccbeed9 Mon Sep 17 00:00:00 2001
From: gabime <gmelman1@gmail.com>
Date: Sun, 20 Oct 2019 10:27:17 +0300
Subject: [PATCH] Fix #1274
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index abceb307..5946b2a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -189,7 +189,7 @@ if (SPDLOG_INSTALL)
set(project_config_out "${CMAKE_CURRENT_BINARY_DIR}/spdlogConfig.cmake")
set(config_targets_file "spdlogConfigTargets.cmake")
set(version_config_file "${CMAKE_CURRENT_BINARY_DIR}/spdlogConfigVersion.cmake")
- set(export_dest_dir "${CMAKE_INSTALL_LIBDIR}/spdlog/cmake")
+ set(export_dest_dir "${CMAKE_INSTALL_LIBDIR}/cmake/spdlog")
set(pkgconfig_install_dir "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
set(pkg_config "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc")

View File

@ -1,5 +1,4 @@
%global user gabime
%global debug_package %{nil}
%global user gabime
Name: spdlog
Version: 1.4.2
@ -9,6 +8,11 @@ License: MIT
URL: https://github.com/%{user}/%{name}/
Source0: https://github.com/%{user}/%{name}/archive/v%{version}.tar.gz
# https://github.com/gabime/spdlog/commit/1aa9ea92e20142a1ce2f2e1ac40ed1fa781fac19
Patch100: %{name}-fix-cassert.patch
# https://github.com/gabime/spdlog/commit/4858d7e454e66d347024a074749535b91ccbeed9
Patch101: %{name}-fix-cmake.patch
BuildRequires: google-benchmark-devel
BuildRequires: fmt-devel >= 6.1.2
BuildRequires: ninja-build
@ -17,22 +21,21 @@ BuildRequires: cmake
BuildRequires: gcc
%description
This is a packaged version of the gabime/spdlog header-only C++
logging library available at Github.
This is a packaged version of the gabime/spdlog C++ logging
library available at Github.
%package devel
Summary: Development files for %{name}
Provides: %{name}-static = %{version}-%{release}
Provides: %{name} = %{version}-%{release}
Requires: libstdc++-devel
Requires: fmt-devel
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: libstdc++-devel%{?_isa}
Requires: fmt-devel%{?_isa}
%description devel
The %{name}-devel package contains C++ header files for developing
applications that use %{name}.
%prep
%autosetup
%autosetup -p1
mkdir -p %{_target_platform}
find . -name '.gitignore' -exec rm {} \;
sed -i -e "s,\r,," README.md
@ -40,10 +43,13 @@ sed -i -e "s,\r,," README.md
%build
pushd %{_target_platform}
%cmake -G Ninja \
-DCMAKE_INSTALL_LIBDIR=%{_lib} \
-DCMAKE_BUILD_TYPE=Release \
-DSPDLOG_BUILD_EXAMPLES=OFF \
-DSPDLOG_BUILD_SHARED=ON \
-DSPDLOG_BUILD_EXAMPLE=OFF \
-DSPDLOG_BUILD_BENCH=OFF \
-DSPDLOG_BUILD_TESTS=ON \
-DSPDLOG_INSTALL=ON \
-DSPDLOG_FMT_EXTERNAL=ON \
..
popd
@ -57,10 +63,15 @@ popd
%install
%ninja_install -C %{_target_platform}
%files devel
%doc README.md example/
%files
%license LICENSE
%doc README.md
%{_libdir}/lib%{name}.so.1*
%files devel
%doc example
%{_includedir}/%{name}
%{_libdir}/lib%{name}.so
%{_libdir}/cmake/%{name}
%{_libdir}/pkgconfig/%{name}.pc