Skip to content

Commit

Permalink
Draco v1.5.1 release. (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomfinegan authored Feb 16, 2022
1 parent 0d1633e commit 9522c22
Show file tree
Hide file tree
Showing 83 changed files with 2,712 additions and 889 deletions.
17 changes: 17 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@ builds but all other use cases are supported. Note that binaries and libraries
built with the transcoder support may result in increased binary sizes of the
produced libraries and executables compared to the default CMake settings.

The following CMake variables can be used to configure Draco to use local
copies of third party dependencies.

- `DRACO_EIGEN_PATH`: this path must contain an Eigen directory that includes
the Eigen sources.
- `DRACO_FILESYSTEM_PATH`: this path must contain the ghc directory where the
filesystem includes are located.
- `DRACO_TINYGLTF_PATH`: this path must contain tiny_gltf.h and its
dependencies.

If not specified the Draco build requires the presence of the submodules that
are stored within `draco/third_party`.

Debugging and Optimization
--------------------------

Expand Down Expand Up @@ -152,6 +165,10 @@ To run the tests execute `draco_tests` from your build output directory:
$ ./draco_tests
~~~~~

Draco can be configured to use a local Googletest installation. The
`DRACO_GOOGLETEST_PATH` variable overrides the behavior described above and
configures Draco to use the Googletest at the specified path.

Third Party Libraries
---------------------

Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ endif()
include(FindPythonInterp)
include("${draco_root}/cmake/draco_build_definitions.cmake")
include("${draco_root}/cmake/draco_cpu_detection.cmake")
include("${draco_root}/cmake/draco_dependencies.cmake")
include("${draco_root}/cmake/draco_emscripten.cmake")
include("${draco_root}/cmake/draco_flags.cmake")
include("${draco_root}/cmake/draco_helpers.cmake")
Expand Down Expand Up @@ -546,6 +547,8 @@ if(DRACO_TRANSCODER_SUPPORTED)
"${draco_src_root}/mesh/mesh_utils.h")

