diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-05-29 18:54:24 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-08-07 10:08:07 -0500 |
commit | 371353aa83f63de9239c4c754f4f24d52f676844 (patch) | |
tree | 11fa0f03c95c959532ae586e9f0f87760fafd450 /user/rttr | |
parent | f2853d4a02ececc95fe68f4d4957fca009c0d537 (diff) | |
download | packages-371353aa83f63de9239c4c754f4f24d52f676844.tar.gz packages-371353aa83f63de9239c4c754f4f24d52f676844.tar.bz2 packages-371353aa83f63de9239c4c754f4f24d52f676844.tar.xz packages-371353aa83f63de9239c4c754f4f24d52f676844.zip |
user/rttr: Bring upstream patches in for newer C++
Also, change the warnings we disable to ensure it builds with GCC 13.
Also, replaces '-Werror' with '-Wextra' for more verbosity without
causing the build to fail.
Closes: #1196
Diffstat (limited to 'user/rttr')
-rw-r--r-- | user/rttr/APKBUILD | 16 | ||||
-rw-r--r-- | user/rttr/clang.patch | 141 | ||||
-rw-r--r-- | user/rttr/gcc9.patch | 103 | ||||
-rw-r--r-- | user/rttr/header.patch | 21 | ||||
-rw-r--r-- | user/rttr/no-pessimising-moves.patch | 65 | ||||
-rw-r--r-- | user/rttr/show-warnings-not-error-out.patch | 16 |
6 files changed, 359 insertions, 3 deletions
diff --git a/user/rttr/APKBUILD b/user/rttr/APKBUILD index 58d0bb293..a4e5385db 100644 --- a/user/rttr/APKBUILD +++ b/user/rttr/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=rttr pkgver=0.9.6 -pkgrel=0 +pkgrel=1 pkgdesc="C++ reflection library" url=" " arch="all" @@ -15,6 +15,11 @@ source="https://github.com/rttrorg/rttr/releases/download/v$pkgver/rttr-$pkgver- dlclose-doesnt-work.patch install-doc.patch permissions.patch + header.patch + clang.patch + no-pessimising-moves.patch + gcc9.patch + show-warnings-not-error-out.patch " build() { @@ -26,7 +31,7 @@ build() { -DCMAKE_INSTALL_LIBDIR=lib \ -DBUILD_SHARED_LIBS=True \ -DCMAKE_BUILD_TYPE=RelWithDebugInfo \ - -DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-error=class-memaccess -DNDEBUG" \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-error=class-memaccess -Wno-deprecated-declarations -Wno-pessimizing-move -DNDEBUG" \ ${CMAKE_CROSSOPTS} . make } @@ -43,4 +48,9 @@ sha512sums="7e0d4fa87f83feda0b926d4d0e52aaf0f369f25fe7e23e5ffe86c0bba159e8353cef 559b4d55109b7021082cdd15663075312d80a896325db2b6bba43bf9d3ba17ecc2152aa30617f200be904351c7f8ba188b7e7a6b29a71612b42d48a5a0535aa7 arm64.patch 76efa45715d2a6459ae3cf5a6189de414775eed11a1f6780de563005765139ae6be86e30ead63b5ef8e9a5e84ba77a4ef2b7a75ded7506c6c8d81a696a887ff3 dlclose-doesnt-work.patch 825ca43fb35f6139db13f0b01818b49bb1556a1190ac2941c643e4d438c5b458883fa2ffb64d95625125c251632da7b3d8b703141335df8883b6e186f2e6a349 install-doc.patch -905e4c62093ee3877a8a15a1cbd4bc20499e04916ce869a495cf4ef9f47aa94d56aa5ac861d0ca8b6079f2a3b398f92237dc423e452130f7c40b9a170a8aa625 permissions.patch" +905e4c62093ee3877a8a15a1cbd4bc20499e04916ce869a495cf4ef9f47aa94d56aa5ac861d0ca8b6079f2a3b398f92237dc423e452130f7c40b9a170a8aa625 permissions.patch +75ff5e06f92c94db6b7c04846bfff1dcde22b81831a40ad7533cd93fc9ca300c76ca1266081ac4784bc3b94a8b805db28b841702b10d66232c1110d57c812245 header.patch +3bbdc8feb9b64b4a9f0db138ea0612e3e5a57004fda8b856c30a5f05824009543f396654c6ef3b6e157ce62c7057a239029dd35c749387d9ad91dcc4ac2c00e4 clang.patch +3e7f81db25f0af6a3924e693d30cb5895fbc13dd3eac752d66082ae34c08fc779de086764f63f52170399cb85c5cf87ef182bdc8d8f054fd7f085bc90e779dc8 no-pessimising-moves.patch +2dda29b06484bfad15fefe919bce30ab1b6a6f0b9aec10a09736e1018565151cb675874484b4bb573d27d0742fe5943e002074cfa9f822fc1d3888fd3c8a9dc0 gcc9.patch +f42539edff3b08cf2938a489a9163e3ab81fd43422de1b22a23bae8ef198554f46b5ded4e6f09fb2840fbdd711385563bedcdbb9238569ff7c9484b84eb7bc53 show-warnings-not-error-out.patch" diff --git a/user/rttr/clang.patch b/user/rttr/clang.patch new file mode 100644 index 000000000..9d1a5431b --- /dev/null +++ b/user/rttr/clang.patch @@ -0,0 +1,141 @@ +From 1a357c61e8bc75d6b1a6b8cc88142fbed25a70e9 Mon Sep 17 00:00:00 2001 +From: acki-m <acki-m@users.noreply.github.com> +Date: Fri, 14 Sep 2018 08:50:00 +0200 +Subject: [PATCH] Bugfix clang virtual override warning (#192) + +* fixed missing use of 'override' in classes that use RTTR_ENABLE + +following test case: + +struct s_base +{ +virtual ~s_base() = default; // always use virtual dtor in base class +RTTR_ENABLE() +}; + +struct s_derived : s_base +{ +~s_derived() override = default; +// Clang options require "override" on inherited virtual functions +RTTR_ENABLE(s_base) +}; + +clang warning is: 'get_derived_info' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] + +The fix is to disable the warning for the usage of RTTR_ENABLE only + +* add test case code in unit test for warning of override inconsistency + +* added missing quotes +--- + src/rttr/detail/base/core_prerequisites.h | 21 +++++++++++++++++-- + src/rttr/rttr_enable.h | 2 ++ + .../property/property_class_inheritance.cpp | 4 ++++ + 3 files changed, 25 insertions(+), 2 deletions(-) + +diff --git a/src/rttr/detail/base/core_prerequisites.h b/src/rttr/detail/base/core_prerequisites.h +index d9fc0a22..f60d91c3 100644 +--- a/src/rttr/detail/base/core_prerequisites.h ++++ b/src/rttr/detail/base/core_prerequisites.h +@@ -261,15 +261,21 @@ namespace rttr + # define RTTR_BEGIN_DISABLE_CONDITIONAL_EXPR_WARNING + # define RTTR_END_DISABLE_CONDITIONAL_EXPR_WARNING + #if RTTR_COMP_VER >= 700 +- + #define RTTR_BEGIN_DISABLE_EXCEPT_TYPE_WARNING _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wnoexcept-type\"") + #define RTTR_END_DISABLE_EXCEPT_TYPE_WARNING _Pragma ("GCC diagnostic pop") + #else +- + #define RTTR_BEGIN_DISABLE_EXCEPT_TYPE_WARNING + #define RTTR_END_DISABLE_EXCEPT_TYPE_WARNING ++#endif + ++#if RTTR_COMP_VER >= 510 ++# define RTTR_BEGIN_DISABLE_OVERRIDE_WARNING _Pragma ("GCC diagnostic push") \ ++ _Pragma ("GCC diagnostic ignored \"-Wsuggest-override\"") ++# define RTTR_END_DISABLE_OVERRIDE_WARNING _Pragma ("GCC diagnostic pop") ++# else ++# define RTTR_BEGIN_DISABLE_OVERRIDE_WARNING ++# define RTTR_END_DISABLE_OVERRIDE_WARNING + #endif + + # define RTTR_DECLARE_PLUGIN_CTOR __attribute__((constructor)) +@@ -298,6 +304,15 @@ namespace rttr + # define RTTR_END_DISABLE_EXCEPT_TYPE_WARNING + #endif + ++#if defined(__has_warning) && __has_warning("-Winconsistent-missing-override") ++# define RTTR_BEGIN_DISABLE_OVERRIDE_WARNING _Pragma ("clang diagnostic push") \ ++ _Pragma ("clang diagnostic ignored \"-Winconsistent-missing-override\"") ++# define RTTR_END_DISABLE_OVERRIDE_WARNING _Pragma ("clang diagnostic pop") ++#else ++# define RTTR_BEGIN_DISABLE_OVERRIDE_WARNING ++# define RTTR_END_DISABLE_OVERRIDE_WARNING ++#endif ++ + # define RTTR_DECLARE_PLUGIN_CTOR __attribute__((__constructor__)) + # define RTTR_DECLARE_PLUGIN_DTOR __attribute__((__destructor__)) + +@@ -315,6 +330,8 @@ namespace rttr + # define RTTR_END_DISABLE_EXCEPT_TYPE_WARNING + # define RTTR_DECLARE_PLUGIN_CTOR + # define RTTR_DECLARE_PLUGIN_DTOR ++# define RTTR_BEGIN_DISABLE_OVERRIDE_WARNING ++# define RTTR_END_DISABLE_OVERRIDE_WARNING + + #else + # pragma message("WARNING: unknown compiler, don't know how to disable deprecated warnings") +diff --git a/src/rttr/rttr_enable.h b/src/rttr/rttr_enable.h +index 1bd2e774..93d0fadd 100644 +--- a/src/rttr/rttr_enable.h ++++ b/src/rttr/rttr_enable.h +@@ -81,10 +81,12 @@ + + #define RTTR_ENABLE(...) \ + public:\ ++RTTR_BEGIN_DISABLE_OVERRIDE_WARNING \ + virtual RTTR_INLINE rttr::type get_type() const { return rttr::detail::get_type_from_instance(this); } \ + virtual RTTR_INLINE void* get_ptr() { return reinterpret_cast<void*>(this); } \ + virtual RTTR_INLINE rttr::detail::derived_info get_derived_info() { return {reinterpret_cast<void*>(this), rttr::detail::get_type_from_instance(this)}; } \ + using base_class_list = TYPE_LIST(__VA_ARGS__); \ ++RTTR_END_DISABLE_OVERRIDE_WARNING \ + private: + + #endif // DOXYGEN +diff --git a/src/unit_tests/property/property_class_inheritance.cpp b/src/unit_tests/property/property_class_inheritance.cpp +index 3618ac5c..e10c795c 100644 +--- a/src/unit_tests/property/property_class_inheritance.cpp ++++ b/src/unit_tests/property/property_class_inheritance.cpp +@@ -56,6 +56,7 @@ struct left : virtual top + { + + left() : _p2(true){} ++ ~left() override = default; + bool _p2; + + RTTR_ENABLE(top) +@@ -67,6 +68,7 @@ struct right : virtual top + { + + right() : _p3(true){} ++ ~right() override = default; + bool _p3; + + RTTR_ENABLE(top) +@@ -77,6 +79,7 @@ struct right : virtual top + struct right_2 + { + virtual ~right_2() {} ++ + right_2() : _p4(true){} + bool _p4; + RTTR_ENABLE() +@@ -87,6 +90,7 @@ struct right_2 + struct bottom : left, right, right_2 + { + bottom() : _p5(23.0){} ++ ~bottom() override = default; + + double _p5; + diff --git a/user/rttr/gcc9.patch b/user/rttr/gcc9.patch new file mode 100644 index 000000000..4e438859e --- /dev/null +++ b/user/rttr/gcc9.patch @@ -0,0 +1,103 @@ +From 7edbd580cfad509a3253c733e70144e36f02ecd4 Mon Sep 17 00:00:00 2001 +From: Axel Menzel <info@axelmenzel.de> +Date: Sun, 8 Aug 2021 12:27:15 +0200 +Subject: [PATCH] add github actions workflow & disable gcc9 warnings + +Additional: disable initializer list warning +--- + .github/workflows/linux.yml | 23 +++++++++++++++++++ + src/rttr/detail/base/core_prerequisites.h | 15 ++++++++++++ + src/rttr/detail/variant/variant_data_policy.h | 3 ++- + 3 files changed, 40 insertions(+), 1 deletion(-) + create mode 100644 .github/workflows/linux.yml + +diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml +new file mode 100644 +index 00000000..c232943e +--- /dev/null ++++ b/.github/workflows/linux.yml +@@ -0,0 +1,23 @@ ++name: Linux ++ ++on: [push] ++env: ++ # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) ++ BUILD_TYPE: Release ++ ++jobs: ++ build: ++ runs-on: ubuntu-latest ++ ++ steps: ++ - uses: actions/checkout@v2 ++ - uses: seanmiddleditch/gha-setup-ninja@master ++ ++ - name: Configure CMake ++ run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_EXAMPLES=OFF -G Ninja ++ ++ - name: Build ++ run: cmake --build ${{github.workspace}}/build ++ ++ - name: Test ++ run: cmake --build ${{github.workspace}}/build --target run_tests +diff --git a/src/rttr/detail/base/core_prerequisites.h b/src/rttr/detail/base/core_prerequisites.h +index 6aa29d77..601ddeb9 100644 +--- a/src/rttr/detail/base/core_prerequisites.h ++++ b/src/rttr/detail/base/core_prerequisites.h +@@ -278,6 +278,15 @@ namespace rttr + # define RTTR_END_DISABLE_OVERRIDE_WARNING + #endif + ++#if RTTR_COMP_VER >= 900 ++# define RTTR_BEGIN_DISABLE_INIT_LIST_WARNING _Pragma ("GCC diagnostic push") \ ++ _Pragma ("GCC diagnostic ignored \"-Winit-list-lifetime\"") ++# define RTTR_END_DISABLE_INIT_LIST_WARNING _Pragma ("GCC diagnostic pop") ++# else ++# define RTTR_BEGIN_DISABLE_INIT_LIST_WARNING ++# define RTTR_END_DISABLE_INIT_LIST_WARNING ++#endif ++ + # define RTTR_DECLARE_PLUGIN_CTOR __attribute__((constructor)) + # define RTTR_DECLARE_PLUGIN_DTOR __attribute__((destructor)) + +@@ -313,6 +322,10 @@ namespace rttr + # define RTTR_END_DISABLE_OVERRIDE_WARNING + #endif + ++ ++# define RTTR_BEGIN_DISABLE_INIT_LIST_WARNING ++# define RTTR_END_DISABLE_INIT_LIST_WARNING ++ + # define RTTR_DECLARE_PLUGIN_CTOR __attribute__((__constructor__)) + # define RTTR_DECLARE_PLUGIN_DTOR __attribute__((__destructor__)) + +@@ -332,6 +345,8 @@ namespace rttr + # define RTTR_DECLARE_PLUGIN_DTOR + # define RTTR_BEGIN_DISABLE_OVERRIDE_WARNING + # define RTTR_END_DISABLE_OVERRIDE_WARNING ++# define RTTR_BEGIN_DISABLE_INIT_LIST_WARNING ++# define RTTR_END_DISABLE_INIT_LIST_WARNING + + #else + # pragma message("WARNING: unknown compiler, don't know how to disable deprecated warnings") +diff --git a/src/rttr/detail/variant/variant_data_policy.h b/src/rttr/detail/variant/variant_data_policy.h +index 39dbb2f9..8eeaafbe 100644 +--- a/src/rttr/detail/variant/variant_data_policy.h ++++ b/src/rttr/detail/variant/variant_data_policy.h +@@ -434,7 +434,7 @@ struct variant_data_policy_big : variant_data_base_policy<T, variant_data_policy + { + delete &value; + } +- ++RTTR_BEGIN_DISABLE_INIT_LIST_WARNING + static RTTR_INLINE void clone(const T& value, variant_data& dest) + { + reinterpret_cast<T*&>(dest) = new T(value); +@@ -450,6 +450,7 @@ struct variant_data_policy_big : variant_data_base_policy<T, variant_data_policy + { + reinterpret_cast<T*&>(dest) = new T(std::forward<U>(value)); + } ++RTTR_END_DISABLE_INIT_LIST_WARNING + }; + + ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/user/rttr/header.patch b/user/rttr/header.patch new file mode 100644 index 000000000..ee908775b --- /dev/null +++ b/user/rttr/header.patch @@ -0,0 +1,21 @@ +From b16fccf0fbbbf94064bf2a6c7c47f2b910ab31f1 Mon Sep 17 00:00:00 2001 +From: Veawor Liu <veawor@gmail.com> +Date: Tue, 22 Oct 2019 05:04:47 +0800 +Subject: [PATCH] Fixed compiler errors. (#253) + +--- + src/rttr/variant.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/rttr/variant.h b/src/rttr/variant.h +index cec094b0..40978e3b 100644 +--- a/src/rttr/variant.h ++++ b/src/rttr/variant.h +@@ -38,6 +38,7 @@ + #include <cstddef> + #include <cstdint> + #include <algorithm> ++#include <string> + + namespace rttr + { diff --git a/user/rttr/no-pessimising-moves.patch b/user/rttr/no-pessimising-moves.patch new file mode 100644 index 000000000..7ca6655fc --- /dev/null +++ b/user/rttr/no-pessimising-moves.patch @@ -0,0 +1,65 @@ +From ea1e41f02ca1e32a9bbb731fec05708101c0e03f Mon Sep 17 00:00:00 2001 +From: Andrey Davydov <andrey.a.davydov@gmail.com> +Date: Mon, 6 Jan 2020 15:11:47 +0300 +Subject: [PATCH] fix pessimizing moves + +--- + src/rttr/detail/registration/bind_impl.h | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/rttr/detail/registration/bind_impl.h b/src/rttr/detail/registration/bind_impl.h +index 7bb63278..606398a4 100644 +--- a/src/rttr/detail/registration/bind_impl.h ++++ b/src/rttr/detail/registration/bind_impl.h +@@ -295,7 +295,7 @@ class registration::bind<detail::ctor_func, Class_Type, F, acc_level, Visitor_Li + std::move(get_metadata(std::forward<Args>(args)...)), + std::move(get_default_args<type_list<Acc_Func>, function_type>(std::forward<Args>(args)...)), + std::move(create_param_infos<type_list<F>, function_type>(std::forward<Args>(args)...))); +- return std::move(ctor); ++ return ctor; + } + public: + bind(const std::shared_ptr<detail::registration_executer>& reg_exec, F func) +@@ -397,6 +397,6 @@ class registration::bind<detail::prop, Class_Type, A, acc_level, Visitor_List> : + getter_policy, setter_policy, + Metadata_Count>>(name, type::get<Class_Type>(), acc, std::move(metadata_list)); +- return std::move(prop); ++ return prop; + } + + public: +@@ -491,6 +491,6 @@ class registration::bind<detail::prop, Class_Type, A1, A2, acc_level, Visitor_Li + Metadata_Count>>(name, type::get<Class_Type>(), + getter, setter, std::move(metadata_list)); +- return std::move(prop); ++ return prop; + } + + public: +@@ -583,7 +583,7 @@ class registration::bind<detail::prop_readonly, Class_Type, A, acc_level, Visito + > + >(name, acc, std::move(metadata_list)); + +- return std::move(prop); ++ return prop; + } + + public: +@@ -678,7 +678,7 @@ class registration::bind<detail::meth, Class_Type, F, acc_level, Visitor_List> : + std::move(get_metadata(std::forward<Args>(args)...)), + std::move(get_default_args<type_list<Acc_Func>, function_type>(std::forward<Args>(args)...)), + std::move(create_param_infos<type_list<F>, function_type>(std::forward<Args>(args)...)) ); +- return std::move(meth); ++ return meth; + } + + template<typename Policy, std::size_t Metadata_Count, typename...TArgs, typename...Param_Args> +@@ -791,7 +791,7 @@ class registration::bind<detail::enum_, Class_Type, Enum_Type> : public registra + std::move(get_metadata(std::forward<Args>(args)...))); + + +- return std::move(enum_wrapper); ++ return enum_wrapper; + } + + public: diff --git a/user/rttr/show-warnings-not-error-out.patch b/user/rttr/show-warnings-not-error-out.patch new file mode 100644 index 000000000..11d332048 --- /dev/null +++ b/user/rttr/show-warnings-not-error-out.patch @@ -0,0 +1,16 @@ +diff -ur a/CMake/utility.cmake b/CMake/utility.cmake +--- a/CMake/utility.cmake 2024-06-04 17:45:24.308248159 +0000 ++++ b/CMake/utility.cmake 2024-06-04 17:46:10.476409691 +0000 +@@ -392,10 +392,10 @@ + #################################################################################### + function( set_compiler_warnings target) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +- set(WARNINGS "-Werror" ++ set(WARNINGS "-Wextra" + "-Wall") + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(WARNINGS "-Werror" ++ set(WARNINGS "-Wextra" + "-Wall") + elseif(MSVC) + set(WARNINGS "/WX" |