diff options
author | Rui Costa <rui.ms.costa@ctw.bmwgroup.com> | 2024-04-03 12:00:46 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-04-05 08:07:24 -0700 |
commit | 1db8a436b303cca703fc75934067b2a56c81cbff (patch) | |
tree | 9a9a198a789c385b995c7202e92653455d3b2c4d /meta-oe/recipes-support | |
parent | b9473d53c38a55ebb20a572373ac7f4d6e18cc60 (diff) | |
download | meta-openembedded-1db8a436b303cca703fc75934067b2a56c81cbff.tar.gz |
avro: add recipe for c++
- remove the unittests from the compilation step
- add cmake configuration files to use with find_package
- update c++ version to 14
Diffstat (limited to 'meta-oe/recipes-support')
4 files changed, 213 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/avro/avro-c++/0001-Remove-cpp-unittest-compilation.patch b/meta-oe/recipes-support/avro/avro-c++/0001-Remove-cpp-unittest-compilation.patch new file mode 100644 index 000000000..f407fa6ec --- /dev/null +++ b/meta-oe/recipes-support/avro/avro-c++/0001-Remove-cpp-unittest-compilation.patch | |||
@@ -0,0 +1,88 @@ | |||
1 | From 6be1c45e1f7ee78499bdca76c25ec23a61317134 Mon Sep 17 00:00:00 2001 | ||
2 | From: Rui Costa <rui.ms.costa@ctw.bmwgroup.com> | ||
3 | Date: Wed, 20 Mar 2024 14:58:27 +0000 | ||
4 | Subject: [PATCH 1/2] Remove cpp unittest compilation | ||
5 | |||
6 | Upstream-Status: Inappropriate [oe-specific] | ||
7 | --- | ||
8 | lang/c++/CMakeLists.txt | 61 ----------------------------------------- | ||
9 | 1 file changed, 61 deletions(-) | ||
10 | |||
11 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
12 | index 4a3793152..d94ba42d3 100644 | ||
13 | --- a/CMakeLists.txt | ||
14 | +++ b/CMakeLists.txt | ||
15 | @@ -131,70 +131,9 @@ set_target_properties (avrocpp_s PROPERTIES | ||
16 | target_link_libraries (avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) | ||
17 | target_include_directories(avrocpp PRIVATE ${SNAPPY_INCLUDE_DIR}) | ||
18 | |||
19 | -add_executable (precompile test/precompile.cc) | ||
20 | - | ||
21 | -target_link_libraries (precompile avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) | ||
22 | - | ||
23 | -macro (gen file ns) | ||
24 | - add_custom_command (OUTPUT ${file}.hh | ||
25 | - COMMAND avrogencpp | ||
26 | - -p - | ||
27 | - -i ${CMAKE_CURRENT_SOURCE_DIR}/jsonschemas/${file} | ||
28 | - -o ${file}.hh -n ${ns} -U | ||
29 | - DEPENDS avrogencpp ${CMAKE_CURRENT_SOURCE_DIR}/jsonschemas/${file}) | ||
30 | - add_custom_target (${file}_hh DEPENDS ${file}.hh) | ||
31 | -endmacro (gen) | ||
32 | - | ||
33 | -gen (empty_record empty) | ||
34 | -gen (bigrecord testgen) | ||
35 | -gen (bigrecord_r testgen_r) | ||
36 | -gen (bigrecord2 testgen2) | ||
37 | -gen (tweet testgen3) | ||
38 | -gen (union_array_union uau) | ||
39 | -gen (union_map_union umu) | ||
40 | -gen (union_conflict uc) | ||
41 | -gen (recursive rec) | ||
42 | -gen (reuse ru) | ||
43 | -gen (circulardep cd) | ||
44 | -gen (tree1 tr1) | ||
45 | -gen (tree2 tr2) | ||
46 | -gen (crossref cr) | ||
47 | -gen (primitivetypes pt) | ||
48 | -gen (cpp_reserved_words cppres) | ||
49 | - | ||
50 | add_executable (avrogencpp impl/avrogencpp.cc) | ||
51 | target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) | ||
52 | |||
53 | -enable_testing() | ||
54 | - | ||
55 | -macro (unittest name) | ||
56 | - add_executable (${name} test/${name}.cc) | ||
57 | - target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) | ||
58 | - add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
59 | - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name}) | ||
60 | -endmacro (unittest) | ||
61 | - | ||
62 | -unittest (buffertest) | ||
63 | -unittest (unittest) | ||
64 | -unittest (SchemaTests) | ||
65 | -unittest (LargeSchemaTests) | ||
66 | -unittest (CodecTests) | ||
67 | -unittest (StreamTests) | ||
68 | -unittest (SpecificTests) | ||
69 | -unittest (DataFileTests) | ||
70 | -unittest (JsonTests) | ||
71 | -unittest (AvrogencppTests) | ||
72 | -unittest (CompilerTests) | ||
73 | -unittest (AvrogencppTestReservedWords) | ||
74 | - | ||
75 | -add_dependencies (AvrogencppTestReservedWords cpp_reserved_words_hh) | ||
76 | - | ||
77 | -add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh | ||
78 | - tweet_hh | ||
79 | - union_array_union_hh union_map_union_hh union_conflict_hh | ||
80 | - recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh | ||
81 | - primitivetypes_hh empty_record_hh) | ||
82 | - | ||
83 | include (InstallRequiredSystemLibraries) | ||
84 | |||
85 | set (CPACK_PACKAGE_FILE_NAME "avrocpp-${AVRO_VERSION_MAJOR}") | ||
86 | -- | ||
87 | 2.44.0 | ||
88 | |||
diff --git a/meta-oe/recipes-support/avro/avro-c++/0002-Add-package-configuration-files.patch b/meta-oe/recipes-support/avro/avro-c++/0002-Add-package-configuration-files.patch new file mode 100644 index 000000000..ecb125186 --- /dev/null +++ b/meta-oe/recipes-support/avro/avro-c++/0002-Add-package-configuration-files.patch | |||
@@ -0,0 +1,79 @@ | |||
1 | From 56feaa90d070a5011f380d3ae47c01643b9fafe0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Rui Costa <rui.ms.costa@ctw.bmwgroup.com> | ||
3 | Date: Fri, 22 Mar 2024 13:27:38 +0000 | ||
4 | Subject: [PATCH 2/2] Add package configuration files | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | --- | ||
8 | lang/c++/CMakeLists.txt | 35 +++++++++++++++++++++++++++--- | ||
9 | lang/c++/cmake/AvroCppConfig.cmake | 5 +++++ | ||
10 | 2 files changed, 37 insertions(+), 3 deletions(-) | ||
11 | create mode 100644 lang/c++/cmake/AvroCppConfig.cmake | ||
12 | |||
13 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
14 | index d94ba42d3..2e5a394cb 100644 | ||
15 | --- a/CMakeLists.txt | ||
16 | +++ b/CMakeLists.txt | ||
17 | @@ -140,12 +140,16 @@ set (CPACK_PACKAGE_FILE_NAME "avrocpp-${AVRO_VERSION_MAJOR}") | ||
18 | |||
19 | include (CPack) | ||
20 | |||
21 | -install (TARGETS avrocpp avrocpp_s | ||
22 | +install (TARGETS avrocpp | ||
23 | + EXPORT AvroCppTargets | ||
24 | LIBRARY DESTINATION lib | ||
25 | ARCHIVE DESTINATION lib | ||
26 | - RUNTIME DESTINATION lib) | ||
27 | + RUNTIME DESTINATION lib | ||
28 | + INCLUDES DESTINATION include) | ||
29 | |||
30 | -install (TARGETS avrogencpp RUNTIME DESTINATION bin) | ||
31 | +install (TARGETS avrogencpp | ||
32 | + EXPORT AvroCppTargets | ||
33 | + RUNTIME DESTINATION bin) | ||
34 | |||
35 | install (DIRECTORY api/ DESTINATION include/avro | ||
36 | FILES_MATCHING PATTERN *.hh) | ||
37 | @@ -155,3 +159,28 @@ if (NOT CMAKE_BUILD_TYPE) | ||
38 | "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." | ||
39 | FORCE) | ||
40 | endif (NOT CMAKE_BUILD_TYPE) | ||
41 | + | ||
42 | +# Create cmake config files | ||
43 | +include(CMakePackageConfigHelpers) | ||
44 | +write_basic_package_version_file( | ||
45 | + "${CMAKE_CURRENT_BINARY_DIR}/AvroCppConfigVersion.cmake" | ||
46 | + VERSION ${AVRO_VERSION_MAJOR}.${AVRO_VERSION_MINOR}.${AVRO_VERSION_PATCH} | ||
47 | + COMPATIBILITY AnyNewerVersion | ||
48 | +) | ||
49 | + | ||
50 | +configure_file(cmake/AvroCppConfig.cmake | ||
51 | + "${CMAKE_CURRENT_BINARY_DIR}/AvroCppConfig.cmake" | ||
52 | + COPYONLY | ||
53 | +) | ||
54 | + | ||
55 | +set(ConfigPackageLocation lib/cmake/avrocpp) | ||
56 | +install(EXPORT AvroCppTargets | ||
57 | + FILE AvroCppTargets.cmake | ||
58 | + NAMESPACE AvroCpp:: | ||
59 | + DESTINATION ${ConfigPackageLocation} | ||
60 | +) | ||
61 | +install(FILES | ||
62 | + "cmake/AvroCppConfig.cmake" | ||
63 | + "${CMAKE_CURRENT_BINARY_DIR}/AvroCppConfigVersion.cmake" | ||
64 | + DESTINATION ${ConfigPackageLocation} | ||
65 | + COMPONENT Devel) | ||
66 | diff --git a/cmake/AvroCppConfig.cmake b/cmake/AvroCppConfig.cmake | ||
67 | new file mode 100644 | ||
68 | index 000000000..deb8aaa31 | ||
69 | --- /dev/null | ||
70 | +++ b/cmake/AvroCppConfig.cmake | ||
71 | @@ -0,0 +1,5 @@ | ||
72 | +include(CMakeFindDependencyMacro) | ||
73 | +find_dependency(Boost 1.38 REQUIRED | ||
74 | + COMPONENTS filesystem iostreams program_options regex system) | ||
75 | + | ||
76 | +include("${CMAKE_CURRENT_LIST_DIR}/AvroCppTargets.cmake") | ||
77 | -- | ||
78 | 2.44.0 | ||
79 | |||
diff --git a/meta-oe/recipes-support/avro/avro-c++/0003-Update-CXX-standard-to-CXX14.patch b/meta-oe/recipes-support/avro/avro-c++/0003-Update-CXX-standard-to-CXX14.patch new file mode 100644 index 000000000..449b0dfd6 --- /dev/null +++ b/meta-oe/recipes-support/avro/avro-c++/0003-Update-CXX-standard-to-CXX14.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | From 640c51c61536913b3d43714bebe228b32f043144 Mon Sep 17 00:00:00 2001 | ||
2 | From: Rui Costa <rui.ms.costa@ctw.bmwgroup.com> | ||
3 | Date: Fri, 5 Apr 2024 11:33:51 +0000 | ||
4 | Subject: [PATCH 3/3] Update CXX standard to CXX14 | ||
5 | |||
6 | Upstream-Status: Inappropriate [oe-specific] | ||
7 | --- | ||
8 | lang/c++/CMakeLists.txt | 2 +- | ||
9 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
12 | index 2e5a394cb..f29a532ef 100644 | ||
13 | --- a/CMakeLists.txt | ||
14 | +++ b/CMakeLists.txt | ||
15 | @@ -21,7 +21,7 @@ cmake_minimum_required (VERSION 3.1) | ||
16 | set (CMAKE_LEGACY_CYGWIN_WIN32 0) | ||
17 | |||
18 | if (NOT DEFINED CMAKE_CXX_STANDARD) | ||
19 | - set(CMAKE_CXX_STANDARD 11) | ||
20 | + set(CMAKE_CXX_STANDARD 14) | ||
21 | endif() | ||
22 | |||
23 | set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
24 | -- | ||
25 | 2.44.0 | ||
26 | |||
diff --git a/meta-oe/recipes-support/avro/avro-c++_1.11.3.bb b/meta-oe/recipes-support/avro/avro-c++_1.11.3.bb new file mode 100644 index 000000000..1e4787eb4 --- /dev/null +++ b/meta-oe/recipes-support/avro/avro-c++_1.11.3.bb | |||
@@ -0,0 +1,20 @@ | |||
1 | SUMMARY = "Apache Avro data serialization system." | ||
2 | HOMEPAGE = "http://apr.apache.org/" | ||
3 | SECTION = "libs" | ||
4 | |||
5 | LICENSE = "Apache-2.0" | ||
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=43abf34d8b9908494f83c55d213a7f89" | ||
7 | |||
8 | DEPENDS = "boost zlib xz" | ||
9 | |||
10 | BRANCH = "branch-1.11" | ||
11 | SRCREV = "35ff8b997738e4d983871902d47bfb67b3250734" | ||
12 | SRC_URI = "git://github.com/apache/avro;branch=${BRANCH};protocol=https \ | ||
13 | file://0001-Remove-cpp-unittest-compilation.patch \ | ||
14 | file://0002-Add-package-configuration-files.patch \ | ||
15 | file://0003-Update-CXX-standard-to-CXX14.patch \ | ||
16 | " | ||
17 | |||
18 | S = "${WORKDIR}/git/lang/c++" | ||
19 | |||
20 | inherit cmake pkgconfig | ||