Skip to content

Commit

Permalink
Updated snapshot to 1.3.5
Browse files Browse the repository at this point in the history
* Added option to build Draco for Universal Scene Description
* Code cleanup
* Bug fixes
  • Loading branch information
Igor Vytyaz committed Jan 31, 2019
1 parent e9337d1 commit 8833cf8
Show file tree
Hide file tree
Showing 93 changed files with 1,195 additions and 692 deletions.
46 changes: 29 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

if (NOT CMAKE_BUILD_TYPE AND NOT IGNORE_EMPTY_BUILD_TYPE)
if (CMAKE_CURRENT_LIST_FILE STREQUAL CMAKE_PARENT_LIST_FILE)
message(INFO "|Draco: ignoring empty build type, forcing release mode.")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Draco overridden build type"
FORCE)
endif ()
endif ()

project(draco C CXX)

set(draco_root "${CMAKE_CURRENT_SOURCE_DIR}")
Expand Down Expand Up @@ -41,10 +50,11 @@ option(ENABLE_WASM "" OFF)
option(ENABLE_WERROR "" OFF)
option(ENABLE_WEXTRA "" OFF)
option(IGNORE_EMPTY_BUILD_TYPE "" OFF)
option(BUILD_UNITY_PLUGIN "Build plugin library for Unity" OFF)
option(BUILD_UNITY_PLUGIN "Build plugin library for Unity." OFF)
option(BUILD_ANIMATION_ENCODING "" OFF)
option(BUILD_FOR_GLTF "" OFF)
option(BUILD_MAYA_PLUGIN "Build plugin library for Maya" OFF)
option(BUILD_MAYA_PLUGIN "Build plugin library for Maya." OFF)
option(BUILD_USD_PLUGIN "Build plugin library for USD." OFF)

