Skip to content

Commit

Permalink
Returned code to disable 4252 warning because of problems with Unreal…
Browse files Browse the repository at this point in the history
…Link build. Made spdlog static lib for RD_STATIC build.
  • Loading branch information
mirasrael committed Dec 19, 2023
1 parent 6c204c7 commit e9f12fc
Show file tree
Hide file tree
Showing 31 changed files with 131 additions and 7 deletions.
2 changes: 2 additions & 0 deletions rd-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 0 additions & 2 deletions rd-cpp/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 6 additions & 1 deletion rd-cpp/src/rd_core_cpp/src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}'")

Expand Down
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_core_cpp/src/main/lifetime/Lifetime.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include <rd_core_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
class Lifetime;
Expand Down Expand Up @@ -64,4 +66,6 @@ inline size_t hash<Lifetime>::operator()(const Lifetime& value) const noexcept
}
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_CORE_LIFETIMEWRAPPER_H
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ bool LifetimeDefinition::is_terminated() const
return lifetime->is_terminated();
}

void LifetimeDefinition::terminate() const
void LifetimeDefinition::terminate()
{
lifetime->terminate();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include <rd_core_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
class RD_CORE_API LifetimeDefinition
Expand Down Expand Up @@ -44,7 +46,7 @@ class RD_CORE_API LifetimeDefinition

bool is_eternal() const;

void terminate() const;
void terminate();

template <typename F>
static auto use(F&& block) -> typename util::result_of_t<F(Lifetime)>
Expand All @@ -56,4 +58,6 @@ class RD_CORE_API LifetimeDefinition
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_CORE_LIFETIME_DEFINITION_H
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_core_cpp/src/main/lifetime/LifetimeImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include <rd_core_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
class RD_CORE_API LifetimeImpl final
Expand Down Expand Up @@ -96,4 +98,6 @@ class RD_CORE_API LifetimeImpl final
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_CORE_LIFETIME_H
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include <rd_core_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
class RD_CORE_API SequentialLifetimes
Expand Down Expand Up @@ -39,4 +41,6 @@ class RD_CORE_API SequentialLifetimes
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_CORE_SEQUENTIAL_LIFETIMES_H
15 changes: 15 additions & 0 deletions rd-cpp/src/rd_core_cpp/src/main/util/export_api_helper.h
Original file line number Diff line number Diff line change
@@ -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
6 changes: 5 additions & 1 deletion rd-cpp/src/rd_framework_cpp/src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}'")

Expand Down
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_framework_cpp/src/main/base/IProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
// region predeclared
Expand Down Expand Up @@ -63,4 +65,6 @@ class RD_FRAMEWORK_API IProtocol : public IRdDynamic
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_IPROTOCOL_H
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_framework_cpp/src/main/base/ISerializersOwner.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
// region predeclared
Expand All @@ -28,4 +30,6 @@ class RD_FRAMEWORK_API ISerializersOwner
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_ISERIALIZERSOWNER_H
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_framework_cpp/src/main/base/IWire.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
/**
Expand Down Expand Up @@ -44,4 +46,6 @@ class RD_FRAMEWORK_API IWire
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_IWIRE_H
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_framework_cpp/src/main/base/RdBindableBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
class RD_FRAMEWORK_API RdBindableBase : public virtual IRdBindable /*, IPrintable*/
Expand Down Expand Up @@ -113,4 +115,6 @@ T& withIdFromName(T& that, std::string const& name)
}
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_RDBINDABLEBASE_H
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_framework_cpp/src/main/ext/ExtWire.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
class RD_FRAMEWORK_API ExtWire final : public IWire
Expand All @@ -30,4 +32,6 @@ class RD_FRAMEWORK_API ExtWire final : public IWire
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_EXTWIRE_H
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_framework_cpp/src/main/ext/RdExtBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
/**
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_framework_cpp/src/main/impl/RName.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <string>
#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
class RNameImpl;
Expand Down Expand Up @@ -47,4 +49,6 @@ class RD_FRAMEWORK_API RName
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_FRAMEWORK_RNAME_H
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_framework_cpp/src/main/intern/InternRoot.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
// region predeclared
Expand Down Expand Up @@ -126,4 +128,6 @@ int32_t InternRoot::intern_value(Wrapper<T> value) const
}
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_INTERNROOT_H
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_framework_cpp/src/main/protocol/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
/**
Expand Down Expand Up @@ -322,4 +324,6 @@ class RD_FRAMEWORK_API Buffer final
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_UNSAFEBUFFER_H
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_framework_cpp/src/main/protocol/Identities.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
/**
Expand Down Expand Up @@ -47,4 +49,6 @@ class RD_FRAMEWORK_API Identities
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_FRAMEWORK_IDENTITIES_H
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_framework_cpp/src/main/protocol/MessageBroker.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
class RD_FRAMEWORK_API Mq
Expand Down Expand Up @@ -58,4 +60,6 @@ class RD_FRAMEWORK_API MessageBroker final
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_MESSAGEBROKER_H
4 changes: 4 additions & 0 deletions rd-cpp/src/rd_framework_cpp/src/main/protocol/Protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
// region predeclared
Expand Down Expand Up @@ -55,4 +57,6 @@ class RD_FRAMEWORK_API Protocol : /*IRdDynamic, */ public IProtocol
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_PROTOCOL_H
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
/**
Expand Down Expand Up @@ -53,4 +55,6 @@ class RD_FRAMEWORK_API IScheduler
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_ISCHEDULER_H
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace ctpl
{
class thread_pool;
Expand Down Expand Up @@ -52,4 +54,6 @@ class RD_FRAMEWORK_API SingleThreadSchedulerBase : public IScheduler
};
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_SINGLETHREADSCHEDULERBASE_H
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

#include <rd_framework_export.h>

RD_PUSH_STL_EXPORTS_WARNINGS

namespace rd
{
// region predeclared
Expand Down Expand Up @@ -101,4 +103,6 @@ void SerializationCtx::writeInterned(Buffer& buffer, const Wrapper<T>& value, F&
}
} // namespace rd

RD_POP_STL_EXPORTS_WARNINGS

#endif // RD_CPP_FRAMEWORK_SERIALIZATIONCTX_H
Loading

0 comments on commit e9f12fc

Please sign in to comment.