mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-29 08:44:06 +08:00
Set CMAKE_CXX_VISIBILITY_PRESET and 3. VISIBILITY_INLINES_HIDDEN when build shared lib
This commit is contained in:
parent
c77f2e55c9
commit
0e49ce47a5
@ -242,6 +242,10 @@ if (BUILD_SHARED_LIBS)
|
|||||||
endif ()
|
endif ()
|
||||||
add_library(spdlog SHARED ${VERSION_RC})
|
add_library(spdlog SHARED ${VERSION_RC})
|
||||||
target_compile_definitions(spdlog PUBLIC SPDLOG_SHARED_LIB)
|
target_compile_definitions(spdlog PUBLIC SPDLOG_SHARED_LIB)
|
||||||
|
set_target_properties(spdlog PROPERTIES
|
||||||
|
CXX_VISIBILITY_PRESET hidden
|
||||||
|
VISIBILITY_INLINES_HIDDEN ON)
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
# disable dlls related warnings on msvc
|
# disable dlls related warnings on msvc
|
||||||
target_compile_options(spdlog PUBLIC $<$<AND:$<CXX_COMPILER_ID:MSVC>,$<NOT:$<COMPILE_LANGUAGE:CUDA>>>:/wd4251
|
target_compile_options(spdlog PUBLIC $<$<AND:$<CXX_COMPILER_ID:MSVC>,$<NOT:$<COMPILE_LANGUAGE:CUDA>>>:/wd4251
|
||||||
|
@ -5,18 +5,18 @@
|
|||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include "../common.h"
|
||||||
// null, no cost dummy "mutex" and dummy "atomic" log level
|
// null, no cost dummy "mutex" and dummy "atomic" log level
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
struct null_mutex {
|
struct SPDLOG_API null_mutex {
|
||||||
void lock() const {}
|
void lock() const {}
|
||||||
void unlock() const {}
|
void unlock() const {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct null_atomic {
|
struct SPDLOG_API null_atomic {
|
||||||
T value;
|
T value;
|
||||||
|
|
||||||
null_atomic() = default;
|
null_atomic() = default;
|
||||||
|
@ -117,6 +117,8 @@ ansicolor_stderr_sink<Mutex>::ansicolor_stderr_sink(color_mode mode)
|
|||||||
|
|
||||||
// template instantiations
|
// template instantiations
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include "spdlog/details/null_mutex.h"
|
||||||
|
template class SPDLOG_API spdlog::sinks::ansicolor_sink<std::mutex>;
|
||||||
|
template class SPDLOG_API spdlog::sinks::ansicolor_sink<spdlog::details::null_mutex>;
|
||||||
template class SPDLOG_API spdlog::sinks::ansicolor_stdout_sink<std::mutex>;
|
template class SPDLOG_API spdlog::sinks::ansicolor_stdout_sink<std::mutex>;
|
||||||
template class SPDLOG_API spdlog::sinks::ansicolor_stdout_sink<spdlog::details::null_mutex>;
|
template class SPDLOG_API spdlog::sinks::ansicolor_stdout_sink<spdlog::details::null_mutex>;
|
||||||
template class SPDLOG_API spdlog::sinks::ansicolor_stderr_sink<std::mutex>;
|
template class SPDLOG_API spdlog::sinks::ansicolor_stderr_sink<std::mutex>;
|
||||||
|
Loading…
Reference in New Issue
Block a user