mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-11-27 05:16:18 +08:00
Feature/shared exports msvc (#525)
This commit is contained in:
@@ -64,4 +64,39 @@ jobs:
|
||||
./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=canada >> $GITHUB_STEP_SUMMARY
|
||||
./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=licenses >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
windows-msvc-shared:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
format: ["JSON", "AVRO", "CAPNPROTO", "CBOR", "FLEXBUFFERS", "MSGPACK", "PARQUET", "TOML", "UBJSON", "XML", "YAML"]
|
||||
name: "windows-msvc-shared (${{ matrix.format }})"
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
- name: Export GitHub Actions cache environment variables
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
||||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
- uses: lukka/run-vcpkg@v11
|
||||
- name: Compile tests (JSON)
|
||||
if: matrix.format == 'JSON'
|
||||
run: |
|
||||
cmake -S . -B build -DREFLECTCPP_BUILD_SHARED=ON -DCMAKE_CXX_STANDARD=20 -DREFLECTCPP_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build --config Release -j4
|
||||
- name: Compile tests (Other formats)
|
||||
if: matrix.format != 'JSON'
|
||||
run: |
|
||||
cmake -S . -B build -DREFLECTCPP_BUILD_SHARED=ON -DCMAKE_CXX_STANDARD=20 -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_JSON=OFF -DREFLECTCPP_${{ matrix.format }}=ON -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build --config Release -j4
|
||||
- name: Run tests
|
||||
run: |
|
||||
ctest --test-dir build --output-on-failure
|
||||
|
||||
|
||||
+30
-2
@@ -179,6 +179,19 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
if(REFLECTCPP_BUILD_SHARED AND REFLECTCPP_USE_BUNDLED_DEPENDENCIES AND _REFLECTCPP_NEEDS_JSON_IMPL)
|
||||
target_compile_definitions(reflectcpp
|
||||
PRIVATE
|
||||
YYJSON_EXPORTS
|
||||
INTERFACE
|
||||
YYJSON_IMPORTS
|
||||
)
|
||||
endif()
|
||||
|
||||
if(REFLECTCPP_BUILD_SHARED)
|
||||
target_compile_definitions(reflectcpp PUBLIC RFL_BUILD_SHARED)
|
||||
endif()
|
||||
|
||||
if(REFLECTCPP_USE_STD_EXPECTED)
|
||||
target_compile_definitions(reflectcpp PUBLIC REFLECTCPP_USE_STD_EXPECTED)
|
||||
endif()
|
||||
@@ -232,7 +245,20 @@ if (REFLECTCPP_AVRO)
|
||||
if (REFLECTCPP_USE_VCPKG)
|
||||
target_include_directories(reflectcpp SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
if (MSVC)
|
||||
target_link_libraries(reflectcpp PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/avro${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
set(_AVRO_STATIC_LIB "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/avro${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
if(REFLECTCPP_BUILD_SHARED)
|
||||
message(STATUS "With whole archive ${_AVRO_STATIC_LIB}")
|
||||
target_link_libraries(reflectcpp
|
||||
PUBLIC
|
||||
$<LINK_LIBRARY:WHOLE_ARCHIVE,${_AVRO_STATIC_LIB}>
|
||||
"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/snappy${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/lzma${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/jansson${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/zlib${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
)
|
||||
else()
|
||||
target_link_libraries(reflectcpp PUBLIC "${_AVRO_STATIC_LIB}")
|
||||
endif()
|
||||
else ()
|
||||
target_link_libraries(reflectcpp PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libavro${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
endif ()
|
||||
@@ -370,9 +396,11 @@ target_sources(reflectcpp PRIVATE ${REFLECT_CPP_SOURCES})
|
||||
target_precompile_headers(reflectcpp PRIVATE [["rfl.hpp"]] <iostream> <string> <functional>)
|
||||
|
||||
if (REFLECTCPP_BUILD_TESTS)
|
||||
add_library(reflectcpp_tests_crt INTERFACE)
|
||||
target_link_libraries(reflectcpp_tests_crt INTERFACE reflectcpp GTest::gtest_main)
|
||||
|
||||
enable_testing()
|
||||
find_package(GTest CONFIG REQUIRED)
|
||||
set(REFLECT_CPP_GTEST_LIB reflectcpp GTest::gtest_main)
|
||||
add_subdirectory(tests)
|
||||
endif ()
|
||||
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
#include "Object.hpp"
|
||||
#include "Result.hpp"
|
||||
#include "Variant.hpp"
|
||||
#include "common.hpp"
|
||||
|
||||
namespace rfl {
|
||||
|
||||
class Generic {
|
||||
class RFL_API Generic {
|
||||
public:
|
||||
constexpr static std::nullopt_t Null = std::nullopt;
|
||||
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
|
||||
//#include "../Box.hpp"
|
||||
//#include "../Result.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl::avro {
|
||||
|
||||
class SchemaImpl {
|
||||
class RFL_API SchemaImpl {
|
||||
public:
|
||||
SchemaImpl(const std::string& _json_str);
|
||||
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
#include "../Vectorstring.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../internal/is_literal.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl::avro {
|
||||
|
||||
class Writer {
|
||||
class RFL_API Writer {
|
||||
public:
|
||||
struct AVROOutputArray {
|
||||
avro_value_t val_;
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
#include "../../Ref.hpp"
|
||||
#include "../../Rename.hpp"
|
||||
#include "../../Variant.hpp"
|
||||
#include "../../common.hpp"
|
||||
|
||||
namespace rfl::avro::schema {
|
||||
|
||||
struct Type {
|
||||
struct RFL_API Type {
|
||||
struct Null {
|
||||
Literal<"null"> type{};
|
||||
};
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
#include "Schema.hpp"
|
||||
#include "Writer.hpp"
|
||||
//#include "schema/Type.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl::avro {
|
||||
|
||||
std::string to_json_representation(
|
||||
RFL_API std::string to_json_representation(
|
||||
const parsing::schema::Definition& internal_schema);
|
||||
|
||||
/// Returns the Avro schema for a class.
|
||||
|
||||
@@ -17,12 +17,13 @@
|
||||
#include "../Vectorstring.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../internal/ptr_cast.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl {
|
||||
namespace bson {
|
||||
|
||||
/// Please refer to https://mongoc.org/libbson/current/api.html
|
||||
class Writer {
|
||||
class RFL_API Writer {
|
||||
struct BSONType {
|
||||
bson_t val_;
|
||||
};
|
||||
|
||||
@@ -13,10 +13,11 @@
|
||||
#include "../always_false.hpp"
|
||||
#include "../internal/is_literal.hpp"
|
||||
#include "../internal/ptr_cast.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl::capnproto {
|
||||
|
||||
class Reader {
|
||||
class RFL_API Reader {
|
||||
public:
|
||||
struct CapNProtoInputArray {
|
||||
capnp::DynamicList::Reader val_;
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
|
||||
//#include "../Box.hpp"
|
||||
//#include "../Result.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl::capnproto {
|
||||
|
||||
class SchemaImpl {
|
||||
class RFL_API SchemaImpl {
|
||||
public:
|
||||
SchemaImpl(const std::string& _str);
|
||||
|
||||
|
||||
@@ -18,10 +18,11 @@
|
||||
#include "../always_false.hpp"
|
||||
#include "../internal/is_literal.hpp"
|
||||
//#include "../internal/ptr_cast.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl::capnproto {
|
||||
|
||||
class Writer {
|
||||
class RFL_API Writer {
|
||||
public:
|
||||
struct CapnProtoOutputArray {
|
||||
capnp::DynamicList::Builder val_;
|
||||
|
||||
@@ -9,10 +9,11 @@
|
||||
#include "../../Ref.hpp"
|
||||
//#include "../../Rename.hpp"
|
||||
#include "../../Variant.hpp"
|
||||
#include "../../common.hpp"
|
||||
|
||||
namespace rfl::capnproto::schema {
|
||||
|
||||
struct Type {
|
||||
struct RFL_API Type {
|
||||
struct Void {};
|
||||
|
||||
struct Bool {};
|
||||
|
||||
@@ -16,10 +16,11 @@
|
||||
#include "Writer.hpp"
|
||||
#include "Reader.hpp"
|
||||
//#include "schema/Type.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl::capnproto {
|
||||
|
||||
std::string to_string_representation(
|
||||
RFL_API std::string to_string_representation(
|
||||
const parsing::schema::Definition& internal_schema);
|
||||
|
||||
/// This ensures that the schema is only generated once.
|
||||
|
||||
@@ -12,10 +12,11 @@
|
||||
//#include "../Result.hpp"
|
||||
#include "../Vectorstring.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl::cbor {
|
||||
|
||||
class Writer {
|
||||
class RFL_API Writer {
|
||||
using Encoder = jsoncons::cbor::cbor_bytes_encoder;
|
||||
|
||||
public:
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef RFL_COMMON_HPP_
|
||||
#define RFL_COMMON_HPP_
|
||||
|
||||
|
||||
#ifdef RFL_BUILD_SHARED
|
||||
#ifdef _WIN32
|
||||
#ifdef reflectcpp_EXPORTS
|
||||
#define RFL_API __declspec(dllexport)
|
||||
#else
|
||||
#define RFL_API __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define RFL_API __attribute__((visibility("default")))
|
||||
#endif
|
||||
#else
|
||||
#define RFL_API
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -13,11 +13,12 @@
|
||||
//#include "../Result.hpp"
|
||||
#include "../Vectorstring.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl {
|
||||
namespace flexbuf {
|
||||
|
||||
struct Writer {
|
||||
struct RFL_API Writer {
|
||||
struct OutputArray {
|
||||
size_t start_;
|
||||
};
|
||||
|
||||
@@ -9,10 +9,11 @@
|
||||
|
||||
#include "../Generic.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl::generic {
|
||||
|
||||
struct Writer {
|
||||
struct RFL_API Writer {
|
||||
struct OutputArray {
|
||||
Generic::Array* val_;
|
||||
};
|
||||
|
||||
@@ -4,25 +4,27 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "../../common.hpp"
|
||||
|
||||
namespace rfl::internal::strings {
|
||||
|
||||
/// Joins a series of strings.
|
||||
std::string join(const std::string& _delimiter,
|
||||
RFL_API std::string join(const std::string& _delimiter,
|
||||
const std::vector<std::string>& _strings);
|
||||
|
||||
/// Replace all occurences of _from with _to.
|
||||
std::string replace_all(const std::string& _str, const std::string& _from,
|
||||
RFL_API std::string replace_all(const std::string& _str, const std::string& _from,
|
||||
const std::string& _to);
|
||||
|
||||
/// Splits _str along _delimiter.
|
||||
std::vector<std::string> split(const std::string& _str,
|
||||
RFL_API std::vector<std::string> split(const std::string& _str,
|
||||
const std::string& _delimiter);
|
||||
|
||||
/// Transforms the string to camel case.
|
||||
std::string to_camel_case(const std::string& _str);
|
||||
RFL_API std::string to_camel_case(const std::string& _str);
|
||||
|
||||
/// Transforms the string to pascal case.
|
||||
std::string to_pascal_case(const std::string& _str);
|
||||
RFL_API std::string to_pascal_case(const std::string& _str);
|
||||
|
||||
} // namespace rfl::internal::strings
|
||||
|
||||
|
||||
@@ -13,11 +13,12 @@
|
||||
|
||||
//#include "../Result.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl {
|
||||
namespace json {
|
||||
|
||||
class Writer {
|
||||
class RFL_API Writer {
|
||||
public:
|
||||
struct YYJSONOutputArray {
|
||||
YYJSONOutputArray(yyjson_mut_val* _val) : val_(_val) {}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "schema/JSONSchema.hpp"
|
||||
// #include "schema/Type.hpp"
|
||||
// #include "write.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl::json {
|
||||
|
||||
@@ -31,7 +32,7 @@ struct TypeHelper<rfl::Variant<Ts...>> {
|
||||
using JSONSchemaType = rfl::Variant<schema::JSONSchema<Ts>...>;
|
||||
};
|
||||
|
||||
std::string to_schema_internal_schema(
|
||||
RFL_API std::string to_schema_internal_schema(
|
||||
const parsing::schema::Definition& internal_schema, const yyjson_write_flag,
|
||||
const bool _no_required, const std::string& comment = "");
|
||||
|
||||
|
||||
@@ -13,10 +13,11 @@
|
||||
//#include "../Result.hpp"
|
||||
#include "../Vectorstring.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl::msgpack {
|
||||
|
||||
class Writer {
|
||||
class RFL_API Writer {
|
||||
public:
|
||||
struct MsgpackOutputArray {};
|
||||
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
#include "../../Ref.hpp"
|
||||
#include "../../Variant.hpp"
|
||||
#include "ValidationType.hpp"
|
||||
#include "../../common.hpp"
|
||||
|
||||
namespace rfl::parsing::schema {
|
||||
|
||||
struct Type {
|
||||
struct RFL_API Type {
|
||||
struct Boolean {};
|
||||
|
||||
struct Bytestring {};
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
#define RFL_PARSING_SCHEMAFUL_TUPLETOOBJECT_HPP_
|
||||
|
||||
#include "../schema/Type.hpp"
|
||||
#include "../../common.hpp"
|
||||
|
||||
namespace rfl::parsing::schemaful {
|
||||
|
||||
/// Schemaful formats often don't have an explicit tuple representation.
|
||||
/// This is the required workaround.
|
||||
schema::Type::Object tuple_to_object(const schema::Type::Tuple& _tup);
|
||||
RFL_API schema::Type::Object tuple_to_object(const schema::Type::Tuple& _tup);
|
||||
|
||||
} // namespace rfl::parsing::schemaful
|
||||
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
#include "../Ref.hpp"
|
||||
#include "../Result.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl::toml {
|
||||
|
||||
class Writer {
|
||||
class RFL_API Writer {
|
||||
public:
|
||||
struct TOMLArray {
|
||||
::toml::array* val_;
|
||||
|
||||
@@ -16,10 +16,11 @@
|
||||
#include "../Result.hpp"
|
||||
#include "../Vectorstring.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl::ubjson {
|
||||
|
||||
class Writer {
|
||||
class RFL_API Writer {
|
||||
using Encoder = jsoncons::ubjson::ubjson_bytes_encoder;
|
||||
|
||||
public:
|
||||
|
||||
@@ -8,11 +8,12 @@
|
||||
|
||||
#include "../Ref.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl {
|
||||
namespace xml {
|
||||
|
||||
struct Writer {
|
||||
struct RFL_API Writer {
|
||||
struct XMLOutputArray {
|
||||
XMLOutputArray(const std::string_view& _name,
|
||||
const Ref<pugi::xml_node>& _node)
|
||||
|
||||
@@ -9,11 +9,12 @@
|
||||
|
||||
#include "../Ref.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../common.hpp"
|
||||
|
||||
namespace rfl {
|
||||
namespace yaml {
|
||||
|
||||
class Writer {
|
||||
class RFL_API Writer {
|
||||
public:
|
||||
struct YAMLArray {};
|
||||
|
||||
|
||||
@@ -9,10 +9,11 @@ add_executable(
|
||||
target_precompile_headers(reflect-cpp-avro-tests PRIVATE [["rfl.hpp"]] <iostream> <string> <functional> <gtest/gtest.h>)
|
||||
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-avro-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-avro-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-avro-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-avro-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-avro-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -10,10 +10,11 @@ target_precompile_headers(reflect-cpp-bson-tests PRIVATE [["rfl.hpp"]] <iostream
|
||||
|
||||
target_include_directories(reflect-cpp-bson-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-bson-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-bson-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-bson-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-bson-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-bson-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -9,10 +9,11 @@ add_executable(
|
||||
target_precompile_headers(reflect-cpp-capnproto-tests PRIVATE [["rfl.hpp"]] <iostream> <string> <functional> <gtest/gtest.h>)
|
||||
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-capnproto-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-capnproto-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-capnproto-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-capnproto-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-capnproto-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -8,10 +8,11 @@ add_executable(
|
||||
)
|
||||
target_precompile_headers(reflect-cpp-cbor-tests PRIVATE [["rfl.hpp"]] <iostream> <string> <functional> <gtest/gtest.h>)
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-cbor-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-cbor-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-cbor-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-cbor-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-cbor-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -10,10 +10,11 @@ target_precompile_headers(reflect-cpp-csv-tests PRIVATE [["rfl.hpp"]] <iostream>
|
||||
|
||||
target_include_directories(reflect-cpp-csv-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-csv-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-csv-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-csv-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-csv-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-csv-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -10,10 +10,11 @@ target_precompile_headers(reflect-cpp-flexbuffers-tests PRIVATE [["rfl.hpp"]] <i
|
||||
|
||||
target_include_directories(reflect-cpp-flexbuffers-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-flexbuffers-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-flexbuffers-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-flexbuffers-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-flexbuffers-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-flexbuffers-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -9,10 +9,11 @@ add_executable(
|
||||
|
||||
target_include_directories(reflect-cpp-generic-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-generic-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-generic-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-generic-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-generic-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-generic-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -10,10 +10,11 @@ target_precompile_headers(reflect-cpp-json-tests PRIVATE [["rfl.hpp"]] <iostream
|
||||
|
||||
target_include_directories(reflect-cpp-json-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-json-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-json-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-json-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-json-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-json-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -13,10 +13,11 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DREFLECT_CPP_C_ARRAYS_OR_INHERITANCE")
|
||||
|
||||
target_include_directories(reflect-cpp-json-c-arrays-and-inheritance-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-json-c-arrays-and-inheritance-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-json-c-arrays-and-inheritance-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-json-c-arrays-and-inheritance-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-json-c-arrays-and-inheritance-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-json-c-arrays-and-inheritance-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -10,10 +10,11 @@ target_precompile_headers(reflect-cpp-msgpack-tests PRIVATE [["rfl.hpp"]] <iostr
|
||||
|
||||
target_include_directories(reflect-cpp-msgpack-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-msgpack-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-msgpack-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-msgpack-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-msgpack-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-msgpack-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -10,10 +10,11 @@ target_precompile_headers(reflect-cpp-parquet-tests PRIVATE [["rfl.hpp"]] <iostr
|
||||
|
||||
target_include_directories(reflect-cpp-parquet-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-parquet-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-parquet-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-parquet-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-parquet-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-parquet-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -8,10 +8,11 @@ add_executable(
|
||||
)
|
||||
target_precompile_headers(reflect-cpp-toml-tests PRIVATE [["rfl.hpp"]] <iostream> <string> <functional> <gtest/gtest.h>)
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-toml-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-toml-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-toml-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-toml-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-toml-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -8,10 +8,11 @@ add_executable(
|
||||
)
|
||||
target_precompile_headers(reflect-cpp-ubjson-tests PRIVATE [["rfl.hpp"]] <iostream> <string> <functional> <gtest/gtest.h>)
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-ubjson-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-ubjson-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-ubjson-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-ubjson-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-ubjson-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -10,10 +10,11 @@ target_precompile_headers(reflect-cpp-xml-tests PRIVATE [["rfl.hpp"]] <iostream>
|
||||
|
||||
target_include_directories(reflect-cpp-xml-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-xml-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-xml-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-xml-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-xml-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-xml-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
@@ -10,10 +10,11 @@ target_precompile_headers(reflect-cpp-yaml-tests PRIVATE [["rfl.hpp"]] <iostream
|
||||
|
||||
target_include_directories(reflect-cpp-yaml-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-yaml-tests
|
||||
PRIVATE
|
||||
"${REFLECT_CPP_GTEST_LIB}"
|
||||
target_link_libraries(reflect-cpp-yaml-tests PRIVATE reflectcpp_tests_crt)
|
||||
|
||||
add_custom_command(TARGET reflect-cpp-yaml-tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:reflect-cpp-yaml-tests> $<TARGET_RUNTIME_DLLS:reflect-cpp-yaml-tests>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
Reference in New Issue
Block a user