list(APPEND draco_scene_sources
"${draco_src_root}/scene/light.h"
"${draco_src_root}/scene/light.cc"
"${draco_src_root}/scene/mesh_group.h"
"${draco_src_root}/scene/scene.cc"
"${draco_src_root}/scene/scene.h"
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ delays can result in transient errors that can be difficult to diagnose when
new Draco releases are launched. To avoid the issue pin your sites to a
versioned release.

### Version 1.5.1 release
* Adds assertion enabled Emscripten builds to the release, and a subset of the
assertion enabled builds to GStatic. See the file listing below.
* Custom paths to third party dependencies are now supported. See BUILDING.md
for more information.
* The CMake configuration file draco-config.cmake is now tested and known to
work for using Draco in Linux, MacOS, and Windows CMake projects. See the
`install_test` subdirectory of `src/draco/tools` for more information.
* Bug fixes.

### Version 1.5.0 release
* Adds the draco_transcoder tool. See the section below on the glTF transcoding
tool, and BUILDING.md for build and dependency information.
Expand Down Expand Up @@ -519,6 +529,13 @@ As of the v1.4.3 release the files available are:
- [draco_wasm_wrapper.js](https://www.gstatic.com/draco/versioned/decoders/1.4.3/draco_wasm_wrapper.js)
- [draco_wasm_wrapper_gltf.js](https://www.gstatic.com/draco/versioned/decoders/1.4.3/draco_wasm_wrapper_gltf.js)

Beginning with the v1.5.1 release assertion enabled builds of the following
files are available:

- [draco_decoder.js](https://www.gstatic.com/draco/versioned/decoders/1.5.1/with_asserts/draco_decoder.js)
- [draco_decoder.wasm](https://www.gstatic.com/draco/versioned/decoders/1.5.1/with_asserts/draco_decoder.wasm)
- [draco_wasm_wrapper.js](https://www.gstatic.com/draco/versioned/decoders/1.5.1/with_asserts/draco_wasm_wrapper.js)

Support
=======

Expand Down
23 changes: 3 additions & 20 deletions cmake/draco_build_definitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,28 +77,11 @@ macro(draco_set_build_definitions)
endif()

if(DRACO_TRANSCODER_SUPPORTED)
list(APPEND submodule_test_dirs
"${draco_root}/third_party/eigen/Eigen"
"${draco_root}/third_party/filesystem/include"
"${draco_root}/third_party/tinygltf")
foreach(dir IN LISTS submodule_test_dirs)
if(NOT EXISTS ${dir})
message(FATAL_ERROR "${dir} missing, run git submodule update --init")
endif()
endforeach()

list(APPEND draco_include_paths
"${draco_root}/third_party/eigen"
"${draco_root}/third_party/filesystem/include")
draco_setup_eigen()
draco_setup_filesystem()
draco_setup_tinygltf()
endif()

list(APPEND draco_test_include_paths
${draco_include_paths}
"${draco_root}/third_party/googletest/googlemock/include"
"${draco_root}/third_party/googletest/googlemock"
"${draco_root}/third_party/googletest/googletest/include"
"${draco_root}/third_party/googletest/googletest")


list(APPEND draco_defines "DRACO_CMAKE=1"
"DRACO_FLAGS_SRCDIR=\"${draco_root}\""
Expand Down
138 changes: 138 additions & 0 deletions cmake/draco_dependencies.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Copyright 2022 The Draco Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

if(DRACO_CMAKE_DRACO_DEPENDENCIES_CMAKE)
return()
endif()
set(DRACO_CMAKE_DRACO_DEPENDENCIES_CMAKE 1)

include("${draco_root}/cmake/draco_variables.cmake")

# Each variable holds a user specified custom path to a local copy of the
# sources that belong to each project that Draco depends on. When paths are
# empty the build will be generated pointing to the Draco git submodules.
# Otherwise the paths specified by the user will be used in the build
# configuration.

# Path to the Eigen. The path must contain the Eigen directory.
set(DRACO_EIGEN_PATH)
draco_track_configuration_variable(DRACO_EIGEN_PATH)

# Path to the gulrak/filesystem installation. The path specified must contain
# the ghc subdirectory that houses the filesystem includes.
set(DRACO_FILESYSTEM_PATH)
draco_track_configuration_variable(DRACO_FILESYSTEM_PATH)

# Path to the googletest installation. The path must be to the root of the
# Googletest project directory.
set(DRACO_GOOGLETEST_PATH)
draco_track_configuration_variable(DRACO_GOOGLETEST_PATH)

# Path to the syoyo/tinygltf installation. The path must be to the root of the
# project directory.
set(DRACO_TINYGLTF_PATH)
draco_track_configuration_variable(DRACO_TINYGLTF_PATH)

# Utility macro for killing the build due to a missing submodule directory.
macro(draco_die_missing_submodule dir)
message(FATAL_ERROR "${dir} missing, run git submodule update --init")
endmacro()

# Determines the Eigen location and updates the build configuration accordingly.
macro(draco_setup_eigen)
if(DRACO_EIGEN_PATH)
set(eigen_path "${DRACO_EIGEN_PATH}")

if(NOT IS_DIRECTORY "${eigen_path}")
message(FATAL_ERROR "DRACO_EIGEN_PATH does not exist.")
endif()
else()
set(eigen_path "${draco_root}/third_party/eigen")

if(NOT IS_DIRECTORY "${eigen_path}")
draco_die_missing_submodule("${eigen_path}")
endif()
endif()

set(eigen_include_path "${eigen_path}/Eigen")

if(NOT EXISTS "${eigen_path}/Eigen")
message(FATAL_ERROR "The eigen path does not contain an Eigen directory.")
endif()

list(APPEND draco_include_paths "${eigen_path}")
endmacro()

# Determines the gulrak/filesystem location and updates the build configuration
# accordingly.
macro(draco_setup_filesystem)
if(DRACO_FILESYSTEM_PATH)
set(fs_path "${DRACO_FILESYSTEM_PATH}")

if(NOT IS_DIRECTORY "${fs_path}")
message(FATAL_ERROR "DRACO_FILESYSTEM_PATH does not exist.")
endif()
else()
set(fs_path "${draco_root}/third_party/filesystem/include")

if(NOT IS_DIRECTORY "${fs_path}")
draco_die_missing_submodule("${fs_path}")
endif()
endif()

list(APPEND draco_include_paths "${fs_path}")
endmacro()

# Determines the Googletest location and sets up include and source list vars
# for the draco_tests build.
macro(draco_setup_googletest)
if(DRACO_GOOGLETEST_PATH)
set(gtest_path "${DRACO_GOOGLETEST_PATH}")
if(NOT IS_DIRECTORY "${gtest_path}")
message(FATAL_ERROR "DRACO_GOOGLETEST_PATH does not exist.")
endif()
else()
set(gtest_path "${draco_root}/third_party/googletest")
endif()

list(APPEND draco_test_include_paths
${draco_include_paths}
"${gtest_path}/include"
"${gtest_path}/googlemock"
"${gtest_path}/googletest/include"
"${gtest_path}/googletest")

list(APPEND draco_gtest_all "${gtest_path}/googletest/src/gtest-all.cc")
list(APPEND draco_gtest_main "${gtest_path}/googletest/src/gtest_main.cc")
endmacro()

# Determines the location of TinyGLTF and updates the build configuration
# accordingly.
macro(draco_setup_tinygltf)
if(DRACO_TINYGLTF_PATH)
set(tinygltf_path "${DRACO_TINYGLTF_PATH}")

if(NOT IS_DIRECTORY "${tinygltf_path}")
message(FATAL_ERROR "DRACO_TINYGLTF_PATH does not exist.")
endif()
else()
set(tinygltf_path "${draco_root}/third_party/tinygltf")

if(NOT IS_DIRECTORY "${tinygltf_path}")
draco_die_missing_submodule("${tinygltf_path}")
endif()
endif()

list(APPEND draco_include_paths "${tinygltf_path}")
endmacro()
4 changes: 4 additions & 0 deletions cmake/draco_install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ macro(draco_setup_install_target)
install(TARGETS draco_decoder DESTINATION "${bin_path}")
install(TARGETS draco_encoder DESTINATION "${bin_path}")

if(DRACO_TRANSCODER_SUPPORTED)
install(TARGETS draco_transcoder DESTINATION "${bin_path}")
endif()

if(MSVC)
install(TARGETS draco DESTINATION "${libs_path}")
else()
Expand Down
8 changes: 3 additions & 5 deletions cmake/draco_tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ if(DRACO_TRANSCODER_SUPPORTED)
"${draco_src_root}/io/texture_io_test.cc"
"${draco_src_root}/material/material_library_test.cc"
"${draco_src_root}/material/material_test.cc"
"${draco_src_root}/scene/light_test.cc"
"${draco_src_root}/scene/mesh_group_test.cc"
"${draco_src_root}/scene/scene_test.cc"
"${draco_src_root}/scene/scene_utils_test.cc"
Expand All @@ -90,13 +91,10 @@ if(DRACO_TRANSCODER_SUPPORTED)
"${draco_src_root}/texture/texture_transform_test.cc")
endif()

list(APPEND draco_gtest_all
"${draco_root}/third_party/googletest/googletest/src/gtest-all.cc")
list(APPEND draco_gtest_main
"${draco_root}/third_party/googletest/googletest/src/gtest_main.cc")

macro(draco_setup_test_targets)
if(DRACO_TESTS)
draco_setup_googletest()

if(NOT (EXISTS ${draco_gtest_all} AND EXISTS ${draco_gtest_main}))
message(FATAL_ERROR
"googletest missing, run git submodule update --init")
Expand Down
6 changes: 3 additions & 3 deletions cmake/toolchains/android.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ if(NOT ANDROID_ABI)
set(ANDROID_ABI arm64-v8a)
endif()

# Force arm mode for 32-bit targets (instead of the default thumb) to improve
# performance.
if(NOT ANDROID_ARM_MODE)
# Force arm mode for 32-bit arm targets (instead of the default thumb) to
# improve performance.
if(ANDROID_ABI MATCHES "^armeabi" AND NOT ANDROID_ARM_MODE)
set(ANDROID_ARM_MODE arm)
endif()

Expand Down
Loading

0 comments on commit 9522c22

Please sign in to comment.