diff --git a/CMakeLists.txt b/CMakeLists.txt index c5c0e09..1ae35a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,12 @@ option(BUILD_FOR_GLTF "" OFF) option(BUILD_MAYA_PLUGIN "Build plugin library for Maya." OFF) option(BUILD_USD_PLUGIN "Build plugin library for USD." OFF) +if(${CMAKE_CXX_COMPILER_ID} MATCHES GNU + AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 5) + message(WARNING "GNU/GCC VERSION LESS THAN 5, ENABLING COMPATIBILITY MODE.") + draco_enable_feature(FEATURE "DRACO_OLD_GCC") +endif() + if(BUILD_FOR_GLTF) # Override settings when building for GLTF. draco_enable_feature(FEATURE "DRACO_MESH_COMPRESSION_SUPPORTED") diff --git a/src/draco/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_decoder.h b/src/draco/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_decoder.h index e220a2a..61a1535 100644 --- a/src/draco/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_decoder.h +++ b/src/draco/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_decoder.h @@ -95,8 +95,11 @@ class DynamicIntegerPointsKdTreeDecoder { // Decodes a integer point cloud from |buffer|. template bool DecodePoints(DecoderBuffer *buffer, OutputIteratorT &oit); + +#ifndef DRACO_OLD_GCC template bool DecodePoints(DecoderBuffer *buffer, OutputIteratorT &&oit); +#endif // DRACO_OLD_GCC const uint32_t dimension() const { return dimension_; } @@ -138,6 +141,7 @@ class DynamicIntegerPointsKdTreeDecoder { }; // Decodes a point cloud from |buffer|. +#ifndef DRACO_OLD_GCC template template bool DynamicIntegerPointsKdTreeDecoder::DecodePoints( @@ -145,6 +149,7 @@ bool DynamicIntegerPointsKdTreeDecoder::DecodePoints( OutputIteratorT local = std::forward(oit); return DecodePoints(buffer, local); } +#endif // DRACO_OLD_GCC template template diff --git a/src/draco/compression/point_cloud/algorithms/float_points_tree_decoder.h b/src/draco/compression/point_cloud/algorithms/float_points_tree_decoder.h index 80be0c9..2e8d66e 100644 --- a/src/draco/compression/point_cloud/algorithms/float_points_tree_decoder.h +++ b/src/draco/compression/point_cloud/algorithms/float_points_tree_decoder.h @@ -33,8 +33,12 @@ class FloatPointsTreeDecoder { // Decodes a point cloud from |buffer|. template bool DecodePointCloud(DecoderBuffer *buffer, OutputIteratorT &out); + +#ifndef DRACO_OLD_GCC template bool DecodePointCloud(DecoderBuffer *buffer, OutputIteratorT &&out); +#endif // BUILD_OLD_GCC + // Initializes a DecoderBuffer from |data|, and calls function above. template bool DecodePointCloud(const char *data, size_t data_size, @@ -72,12 +76,16 @@ class FloatPointsTreeDecoder { uint32_t compression_level_; }; +#ifndef DRACO_OLD_GCC +// TODO(vytyaz): Reenable once USD migrates from GCC 4.8 to a higher version +// that can disambiguate calls to overloaded methods taking rvalue reference. template bool FloatPointsTreeDecoder::DecodePointCloud(DecoderBuffer *buffer, OutputIteratorT &&out) { OutputIteratorT local = std::forward(out); return DecodePointCloud(buffer, local); } +#endif // BUILD_OLD_GCC template bool FloatPointsTreeDecoder::DecodePointCloud(DecoderBuffer *buffer,