diff --git a/rd-cpp/CMakeLists.txt b/rd-cpp/CMakeLists.txt index 703d4e4bc..80b52f6e4 100644 --- a/rd-cpp/CMakeLists.txt +++ b/rd-cpp/CMakeLists.txt @@ -65,6 +65,8 @@ else () set(PCH_CPP_OPT "") endif () +option(RD_STATIC "Compile RD as static library" OFF) + add_subdirectory(thirdparty) add_subdirectory(src) diff --git a/rd-cpp/src/CMakeLists.txt b/rd-cpp/src/CMakeLists.txt index bad47815b..4d1be5b19 100644 --- a/rd-cpp/src/CMakeLists.txt +++ b/rd-cpp/src/CMakeLists.txt @@ -1,5 +1,3 @@ -option(RD_STATIC "Compile RD as static library" OFF) - add_subdirectory(rd_core_cpp) add_subdirectory(rd_framework_cpp) add_subdirectory(rd_gen_cpp) \ No newline at end of file diff --git a/rd-cpp/src/rd_core_cpp/src/main/CMakeLists.txt b/rd-cpp/src/rd_core_cpp/src/main/CMakeLists.txt index 876597570..db04f7fc9 100644 --- a/rd-cpp/src/rd_core_cpp/src/main/CMakeLists.txt +++ b/rd-cpp/src/rd_core_cpp/src/main/CMakeLists.txt @@ -36,6 +36,7 @@ set(RD_CORE_CPP_SOURCES util/gen_util.h util/overloaded.h #pch ${PCH_CPP_OPT} + util/export_api_helper.h ) if (RD_STATIC) @@ -45,10 +46,14 @@ else () add_library(rd_core_cpp SHARED ${RD_CORE_CPP_SOURCES}) endif () +set(RD_CORE_EXPORT_HEADER_CUSTOM_CONTENT "#include \"util/export_api_helper.h\"") + include(GenerateExportHeader) generate_export_header(rd_core_cpp BASE_NAME rd_core - EXPORT_MACRO_NAME RD_CORE_API) + EXPORT_MACRO_NAME RD_CORE_API + CUSTOM_CONTENT_FROM_VARIABLE RD_CORE_EXPORT_HEADER_CUSTOM_CONTENT +) message(STATUS "Using pch by rd_core: '${ENABLE_PCH_HEADERS}'") diff --git a/rd-cpp/src/rd_core_cpp/src/main/lifetime/Lifetime.h b/rd-cpp/src/rd_core_cpp/src/main/lifetime/Lifetime.h index 7cf3f6403..4144699eb 100644 --- a/rd-cpp/src/rd_core_cpp/src/main/lifetime/Lifetime.h +++ b/rd-cpp/src/rd_core_cpp/src/main/lifetime/Lifetime.h @@ -9,6 +9,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { class Lifetime; @@ -64,4 +66,6 @@ inline size_t hash::operator()(const Lifetime& value) const noexcept } } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_CORE_LIFETIMEWRAPPER_H diff --git a/rd-cpp/src/rd_core_cpp/src/main/lifetime/LifetimeDefinition.cpp b/rd-cpp/src/rd_core_cpp/src/main/lifetime/LifetimeDefinition.cpp index 2115adc48..5d8a86426 100644 --- a/rd-cpp/src/rd_core_cpp/src/main/lifetime/LifetimeDefinition.cpp +++ b/rd-cpp/src/rd_core_cpp/src/main/lifetime/LifetimeDefinition.cpp @@ -18,7 +18,7 @@ bool LifetimeDefinition::is_terminated() const return lifetime->is_terminated(); } -void LifetimeDefinition::terminate() const +void LifetimeDefinition::terminate() { lifetime->terminate(); } diff --git a/rd-cpp/src/rd_core_cpp/src/main/lifetime/LifetimeDefinition.h b/rd-cpp/src/rd_core_cpp/src/main/lifetime/LifetimeDefinition.h index 8eb5a0060..39442e0e0 100644 --- a/rd-cpp/src/rd_core_cpp/src/main/lifetime/LifetimeDefinition.h +++ b/rd-cpp/src/rd_core_cpp/src/main/lifetime/LifetimeDefinition.h @@ -11,6 +11,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { class RD_CORE_API LifetimeDefinition @@ -44,7 +46,7 @@ class RD_CORE_API LifetimeDefinition bool is_eternal() const; - void terminate() const; + void terminate(); template static auto use(F&& block) -> typename util::result_of_t @@ -56,4 +58,6 @@ class RD_CORE_API LifetimeDefinition }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_CORE_LIFETIME_DEFINITION_H diff --git a/rd-cpp/src/rd_core_cpp/src/main/lifetime/LifetimeImpl.h b/rd-cpp/src/rd_core_cpp/src/main/lifetime/LifetimeImpl.h index 37ce81890..d62a1352e 100644 --- a/rd-cpp/src/rd_core_cpp/src/main/lifetime/LifetimeImpl.h +++ b/rd-cpp/src/rd_core_cpp/src/main/lifetime/LifetimeImpl.h @@ -14,6 +14,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { class RD_CORE_API LifetimeImpl final @@ -96,4 +98,6 @@ class RD_CORE_API LifetimeImpl final }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_CORE_LIFETIME_H diff --git a/rd-cpp/src/rd_core_cpp/src/main/lifetime/SequentialLifetimes.h b/rd-cpp/src/rd_core_cpp/src/main/lifetime/SequentialLifetimes.h index 828ac0669..b909ed9cb 100644 --- a/rd-cpp/src/rd_core_cpp/src/main/lifetime/SequentialLifetimes.h +++ b/rd-cpp/src/rd_core_cpp/src/main/lifetime/SequentialLifetimes.h @@ -6,6 +6,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { class RD_CORE_API SequentialLifetimes @@ -39,4 +41,6 @@ class RD_CORE_API SequentialLifetimes }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_CORE_SEQUENTIAL_LIFETIMES_H diff --git a/rd-cpp/src/rd_core_cpp/src/main/util/export_api_helper.h b/rd-cpp/src/rd_core_cpp/src/main/util/export_api_helper.h new file mode 100644 index 000000000..1b533cf30 --- /dev/null +++ b/rd-cpp/src/rd_core_cpp/src/main/util/export_api_helper.h @@ -0,0 +1,15 @@ +#ifndef EXPORT_API_HELPER_H +#define EXPORT_API_HELPER_H + +#if defined(_MSC_VER) +#define RD_PUSH_STL_EXPORTS_WARNINGS \ + _Pragma("warning(push)") \ + _Pragma("warning(disable:4251)") +#define RD_POP_STL_EXPORTS_WARNINGS \ + _Pragma("warning(pop)") +#else +#define RD_PUSH_STL_EXPORTS_WARNINGS +#define RD_POP_STL_EXPORTS_WARNINGS +#endif + +#endif //EXPORT_API_HELPER_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/CMakeLists.txt b/rd-cpp/src/rd_framework_cpp/src/main/CMakeLists.txt index ce11672a4..171991068 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/CMakeLists.txt +++ b/rd-cpp/src/rd_framework_cpp/src/main/CMakeLists.txt @@ -73,10 +73,14 @@ else () add_library(rd_framework_cpp SHARED ${RD_FRAMEWORK_CPP_SOURCES}) endif () +set(RD_FRAMEWORK_EXPORT_HEADER_CUSTOM_CONTENT "#include \"util/export_api_helper.h\"") + include(GenerateExportHeader) generate_export_header(rd_framework_cpp BASE_NAME rd_framework - EXPORT_MACRO_NAME RD_FRAMEWORK_API) + EXPORT_MACRO_NAME RD_FRAMEWORK_API + CUSTOM_CONTENT_FROM_VARIABLE RD_FRAMEWORK_EXPORT_HEADER_CUSTOM_CONTENT +) message(STATUS "Using pch by rd_framework: '${ENABLE_PCH_HEADERS}'") diff --git a/rd-cpp/src/rd_framework_cpp/src/main/base/IProtocol.h b/rd-cpp/src/rd_framework_cpp/src/main/base/IProtocol.h index 43f3645f5..590c3933b 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/base/IProtocol.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/base/IProtocol.h @@ -11,6 +11,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { // region predeclared @@ -63,4 +65,6 @@ class RD_FRAMEWORK_API IProtocol : public IRdDynamic }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_IPROTOCOL_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/base/ISerializersOwner.h b/rd-cpp/src/rd_framework_cpp/src/main/base/ISerializersOwner.h index 74bf5ac37..5e758301a 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/base/ISerializersOwner.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/base/ISerializersOwner.h @@ -5,6 +5,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { // region predeclared @@ -28,4 +30,6 @@ class RD_FRAMEWORK_API ISerializersOwner }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_ISERIALIZERSOWNER_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/base/IWire.h b/rd-cpp/src/rd_framework_cpp/src/main/base/IWire.h index b646da760..7db2a5f78 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/base/IWire.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/base/IWire.h @@ -7,6 +7,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { /** @@ -44,4 +46,6 @@ class RD_FRAMEWORK_API IWire }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_IWIRE_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/base/RdBindableBase.h b/rd-cpp/src/rd_framework_cpp/src/main/base/RdBindableBase.h index 98d5e4d76..9cd67a20b 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/base/RdBindableBase.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/base/RdBindableBase.h @@ -8,6 +8,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { class RD_FRAMEWORK_API RdBindableBase : public virtual IRdBindable /*, IPrintable*/ @@ -113,4 +115,6 @@ T& withIdFromName(T& that, std::string const& name) } } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_RDBINDABLEBASE_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/ext/ExtWire.h b/rd-cpp/src/rd_framework_cpp/src/main/ext/ExtWire.h index 0833aeb24..ec6bd69d8 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/ext/ExtWire.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/ext/ExtWire.h @@ -11,6 +11,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { class RD_FRAMEWORK_API ExtWire final : public IWire @@ -30,4 +32,6 @@ class RD_FRAMEWORK_API ExtWire final : public IWire }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_EXTWIRE_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/ext/RdExtBase.h b/rd-cpp/src/rd_framework_cpp/src/main/ext/RdExtBase.h index 02f78031f..9de7e2429 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/ext/RdExtBase.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/ext/RdExtBase.h @@ -8,6 +8,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { /** @@ -55,4 +57,6 @@ class RD_FRAMEWORK_API RdExtBase : public RdReactiveBase std::string to_string(RdExtBase::ExtState state); } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_RDEXTBASE_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/impl/RName.h b/rd-cpp/src/rd_framework_cpp/src/main/impl/RName.h index 0ddc806ab..ff59839e0 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/impl/RName.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/impl/RName.h @@ -6,6 +6,8 @@ #include #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { class RNameImpl; @@ -47,4 +49,6 @@ class RD_FRAMEWORK_API RName }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_FRAMEWORK_RNAME_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/intern/InternRoot.h b/rd-cpp/src/rd_framework_cpp/src/main/intern/InternRoot.h index 983aad27d..552656fea 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/intern/InternRoot.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/intern/InternRoot.h @@ -16,6 +16,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { // region predeclared @@ -126,4 +128,6 @@ int32_t InternRoot::intern_value(Wrapper value) const } } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_INTERNROOT_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/protocol/Buffer.h b/rd-cpp/src/rd_framework_cpp/src/main/protocol/Buffer.h index e05d148be..10b4e8261 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/protocol/Buffer.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/protocol/Buffer.h @@ -15,6 +15,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { /** @@ -322,4 +324,6 @@ class RD_FRAMEWORK_API Buffer final }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_UNSAFEBUFFER_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/protocol/Identities.h b/rd-cpp/src/rd_framework_cpp/src/main/protocol/Identities.h index eddb2082c..df2f44bcd 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/protocol/Identities.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/protocol/Identities.h @@ -7,6 +7,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { /** @@ -47,4 +49,6 @@ class RD_FRAMEWORK_API Identities }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_FRAMEWORK_IDENTITIES_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/protocol/MessageBroker.h b/rd-cpp/src/rd_framework_cpp/src/main/protocol/MessageBroker.h index 3e5bbccc8..10282c397 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/protocol/MessageBroker.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/protocol/MessageBroker.h @@ -11,6 +11,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { class RD_FRAMEWORK_API Mq @@ -58,4 +60,6 @@ class RD_FRAMEWORK_API MessageBroker final }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_MESSAGEBROKER_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/protocol/Protocol.h b/rd-cpp/src/rd_framework_cpp/src/main/protocol/Protocol.h index 6bda3627c..dc90ce6a9 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/protocol/Protocol.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/protocol/Protocol.h @@ -9,6 +9,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { // region predeclared @@ -55,4 +57,6 @@ class RD_FRAMEWORK_API Protocol : /*IRdDynamic, */ public IProtocol }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_PROTOCOL_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/scheduler/base/IScheduler.h b/rd-cpp/src/rd_framework_cpp/src/main/scheduler/base/IScheduler.h index 25ecd8779..cb7132174 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/scheduler/base/IScheduler.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/scheduler/base/IScheduler.h @@ -6,6 +6,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { /** @@ -53,4 +55,6 @@ class RD_FRAMEWORK_API IScheduler }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_ISCHEDULER_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/scheduler/base/SingleThreadSchedulerBase.h b/rd-cpp/src/rd_framework_cpp/src/main/scheduler/base/SingleThreadSchedulerBase.h index 32c7e2848..7364e1c84 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/scheduler/base/SingleThreadSchedulerBase.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/scheduler/base/SingleThreadSchedulerBase.h @@ -9,6 +9,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace ctpl { class thread_pool; @@ -52,4 +54,6 @@ class RD_FRAMEWORK_API SingleThreadSchedulerBase : public IScheduler }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_SINGLETHREADSCHEDULERBASE_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/serialization/SerializationCtx.h b/rd-cpp/src/rd_framework_cpp/src/main/serialization/SerializationCtx.h index 0c5597484..69941ac5f 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/serialization/SerializationCtx.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/serialization/SerializationCtx.h @@ -13,6 +13,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { // region predeclared @@ -101,4 +103,6 @@ void SerializationCtx::writeInterned(Buffer& buffer, const Wrapper& value, F& } } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_FRAMEWORK_SERIALIZATIONCTX_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/serialization/Serializers.h b/rd-cpp/src/rd_framework_cpp/src/main/serialization/Serializers.h index 83c11b081..c9b42cc3b 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/serialization/Serializers.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/serialization/Serializers.h @@ -17,6 +17,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { // region predeclared @@ -146,4 +148,6 @@ void Serializers::writePolymorphic(SerializationCtx& ctx, Buffer& stream, T cons } } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_SERIALIZERS_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/wire/ByteBufferAsyncProcessor.h b/rd-cpp/src/rd_framework_cpp/src/main/wire/ByteBufferAsyncProcessor.h index 3f24c9efc..effbace0a 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/wire/ByteBufferAsyncProcessor.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/wire/ByteBufferAsyncProcessor.h @@ -13,6 +13,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { using sequence_number_t = int64_t; @@ -99,4 +101,6 @@ class RD_FRAMEWORK_API ByteBufferAsyncProcessor std::string to_string(ByteBufferAsyncProcessor::StateKind state); } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_BYTEBUFFERASYNCPROCESSOR_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/wire/PkgInputStream.h b/rd-cpp/src/rd_framework_cpp/src/main/wire/PkgInputStream.h index d0bacb87e..a6deaa875 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/wire/PkgInputStream.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/wire/PkgInputStream.h @@ -5,6 +5,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { class RD_FRAMEWORK_API PkgInputStream @@ -49,4 +51,6 @@ class RD_FRAMEWORK_API PkgInputStream }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_PKGINPUTSTREAM_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/wire/PumpScheduler.h b/rd-cpp/src/rd_framework_cpp/src/main/wire/PumpScheduler.h index bc3379fda..d25db4695 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/wire/PumpScheduler.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/wire/PumpScheduler.h @@ -10,6 +10,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + namespace rd { namespace test @@ -50,4 +52,6 @@ class RD_FRAMEWORK_API PumpScheduler : public IScheduler } // namespace test } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_PUMPSCHEDULER_H diff --git a/rd-cpp/src/rd_framework_cpp/src/main/wire/SocketWire.h b/rd-cpp/src/rd_framework_cpp/src/main/wire/SocketWire.h index e71fe76cb..87584d5c5 100644 --- a/rd-cpp/src/rd_framework_cpp/src/main/wire/SocketWire.h +++ b/rd-cpp/src/rd_framework_cpp/src/main/wire/SocketWire.h @@ -12,6 +12,8 @@ #include +RD_PUSH_STL_EXPORTS_WARNINGS + class CSimpleSocket; class CActiveSocket; class CPassiveSocket; @@ -171,4 +173,6 @@ class RD_FRAMEWORK_API SocketWire }; } // namespace rd +RD_POP_STL_EXPORTS_WARNINGS + #endif // RD_CPP_SOCKETWIRE_H diff --git a/rd-cpp/thirdparty/CMakeLists.txt b/rd-cpp/thirdparty/CMakeLists.txt index 455c32496..8664719a0 100644 --- a/rd-cpp/thirdparty/CMakeLists.txt +++ b/rd-cpp/thirdparty/CMakeLists.txt @@ -6,7 +6,11 @@ set_property(TARGET clsocket PROPERTY POSITION_INDEPENDENT_CODE ON) add_subdirectory(countdownlatch) add_subdirectory(string-view-lite) add_subdirectory(CTPL) -set(SPDLOG_BUILD_SHARED ON CACHE BOOL "Build shared library" FORCE) +if (NOT RD_STATIC) + set(SPDLOG_BUILD_SHARED ON CACHE BOOL "Build shared library" FORCE) +else() + set(SPDLOG_BUILD_SHARED OFF CACHE BOOL "Build shared library" FORCE) +endif () add_subdirectory(spdlog) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/spdlog/include/