Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flatbuffers] update to 2.0.8 #13247

Merged
merged 5 commits into from Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions recipes/flatbuffers/all/conandata.yml
@@ -1,4 +1,7 @@
sources:
"2.0.8":
url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.8.tar.gz"
sha256: "f97965a727d26386afaefff950badef2db3ab6af9afe23ed6d94bfb65f95f37e"
"2.0.6":
url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.6.tar.gz"
sha256: "e2dc24985a85b278dd06313481a9ca051d048f9474e0f199e372fea3ea4248c9"
Expand Down
19 changes: 12 additions & 7 deletions recipes/flatbuffers/all/conanfile.py
Expand Up @@ -43,6 +43,10 @@ def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def build_requirements(self):
if Version(self.version) >= "2.0.7":
self.tool_requires("cmake/3.24.0")
Comment on lines +46 to +48
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake 3.16 is now the minimum supported version number. They have a legacy CMakeLists.txt for older CMake versions which is unmaintained, however, and does not work.


def configure(self):
if self.options.shared or self.options.header_only:
del self.options.fPIC
Expand Down Expand Up @@ -77,9 +81,10 @@ def generate(self):
tc.variables["FLATBUFFERS_LIBCXX_WITH_CLANG"] = False
# Mimic upstream CMake/Version.cmake removed in _patch_sources()
version = Version(self.version)
tc.variables["VERSION_MAJOR"] = version.major
tc.variables["VERSION_MINOR"] = version.minor
tc.variables["VERSION_PATCH"] = version.patch
tc.cache_variables["VERSION_MAJOR"] = str(version.major)
tc.cache_variables["VERSION_MINOR"] = str(version.minor or "0")
tc.cache_variables["VERSION_PATCH"] = str(version.patch or "0")
tc.cache_variables["VERSION_COMMIT"] = str(version.pre or "0")
# For msvc shared
tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True
# Relocatable shared libs on Macos
Expand Down Expand Up @@ -131,8 +136,8 @@ def _module_path(self):

def package_info(self):
self.cpp_info.set_property("cmake_find_mode", "both")
self.cpp_info.set_property("cmake_module_file_name", "FlatBuffers")
self.cpp_info.set_property("cmake_file_name", "Flatbuffers")
self.cpp_info.set_property("cmake_module_file_name", "flatbuffers")
self.cpp_info.set_property("cmake_file_name", "flatbuffers")
cmake_target = "flatbuffers"
if not self.options.header_only and self.options.shared:
cmake_target += "_shared"
Expand All @@ -157,8 +162,8 @@ def package_info(self):
self.env_info.PATH.append(bindir)

# TODO: to remove in conan v2 once cmake_find_package* generators removed
self.cpp_info.filenames["cmake_find_package"] = "FlatBuffers"
self.cpp_info.filenames["cmake_find_package_multi"] = "Flatbuffers"
self.cpp_info.filenames["cmake_find_package"] = "flatbuffers"
self.cpp_info.filenames["cmake_find_package_multi"] = "flatbuffers"
self.cpp_info.names["cmake_find_package"] = "flatbuffers"
self.cpp_info.names["cmake_find_package_multi"] = "flatbuffers"
self.cpp_info.components["libflatbuffers"].names["cmake_find_package"] = cmake_target
Expand Down
2 changes: 1 addition & 1 deletion recipes/flatbuffers/all/test_package/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.8)
project(test_package LANGUAGES CXX)

find_package(Flatbuffers REQUIRED CONFIG)
find_package(FlatBuffers REQUIRED CONFIG)
if(TARGET flatbuffers::flatbuffers_shared)
set(FLATBUFFERS_TARGET flatbuffers::flatbuffers_shared)
else()
Expand Down
2 changes: 1 addition & 1 deletion recipes/flatbuffers/all/test_v1_package/CMakeLists.txt
Expand Up @@ -4,7 +4,7 @@ project(test_package LANGUAGES CXX)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(Flatbuffers REQUIRED CONFIG)
find_package(FlatBuffers REQUIRED CONFIG)
if(TARGET flatbuffers::flatbuffers_shared)
set(FLATBUFFERS_TARGET flatbuffers::flatbuffers_shared)
else()
Expand Down
2 changes: 2 additions & 0 deletions recipes/flatbuffers/config.yml
@@ -1,4 +1,6 @@
versions:
"2.0.8":
folder: all
"2.0.6":
folder: all
"2.0.5":
Expand Down