Skip to content

Commit

Permalink
(conan-io#7843) draco/1.4.3
Browse files Browse the repository at this point in the history
* conan-io#7646 add source for newer releases of draco

* conan-io#7646 bring some changes in from gcc-11 work

* conan-io#7646 make draco build latest version

* conan-io#7646 some clean up of conanfile for draco

* conan-io#7646 clean up imports in draco test_package/conanfile.py

* conan-io#7646 empty commit due to unknown error in ci/cd

* conan-io#7646 remove support for draco/1.4.0 and draco/1.4.0

* conan-io#7646 specify the build target correctly on windows.
  • Loading branch information
lederernc authored and ivanvurbanov committed Dec 2, 2021
1 parent 8d85b29 commit b05db38
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 41 deletions.
3 changes: 3 additions & 0 deletions recipes/draco/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"1.4.3":
url: "https://github.com/google/draco/archive/1.4.3.tar.gz"
sha256: "02a620a7ff8388c57d6f6e0941eecc10d0c23ab47c45942fb52f64a6245c44f5"
"1.3.6":
url: "https://github.com/google/draco/archive/1.3.6.tar.gz"
sha256: "80eaa54ef5fc687c9aeebb9bd24d936d3e6d2c6048f358be8b83fa088ef4b2cb"
Expand Down
112 changes: 73 additions & 39 deletions recipes/draco/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DracoConan(ConanFile):
options = {
"shared": [True, False],
"fPIC": [True, False],
"target": ["encode_and_decode", "encode_only", "decode_only"],
"target": ["draco", "encode_and_decode", "encode_only", "decode_only"],
"enable_point_cloud_compression": [True, False],
"enable_mesh_compression": [True, False],
"enable_standard_edgebreaker": [True, False],
Expand All @@ -31,7 +31,7 @@ class DracoConan(ConanFile):
default_options = {
"shared": False,
"fPIC": True,
"target": "encode_and_decode",
"target": "draco",
"enable_point_cloud_compression": True,
"enable_mesh_compression": True,
"enable_standard_edgebreaker": True,
Expand Down Expand Up @@ -72,48 +72,82 @@ def build(self):

def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["ENABLE_POINT_CLOUD_COMPRESSION"] = self.options.enable_point_cloud_compression
cmake.definitions["ENABLE_MESH_COMPRESSION"] = self.options.enable_mesh_compression
if self.options.enable_mesh_compression:
cmake.definitions["ENABLE_STANDARD_EDGEBREAKER"] = self.options.enable_standard_edgebreaker
cmake.definitions["ENABLE_PREDICTIVE_EDGEBREAKER"] = self.options.enable_predictive_edgebreaker
cmake.definitions["ENABLE_BACKWARDS_COMPATIBILITY"] = self.options.enable_backwards_compatibility

# BUILD_FOR_GLTF is not needed, it is equivalent to:
# - enable_point_cloud_compression=False
# - enable_mesh_compression=True
# - enable_standard_edgebreaker=True
# - enable_predictive_edgebreaker=False
# - enable_backwards_compatibility=False
cmake.definitions["BUILD_FOR_GLTF"] = False

cmake.definitions["BUILD_UNITY_PLUGIN"] = False
cmake.definitions["BUILD_MAYA_PLUGIN"] = False
cmake.definitions["BUILD_USD_PLUGIN"] = False

cmake.definitions["ENABLE_CCACHE"] = False
cmake.definitions["ENABLE_DISTCC"] = False
cmake.definitions["ENABLE_EXTRA_SPEED"] = False
cmake.definitions["ENABLE_EXTRA_WARNINGS"] = False
cmake.definitions["ENABLE_GOMA"] = False
cmake.definitions["ENABLE_JS_GLUE"] = False
cmake.definitions["ENABLE_DECODER_ATTRIBUTE_DEDUPLICATION"] = False
cmake.definitions["ENABLE_TESTS"] = False
cmake.definitions["ENABLE_WASM"] = False
cmake.definitions["ENABLE_WERROR"] = False
cmake.definitions["ENABLE_WEXTRA"] = False
cmake.definitions["IGNORE_EMPTY_BUILD_TYPE"] = False
cmake.definitions["BUILD_ANIMATION_ENCODING"] = False

# use different cmake definitions based on package version
if tools.Version(self.version) < "1.4.0":
cmake.definitions["ENABLE_POINT_CLOUD_COMPRESSION"] = self.options.enable_point_cloud_compression
cmake.definitions["ENABLE_MESH_COMPRESSION"] = self.options.enable_mesh_compression
if self.options.enable_mesh_compression:
cmake.definitions["ENABLE_STANDARD_EDGEBREAKER"] = self.options.enable_standard_edgebreaker
cmake.definitions["ENABLE_PREDICTIVE_EDGEBREAKER"] = self.options.enable_predictive_edgebreaker
cmake.definitions["ENABLE_BACKWARDS_COMPATIBILITY"] = self.options.enable_backwards_compatibility

# BUILD_FOR_GLTF is not needed, it is equivalent to:
# - enable_point_cloud_compression=False
# - enable_mesh_compression=True
# - enable_standard_edgebreaker=True
# - enable_predictive_edgebreaker=False
# - enable_backwards_compatibility=False
cmake.definitions["BUILD_FOR_GLTF"] = False

cmake.definitions["BUILD_UNITY_PLUGIN"] = False
cmake.definitions["BUILD_MAYA_PLUGIN"] = False
cmake.definitions["BUILD_USD_PLUGIN"] = False

cmake.definitions["ENABLE_CCACHE"] = False
cmake.definitions["ENABLE_DISTCC"] = False
cmake.definitions["ENABLE_EXTRA_SPEED"] = False
cmake.definitions["ENABLE_EXTRA_WARNINGS"] = False
cmake.definitions["ENABLE_GOMA"] = False
cmake.definitions["ENABLE_JS_GLUE"] = False
cmake.definitions["ENABLE_DECODER_ATTRIBUTE_DEDUPLICATION"] = False
cmake.definitions["ENABLE_TESTS"] = False
cmake.definitions["ENABLE_WASM"] = False
cmake.definitions["ENABLE_WERROR"] = False
cmake.definitions["ENABLE_WEXTRA"] = False
cmake.definitions["IGNORE_EMPTY_BUILD_TYPE"] = False
cmake.definitions["BUILD_ANIMATION_ENCODING"] = False
else:
cmake.definitions["DRACO_POINT_CLOUD_COMPRESSION"] = self.options.enable_point_cloud_compression
cmake.definitions["DRACO_MESH_COMPRESSION"] = self.options.enable_mesh_compression
if self.options.enable_mesh_compression:
cmake.definitions["DRACO_STANDARD_EDGEBREAKER"] = self.options.enable_standard_edgebreaker
cmake.definitions["DRACO_PREDICTIVE_EDGEBREAKER"] = self.options.enable_predictive_edgebreaker
cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared
cmake.definitions["DRACO_ANIMATION_ENCODING"] = False
cmake.definitions["DRACO_BACKWARDS_COMPATIBILITY"] = self.options.enable_backwards_compatibility
cmake.definitions["DRACO_DECODER_ATTRIBUTE_DEDUPLICATION"] = False
cmake.definitions["DRACO_FAST"] = False
# DRACO_GLTF True overrides options by enabling
# DRACO_MESH_COMPRESSION_SUPPORTED,
# DRACO_NORMAL_ENCODING_SUPPORTED,
# DRACO_STANDARD_EDGEBREAKER_SUPPORTED
cmake.definitions["DRACO_GLTF"] = False
cmake.definitions["DRACO_JS_GLUE"] = False
cmake.definitions["DRACO_MAYA_PLUGIN"] = False
cmake.definitions["DRACO_TESTS"] = False
cmake.definitions["DRACO_UNITY_PLUGIN"] = False
cmake.definitions["DRACO_WASM"] = False

cmake.configure(build_folder=self._build_subfolder)
return cmake

def _get_target(self):
return {
"encode_and_decode": "draco",
"encode_only": "dracoenc",
"decode_only": "dracodec"
}.get(str(self.options.target))
if tools.Version(self.version) < "1.4.0":
return {
"decode_only": "dracodec",
"draco": "draco",
"encode_and_decode": "draco",
"encode_only": "dracoenc"
}.get(str(self.options.target))

if self.settings.os == "Windows":
return "draco"

if self.options.shared:
return "draco_shared"

return "draco_static"

def package(self):
self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
Expand Down
3 changes: 1 addition & 2 deletions recipes/draco/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os

from conans import ConanFile, CMake, tools
import os


class TestPackageConan(ConanFile):
Expand Down
2 changes: 2 additions & 0 deletions recipes/draco/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"1.4.3":
folder: all
"1.3.6":
folder: all
"1.3.5":
Expand Down

0 comments on commit b05db38

Please sign in to comment.