if (WIN32 AND BUILD_SHARED_LIBS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
Expand All @@ -54,13 +64,15 @@ endif ()
if (BUILD_FOR_GLTF)
# Override settings when building for GLTF.
draco_enable_feature(FEATURE "DRACO_MESH_COMPRESSION_SUPPORTED")
draco_enable_feature(FEATURE "DRACO_NORMAL_ENCODING_SUPPORTED")
draco_enable_feature(FEATURE "DRACO_STANDARD_EDGEBREAKER_SUPPORTED")
else ()
if (ENABLE_POINT_CLOUD_COMPRESSION)
draco_enable_feature(FEATURE "DRACO_POINT_CLOUD_COMPRESSION_SUPPORTED")
endif ()
if (ENABLE_MESH_COMPRESSION)
draco_enable_feature(FEATURE "DRACO_MESH_COMPRESSION_SUPPORTED")
draco_enable_feature(FEATURE "DRACO_NORMAL_ENCODING_SUPPORTED")

if (ENABLE_STANDARD_EDGEBREAKER)
draco_enable_feature(FEATURE "DRACO_STANDARD_EDGEBREAKER_SUPPORTED")
Expand Down Expand Up @@ -120,6 +132,10 @@ if (BUILD_MAYA_PLUGIN)
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared library for maya plugin.")
draco_enable_feature(FEATURE "BUILD_MAYA_PLUGIN")
endif ()
if (BUILD_USD_PLUGIN)
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared library for USD plugin.")
draco_enable_feature(FEATURE "BUILD_USD_PLUGIN")
endif ()

if (ENABLE_EXTRA_SPEED)
if (MSVC)
Expand Down Expand Up @@ -164,17 +180,6 @@ configure_file("${draco_root}/cmake/draco_version.cc.cmake"
configure_file("${draco_root}/cmake/draco_version.h.cmake"
"${draco_build_dir}/draco_version.h" COPYONLY)

# When a build type is not specified, default to producing a release mode Draco
# library to avoid benchmarking shenanigans, but only when Draco is not being
# pulled in via another cmake file.
if (CMAKE_BUILD_TYPE STREQUAL "" AND NOT IGNORE_EMPTY_BUILD_TYPE)
if (CMAKE_CURRENT_LIST_FILE STREQUAL CMAKE_PARENT_LIST_FILE)
message(INFO "|Draco: ignoring empty build type, forcing release mode.")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Draco overridden build type"
FORCE)
endif ()
endif ()

if (EMSCRIPTEN)
include(FindPythonInterp)
if (NOT PYTHONINTERP_FOUND)
Expand Down Expand Up @@ -468,12 +473,14 @@ set(draco_core_sources
"${draco_src_root}/core/quantization_utils.cc"
"${draco_src_root}/core/quantization_utils.h"
"${draco_src_root}/core/status.h"
"${draco_src_root}/core/statusor.h"
"${draco_src_root}/core/status_or.h"
"${draco_src_root}/core/varint_decoding.h"
"${draco_src_root}/core/varint_encoding.h"
"${draco_src_root}/core/vector_d.h")

set(draco_io_sources
"${draco_src_root}/io/file_utils.cc"
"${draco_src_root}/io/file_utils.h"
"${draco_src_root}/io/mesh_io.cc"
"${draco_src_root}/io/mesh_io.h"
"${draco_src_root}/io/obj_decoder.cc"
Expand Down Expand Up @@ -798,10 +805,14 @@ if (EMSCRIPTEN AND ENABLE_JS_GLUE)
append_link_flag_to_target(draco_encoder
"-s EXPORT_NAME=\"'DracoEncoderModule'\"")

draco_enable_feature(FEATURE DRACO_ATTRIBUTE_DEDUPLICATION_SUPPORTED
draco_enable_feature(FEATURE DRACO_ATTRIBUTE_INDICES_DEDUPLICATION_SUPPORTED
TARGETS draco_encoder)
draco_enable_feature(FEATURE DRACO_ATTRIBUTE_VALUES_DEDUPLICATION_SUPPORTED
TARGETS draco_encoder)
if (ENABLE_DECODER_ATTRIBUTE_DEDUPLICATION)
draco_enable_feature(FEATURE DRACO_ATTRIBUTE_DEDUPLICATION_SUPPORTED
draco_enable_feature(FEATURE DRACO_ATTRIBUTE_INDICES_DEDUPLICATION_SUPPORTED
TARGETS draco_decoder)
draco_enable_feature(FEATURE DRACO_ATTRIBUTE_VALUES_DEDUPLICATION_SUPPORTED
TARGETS draco_decoder)
endif ()

Expand Down Expand Up @@ -1059,7 +1070,8 @@ else ()
# For now, enable deduplication for both encoder and decoder.
# TODO(ostava): Support for disabling attribute deduplication for the C++
# decoder is planned in future releases.
draco_enable_feature(FEATURE DRACO_ATTRIBUTE_DEDUPLICATION_SUPPORTED)
draco_enable_feature(FEATURE DRACO_ATTRIBUTE_INDICES_DEDUPLICATION_SUPPORTED)
draco_enable_feature(FEATURE DRACO_ATTRIBUTE_VALUES_DEDUPLICATION_SUPPORTED)

if (BUILD_SHARED_LIBS)
set_target_properties(dracodec PROPERTIES SOVERSION 1)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ frustration later on.
### Code reviews
All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose.
Please make sure that your code is conform with our
Please make sure that your code conforms with our
[coding style guidelines](https://google.github.io/styleguide/cppguide.html).

### The small print
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

News
=======
### Version 1.3.5 release
* Added option to build Draco for Universal Scene Description
* Code cleanup
* Bug fixes

### Version 1.3.4 release
* Released Draco Animation code
* Fixes for Unity
Expand Down
20 changes: 0 additions & 20 deletions cmake/compiler_tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,4 @@ macro(draco_check_source_compiles test_name test_source result_var)
endif ()
endmacro ()

# When inline support is detected for the current compiler the supported
# inlining keyword is written to $result in caller scope.
macro (draco_get_inline result)
draco_check_source_compiles("inline_check_1"
"static inline void macro(void) {}"
HAVE_INLINE_1)
if (HAVE_INLINE_1 EQUAL 1)
set(${result} "inline")
return()
endif ()

# Check __inline.
draco_check_source_compiles("inline_check_2"
"static __inline void macro(void) {}"
HAVE_INLINE_2)
if (HAVE_INLINE_2 EQUAL 1)
set(${result} "__inline")
endif ()
endmacro ()

endif () # DRACO_CMAKE_COMPILER_TESTS_CMAKE_
12 changes: 6 additions & 6 deletions javascript/draco_decoder.js

Large diffs are not rendered by default.

Binary file modified javascript/draco_decoder.wasm
Binary file not shown.
10 changes: 5 additions & 5 deletions javascript/draco_decoder_gltf.js

Large diffs are not rendered by default.

Binary file modified javascript/draco_decoder_gltf.wasm
Binary file not shown.
14 changes: 7 additions & 7 deletions javascript/draco_encoder.js

Large diffs are not rendered by default.

Loading

0 comments on commit 8833cf8

Please sign in to comment.