Some minor changes to compile bundled fmt propperly w. BUILD_SHARED_LIBS

Basically, libfmt also lacks support for propper generate_export_headers,
instead, some handwritten macros that only work on windows are used :-(
Personally, I think including dependencies in the build is always a bad idea,
but there might be good (Windows??) reasons for it. Anyhow, this is a rather
ugly fix to include the generate_export_headers into libfmt.

Signed-off-by: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
pull/1257/head
Matthias Schoepfer 6 years ago
parent d05c507c04
commit a0d66415ef

@ -7,6 +7,7 @@ cmake_minimum_required(VERSION 3.2)
# Start spdlog project
#---------------------------------------------------------------------------------------
include(GNUInstallDirs)
include(GenerateExportHeader)
include(cmake/utils.cmake)
include(cmake/ide.cmake)
@ -99,8 +100,8 @@ endif()
add_library(spdlog ${SPDLOG_SRCS} ${SPDLOG_ALL_HEADERS})
add_library(spdlog::spdlog ALIAS spdlog)
generate_export_header(spdlog)
if (BUILD_SHARED_LIBS)
generate_export_header(spdlog)
target_compile_definitions(spdlog PRIVATE SPDLOG_USE_EXPORT_HEADER)
set_target_properties(spdlog PROPERTIES CXX_VISIBILITY_PRESET hidden)
set_target_properties(spdlog PROPERTIES VISIBILITY_INLINES_HIDDEN 1)

@ -665,7 +665,7 @@ template <typename T = void> struct FMT_EXTERN_TEMPLATE_API basic_data {
static const wchar_t wreset_color[5];
};
FMT_EXTERN template struct basic_data<void>;
FMT_EXTERN template struct FMT_API basic_data<void>;
// This is a struct rather than an alias to avoid shadowing warnings in gcc.
struct data : basic_data<> {};

@ -7,6 +7,7 @@
// All rights reserved.
#if !defined(SPDLOG_FMT_EXTERNAL)
#include "spdlog/fmt/bundled/core.h"
#include "spdlog/fmt/bundled/format-inl.h"
FMT_BEGIN_NAMESPACE

Loading…
Cancel
Save