meta-openembedded/meta-oe/recipes-support/avro/avro-c++/0001-Remove-cpp-unittest-compilation.patch
Alper Ak 4edf81ab1c
avro-c++: Upgrade 1.11.3 -> 1.12 to allow CMake 4+ compatibility
- Drop workaround flag for dangling reference
- Refresh patches and drop 0003-Update-CXX-standard-to-CXX14.patch because already assigned to C++17
- Drop xz and zlib because they aren't shown as build dependency and without them the build completes without errors
- Fetch the fmt in SRC_URI and put it in the right place so the CMake doesn't need to run FetchContent
- The LICENSE file has changed so updated LIC_FILES_CHKSUM to match the new md5sum

Changelog: https://github.com/apache/avro/releases/tag/release-1.12.0

Fix:

| CMake Error at CMakeLists.txt:19 (cmake_minimum_required):
|   Compatibility with CMake < 3.5 has been removed from CMake.
|
|   Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
|   to tell CMake that the project requires at least <min> but has been updated
|   to work with policies introduced by <max> or earlier.
|
|   Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

----

| CMake Warning at /opt/yocto-masternext-contribute/sources/build/tmp/work/core2-64-poky-linux/avro-c++/1.12/recipe-sysroot-native/usr/share/cmake-4.0/Modules/FetchContent.cmake:2111 (message):
|   FETCHCONTENT_FULLY_DISCONNECTED is set to true, which requires the source
|   directory for dependency fmt to already be populated.  This generally means
|   it must not be set to true the first time CMake is run in a build
|   directory.  The following source directory should already be populated, but
|   it doesn't exist:
|
|     /opt/yocto-masternext-contribute/sources/build/tmp/work/core2-64-poky-linux/avro-c++/1.12/build/_deps/fmt-src
|
|   Policy CMP0170 controls enforcement of this requirement.
| Call Stack (most recent call first):
|   /opt/yocto-masternext-contribute/sources/build/tmp/work/core2-64-poky-linux/avro-c++/1.12/recipe-sysroot-native/usr/share/cmake-4.0/Modules/FetchContent.cmake:2384 (__FetchContent_Populate)
|   CMakeLists.txt:93 (FetchContent_MakeAvailable)
|
|
| -- Could NOT find Snappy (missing: SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIR)
| Disabled snappy codec. libsnappy not found.
| -- Configuring done (0.4s)
| CMake Error at CMakeLists.txt:149 (target_link_libraries):
|   Target "avrocpp" links to:
|
|     fmt::fmt-header-only
|
|   but the target was not found.  Possible reasons include:
|
|     * There is a typo in the target name.
|     * A find_package call is missing for an IMPORTED target.
|     * An ALIAS target is missing.
|
|
|
| CMake Error at CMakeLists.txt:138 (target_link_libraries):
|   Target "avrocpp_s" links to:
|
|     fmt::fmt-header-only
|
|   but the target was not found.  Possible reasons include:
|
|     * There is a typo in the target name.
|     * A find_package call is missing for an IMPORTED target.
|     * An ALIAS target is missing.

Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-07-08 23:40:32 -07:00

100 lines
3.0 KiB
Diff

From d75f0c5e7a51c9874edad0ea60957e006fb6def5 Mon Sep 17 00:00:00 2001
From: Rui Costa <rui.ms.costa@ctw.bmwgroup.com>
Date: Mon, 7 Jul 2025 16:58:30 +0300
Subject: [PATCH] Remove cpp unittest compilation
Upstream-Status: Inappropriate [oe-specific]
Signed-off-by: Rui Costa <rui.ms.costa@ctw.bmwgroup.com>
Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
---
lang/c++/CMakeLists.txt | 65 -----------------------------------------
1 file changed, 65 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 19059a41b..1f5f98c83 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -149,39 +149,6 @@ set_target_properties (avrocpp_s PROPERTIES
target_link_libraries (avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} fmt::fmt-header-only)
target_include_directories(avrocpp PRIVATE ${SNAPPY_INCLUDE_DIR})
-add_executable (precompile test/precompile.cc)
-
-target_link_libraries (precompile avrocpp_s)
-
-macro (gen file ns)
- add_custom_command (OUTPUT ${file}.hh
- COMMAND avrogencpp
- -p -
- -i ${CMAKE_CURRENT_SOURCE_DIR}/jsonschemas/${file}
- -o ${file}.hh -n ${ns}
- DEPENDS avrogencpp ${CMAKE_CURRENT_SOURCE_DIR}/jsonschemas/${file})
- add_custom_target (${file}_hh DEPENDS ${file}.hh)
-endmacro (gen)
-
-gen (empty_record empty)
-gen (bigrecord testgen)
-gen (bigrecord_r testgen_r)
-gen (bigrecord2 testgen2)
-gen (tweet testgen3)
-gen (union_array_union uau)
-gen (union_map_union umu)
-gen (union_conflict uc)
-gen (union_empty_record uer)
-gen (recursive rec)
-gen (reuse ru)
-gen (circulardep cd)
-gen (tree1 tr1)
-gen (tree2 tr2)
-gen (crossref cr)
-gen (primitivetypes pt)
-gen (cpp_reserved_words cppres)
-gen (cpp_reserved_words_union_typedef cppres_union)
-
add_executable (avrogencpp impl/avrogencpp.cc)
target_link_libraries (avrogencpp avrocpp_s)
@@ -194,38 +161,6 @@ target_include_directories(avrocpp PUBLIC
$<INSTALL_INTERFACE:include>
)
-enable_testing()
-
-macro (unittest name)
- add_executable (${name} test/${name}.cc)
- target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES})
- add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name})
-endmacro (unittest)
-
-unittest (buffertest)
-unittest (unittest)
-unittest (SchemaTests)
-unittest (LargeSchemaTests)
-unittest (CodecTests)
-unittest (StreamTests)
-unittest (SpecificTests)
-unittest (DataFileTests)
-unittest (JsonTests)
-unittest (AvrogencppTests)
-unittest (CompilerTests)
-unittest (AvrogencppTestReservedWords)
-unittest (CommonsSchemasTests)
-
-add_dependencies (AvrogencppTestReservedWords cpp_reserved_words_hh)
-
-add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh
- tweet_hh
- union_array_union_hh union_map_union_hh union_conflict_hh
- recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh
- primitivetypes_hh empty_record_hh cpp_reserved_words_union_typedef_hh
- union_empty_record_hh)
-
include (InstallRequiredSystemLibraries)
set (CPACK_PACKAGE_FILE_NAME "avrocpp-${AVRO_VERSION_MAJOR}")
--
2.43.0