diff --git a/CMakeLists.txt b/CMakeLists.txt index 39a7e4df..2d55d62d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/include/spdlog/fmt/bundled/format.h b/include/spdlog/fmt/bundled/format.h index f27996d3..312f88a7 100644 --- a/include/spdlog/fmt/bundled/format.h +++ b/include/spdlog/fmt/bundled/format.h @@ -665,7 +665,7 @@ template struct FMT_EXTERN_TEMPLATE_API basic_data { static const wchar_t wreset_color[5]; }; -FMT_EXTERN template struct basic_data; +FMT_EXTERN template struct FMT_API basic_data; // This is a struct rather than an alias to avoid shadowing warnings in gcc. struct data : basic_data<> {}; diff --git a/src/fmt.cpp b/src/fmt.cpp index ed3a78bd..7865ca6d 100644 --- a/src/fmt.cpp +++ b/src/fmt.cpp @@ -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