Compare commits
142 Commits
temp-geome
...
attribute-
Author | SHA1 | Date | |
---|---|---|---|
04147e2864 | |||
9a157d6532 | |||
7234fd5b31 | |||
6b8a52e2b1 | |||
2eb00bd479 | |||
d755281413 | |||
0e9567c63c | |||
1faab5c82d | |||
d3e05090a8 | |||
a889254974 | |||
3c020f9416 | |||
8786624534 | |||
52e3608fe9 | |||
6ba6e97407 | |||
4913b624d8 | |||
96ce1e9a95 | |||
a3efa1d798 | |||
e50553c61a | |||
b458ea6b23 | |||
056d7bb175 | |||
![]() |
9769cf1ee6 | ||
4a2734a835 | |||
1ddd717803 | |||
0066e59f2d | |||
ec7fffb033 | |||
956cf9a48d | |||
c27095b5cb | |||
![]() |
8ef8cb7e34 | ||
0f6bee8e54 | |||
3093f89498 | |||
f211030344 | |||
b277025d8e | |||
94572a4e30 | |||
bc2230df71 | |||
caa942b033 | |||
5dff952b67 | |||
5877e34eb4 | |||
770bcfac9b | |||
b081108819 | |||
2be7b2aaf9 | |||
912b38001f | |||
c4352f44bc | |||
0feca5f07d | |||
2984fb2b49 | |||
9e6553c0d4 | |||
107a0894cc | |||
8ecc1bea4c | |||
91ad33ef8f | |||
fa5190e742 | |||
74ed591f62 | |||
3d5efb4335 | |||
![]() |
140b7cfe0d | ||
af7cc3f8bb | |||
d2c4af9865 | |||
e5c637f5fe | |||
11d12d543d | |||
2c6114b238 | |||
152bd43ae1 | |||
45012c3309 | |||
5177c35498 | |||
49c8042f29 | |||
![]() |
f8c52590c0 | ||
0b897e0308 | |||
c34438dd78 | |||
e0a4dc9396 | |||
51fa44522f | |||
343e13f464 | |||
1103809fab | |||
5b89d49b0d | |||
e805bfc768 | |||
67cb4fdbdc | |||
8ed74c9daf | |||
d7cb25e028 | |||
e3395093ff | |||
f73a420e5a | |||
b8b240b329 | |||
ae2827bb52 | |||
bb97284f8a | |||
209e82da45 | |||
e63d43e6b9 | |||
802ba35654 | |||
79c9c11b35 | |||
e1d0ab2dbc | |||
687f994251 | |||
5c7767e0e0 | |||
af9ee8e2bc | |||
562f2e604a | |||
84e81b8cc3 | |||
5ae9527770 | |||
082c17a2d2 | |||
09677d737c | |||
bec7248178 | |||
0103cb2051 | |||
9f38ebefcb | |||
8f934852f0 | |||
cb16db7803 | |||
f8965f12a1 | |||
7f2a20f89b | |||
5566818603 | |||
9a06c6a040 | |||
e097116072 | |||
b844caca6d | |||
046ac5fccd | |||
ef4fbba596 | |||
aa8360d0fa | |||
76c356c12e | |||
e04491073d | |||
a5dda5996e | |||
c48e4b7a44 | |||
4ae2d6206a | |||
47f5a635da | |||
eb8574bc8b | |||
bc4e31afb6 | |||
9d7672be71 | |||
994e7178bb | |||
1719743066 | |||
8910033f57 | |||
2a4c6c612a | |||
b062b922f9 | |||
895f4620a0 | |||
fafed6234b | |||
7ff8094a8b | |||
5aabf67a9c | |||
ab8c7fe946 | |||
a05012d500 | |||
97a93566e9 | |||
da4d697772 | |||
87218899be | |||
ffa0a6df9d | |||
706fa5ad76 | |||
b7f6de490d | |||
7e485b4620 | |||
a7dba81aab | |||
4606e83a75 | |||
1d28de57a4 | |||
3cfcfb938d | |||
bcdc6910a0 | |||
7793e8c884 | |||
05d9bd7c4a | |||
9255ce9247 | |||
a0ce0154e7 | |||
0cd7f7ddd1 |
@@ -29,19 +29,23 @@ Checks: >
|
||||
-bugprone-sizeof-expression,
|
||||
-bugprone-integer-division,
|
||||
|
||||
-bugprone-exception-escape,
|
||||
-bugprone-redundant-branch-condition,
|
||||
|
||||
modernize-*,
|
||||
-modernize-use-auto,
|
||||
-modernize-use-trailing-return-type,
|
||||
-modernize-deprecated-headers,
|
||||
-modernize-avoid-c-arrays,
|
||||
-modernize-use-equals-default,
|
||||
-modernize-use-nodiscard,
|
||||
-modernize-use-using,
|
||||
-modernize-loop-convert,
|
||||
-modernize-pass-by-value,
|
||||
-modernize-use-default-member-init,
|
||||
-modernize-raw-string-literal,
|
||||
-modernize-avoid-bind,
|
||||
-modernize-use-override,
|
||||
-modernize-use-transparent-functors,
|
||||
|
||||
WarningsAsErrors: '*'
|
||||
|
@@ -10,9 +10,8 @@
|
||||
# Changes that belong here:
|
||||
# - Massive comment, doxy-sections, or spelling corrections.
|
||||
# - Clang-format, PEP8 or other automated changes which are *strictly* "no functional change".
|
||||
# - Several commits should be added to this list at once, because adding
|
||||
# one extra commit (to edit this file) after every cleanup is noisy.
|
||||
# - No clang-tidy changes.
|
||||
# - Several smaller commits should be added to this list at once, because adding
|
||||
# one extra commit (to edit this file) after every small cleanup is noisy.
|
||||
#
|
||||
# Note:
|
||||
# - The comment above the SHA should be the first line of the commit.
|
||||
@@ -92,13 +91,3 @@ c42a6b77b52560d257279de2cb624b4ef2c0d24c
|
||||
|
||||
# Cleanup: use doxy sections for imbuf
|
||||
c207f7c22e1439e0b285fba5d2c072bdae23f981
|
||||
|
||||
# Cleanup: clang-format
|
||||
c4d8f6a4a8ddc29ed27311ed7578b3c8c31399d2
|
||||
b5d310b569e07a937798a2d38539cfd290149f1c
|
||||
8c846cccd6bdfd3e90a695fabbf05f53e5466a57
|
||||
4eac03d821fa17546f562485f7d073813a5e5943
|
||||
1166110a9d66af9c5a47cee2be591f50fdc445e8
|
||||
|
||||
# Cleanup: clang-format.
|
||||
40d4a4cb1a6b4c3c2a486e8f2868f547530e0811
|
||||
|
@@ -178,7 +178,6 @@ mark_as_advanced(BUILDINFO_OVERRIDE_TIME)
|
||||
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
|
||||
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
|
||||
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke, ocean sim, and audio effects)" ON)
|
||||
option(WITH_PUGIXML "Enable PugiXML support (Used for OpenImageIO, Grease Pencil SVG export)" ON)
|
||||
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
|
||||
mark_as_advanced(WITH_SYSTEM_BULLET)
|
||||
@@ -205,7 +204,6 @@ option(WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if
|
||||
option(WITH_OPENVDB_3_ABI_COMPATIBLE "Assume OpenVDB library has been compiled with version 3 ABI compatibility" OFF)
|
||||
mark_as_advanced(WITH_OPENVDB_3_ABI_COMPATIBLE)
|
||||
option(WITH_NANOVDB "Enable usage of NanoVDB data structure for rendering on the GPU" ON)
|
||||
option(WITH_HARU "Enable features relying on Libharu (Grease pencil PDF export)" ON)
|
||||
|
||||
# GHOST Windowing Library Options
|
||||
option(WITH_GHOST_DEBUG "Enable debugging output for the GHOST library" OFF)
|
||||
@@ -348,21 +346,16 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
|
||||
|
||||
if((WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE) OR WITH_MOD_FLUID)
|
||||
option(WITH_PYTHON_NUMPY "Include NumPy in Blender (used by Audaspace and Mantaflow)" ON)
|
||||
endif()
|
||||
|
||||
if(WIN32 OR APPLE)
|
||||
# Windows and macOS have this bundled with Python libraries.
|
||||
elseif(WITH_PYTHON_INSTALL OR WITH_PYTHON_NUMPY)
|
||||
elseif(WITH_PYTHON_INSTALL OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
|
||||
set(PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
|
||||
mark_as_advanced(PYTHON_NUMPY_PATH)
|
||||
set(PYTHON_NUMPY_INCLUDE_DIRS "" CACHE PATH "Path to the include directory of the NumPy module")
|
||||
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
|
||||
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
|
||||
endif()
|
||||
if(WITH_PYTHON_INSTALL)
|
||||
option(WITH_PYTHON_INSTALL_NUMPY "Copy system NumPy into the blender install folder" ON)
|
||||
option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON)
|
||||
@@ -384,7 +377,6 @@ option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
|
||||
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
|
||||
option(WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF)
|
||||
mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
|
||||
set(CYCLES_TEST_DEVICES CPU CACHE STRING "Run regression tests on the specified device types (CPU CUDA OPTIX OPENCL)" )
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 sm_86 compute_75 CACHE STRING "CUDA architectures to build binaries for")
|
||||
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
|
||||
unset(PLATFORM_DEFAULT)
|
||||
@@ -433,8 +425,8 @@ mark_as_advanced(WITH_CXX_GUARDEDALLOC)
|
||||
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" ON)
|
||||
mark_as_advanced(WITH_ASSERT_ABORT)
|
||||
|
||||
if((UNIX AND NOT APPLE) OR (CMAKE_GENERATOR MATCHES "^Visual Studio.+"))
|
||||
option(WITH_CLANG_TIDY "Use Clang Tidy to analyze the source code (only enable for development on Linux using Clang, or Windows using the Visual Studio IDE)" OFF)
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_CLANG_TIDY "Use Clang Tidy to analyze the source code (only enable for development on Linux using Clang)" OFF)
|
||||
mark_as_advanced(WITH_CLANG_TIDY)
|
||||
endif()
|
||||
|
||||
@@ -611,11 +603,6 @@ if(WIN32)
|
||||
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
# See WITH_WINDOWS_SCCACHE for Windows.
|
||||
option(WITH_COMPILER_CCACHE "Use ccache to improve rebuild times (Works with Ninja, Makefiles and Xcode)" OFF)
|
||||
endif()
|
||||
|
||||
# The following only works with the Ninja generator in CMake >= 3.0.
|
||||
if("${CMAKE_GENERATOR}" MATCHES "Ninja")
|
||||
option(WITH_NINJA_POOL_JOBS
|
||||
@@ -710,8 +697,6 @@ set_and_warn_dependency(WITH_BOOST WITH_OPENCOLORIO OFF)
|
||||
set_and_warn_dependency(WITH_BOOST WITH_QUADRIFLOW OFF)
|
||||
set_and_warn_dependency(WITH_BOOST WITH_USD OFF)
|
||||
set_and_warn_dependency(WITH_BOOST WITH_ALEMBIC OFF)
|
||||
set_and_warn_dependency(WITH_PUGIXML WITH_CYCLES_OSL OFF)
|
||||
set_and_warn_dependency(WITH_PUGIXML WITH_OPENIMAGEIO OFF)
|
||||
|
||||
if(WITH_BOOST AND NOT (WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
|
||||
WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_USD OR WITH_ALEMBIC))
|
||||
@@ -731,9 +716,6 @@ set_and_warn_dependency(WITH_OPENVDB WITH_NANOVDB OFF)
|
||||
# OpenVDB uses 'half' type from OpenEXR & fails to link without OpenEXR enabled.
|
||||
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENVDB OFF)
|
||||
|
||||
# Haru needs `TIFFFaxBlackCodes` & `TIFFFaxWhiteCodes` symbols from TIFF.
|
||||
set_and_warn_dependency(WITH_IMAGE_TIFF WITH_HARU OFF)
|
||||
|
||||
# auto enable openimageio for cycles
|
||||
if(WITH_CYCLES)
|
||||
set(WITH_OPENIMAGEIO ON)
|
||||
@@ -893,11 +875,9 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
|
||||
if(APPLE AND COMPILER_ASAN_LIBRARY)
|
||||
string(REPLACE " " ";" _list_COMPILER_ASAN_CFLAGS ${COMPILER_ASAN_CFLAGS})
|
||||
set(_is_CONFIG_DEBUG "$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>")
|
||||
add_compile_options("$<${_is_CONFIG_DEBUG}:${_list_COMPILER_ASAN_CFLAGS}>")
|
||||
add_link_options("$<${_is_CONFIG_DEBUG}:-fno-omit-frame-pointer;-fsanitize=address>")
|
||||
add_compile_options("$<$<NOT:$<CONFIG:Release>>:${_list_COMPILER_ASAN_CFLAGS}>")
|
||||
add_link_options("$<$<NOT:$<CONFIG:Release>>:-fno-omit-frame-pointer;-fsanitize=address>")
|
||||
unset(_list_COMPILER_ASAN_CFLAGS)
|
||||
unset(_is_CONFIG_DEBUG)
|
||||
elseif(COMPILER_ASAN_LIBRARY)
|
||||
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}")
|
||||
set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
|
||||
@@ -1635,16 +1615,19 @@ if(WITH_PYTHON)
|
||||
|
||||
if(WIN32 OR APPLE)
|
||||
# Windows and macOS have this bundled with Python libraries.
|
||||
elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR WITH_PYTHON_NUMPY)
|
||||
elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
|
||||
if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND))
|
||||
find_python_package(numpy "core/include")
|
||||
find_python_package(numpy)
|
||||
unset(PYTHON_NUMPY_INCLUDE_DIRS CACHE)
|
||||
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
|
||||
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32 OR APPLE)
|
||||
# pass, we have this in lib/python/site-packages
|
||||
elseif(WITH_PYTHON_INSTALL_REQUESTS)
|
||||
find_python_package(requests "")
|
||||
find_python_package(requests)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1767,20 +1750,8 @@ if(WITH_BLENDER)
|
||||
# internal and external library information first, for test linking
|
||||
add_subdirectory(source)
|
||||
elseif(WITH_CYCLES_STANDALONE)
|
||||
add_subdirectory(intern/glew-mx)
|
||||
add_subdirectory(intern/guardedalloc)
|
||||
add_subdirectory(intern/libc_compat)
|
||||
add_subdirectory(intern/numaapi)
|
||||
add_subdirectory(intern/sky)
|
||||
|
||||
add_subdirectory(intern/cycles)
|
||||
add_subdirectory(extern/clew)
|
||||
if(WITH_CYCLES_LOGGING)
|
||||
if(NOT WITH_SYSTEM_GFLAGS)
|
||||
add_subdirectory(extern/gflags)
|
||||
endif()
|
||||
add_subdirectory(extern/glog)
|
||||
endif()
|
||||
if(WITH_CUDA_DYNLOAD)
|
||||
add_subdirectory(extern/cuew)
|
||||
endif()
|
||||
@@ -1789,10 +1760,6 @@ elseif(WITH_CYCLES_STANDALONE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Testing
|
||||
add_subdirectory(tests)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Blender Application
|
||||
if(WITH_BLENDER)
|
||||
@@ -1800,6 +1767,11 @@ if(WITH_BLENDER)
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Testing
|
||||
add_subdirectory(tests)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Define 'heavy' submodules (for Ninja builder when using pools).
|
||||
setup_heavy_lib_pool()
|
||||
@@ -1853,7 +1825,6 @@ if(FIRST_RUN)
|
||||
info_cfg_option(WITH_FFTW3)
|
||||
info_cfg_option(WITH_FREESTYLE)
|
||||
info_cfg_option(WITH_GMP)
|
||||
info_cfg_option(WITH_HARU)
|
||||
info_cfg_option(WITH_IK_ITASC)
|
||||
info_cfg_option(WITH_IK_SOLVER)
|
||||
info_cfg_option(WITH_INPUT_NDOF)
|
||||
@@ -1862,8 +1833,6 @@ if(FIRST_RUN)
|
||||
info_cfg_option(WITH_OPENCOLORIO)
|
||||
info_cfg_option(WITH_OPENIMAGEDENOISE)
|
||||
info_cfg_option(WITH_OPENVDB)
|
||||
info_cfg_option(WITH_POTRACE)
|
||||
info_cfg_option(WITH_PUGIXML)
|
||||
info_cfg_option(WITH_QUADRIFLOW)
|
||||
info_cfg_option(WITH_TBB)
|
||||
info_cfg_option(WITH_USD)
|
||||
|
19
GNUmakefile
19
GNUmakefile
@@ -41,7 +41,6 @@ Convenience Targets
|
||||
* developer: Enable faster builds, error checking and tests, recommended for developers.
|
||||
* config: Run cmake configuration tool to set build options.
|
||||
* ninja: Use ninja build tool for faster builds.
|
||||
* ccache: Use ccache for faster rebuilds.
|
||||
|
||||
Note: passing the argument 'BUILD_DIR=path' when calling make will override the default build dir.
|
||||
Note: passing the argument 'BUILD_CMAKE_ARGS=args' lets you add cmake arguments.
|
||||
@@ -183,13 +182,8 @@ endif
|
||||
ifndef DEPS_INSTALL_DIR
|
||||
DEPS_INSTALL_DIR:=$(shell dirname "$(BLENDER_DIR)")/lib/$(OS_NCASE)
|
||||
|
||||
# Add processor type to directory name, except for darwin x86_64
|
||||
# which by convention does not have it.
|
||||
ifeq ($(OS_NCASE),darwin)
|
||||
ifneq ($(CPU),x86_64)
|
||||
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(CPU)
|
||||
endif
|
||||
else
|
||||
ifneq ($(OS_NCASE),darwin)
|
||||
# Add processor type to directory name
|
||||
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(CPU)
|
||||
endif
|
||||
endif
|
||||
@@ -203,7 +197,7 @@ endif
|
||||
# in libraries, or python 2 for running make update to get it.
|
||||
ifeq ($(OS_NCASE),darwin)
|
||||
ifeq (, $(shell command -v $(PYTHON)))
|
||||
PYTHON:=$(DEPS_INSTALL_DIR)/python/bin/python3.7m
|
||||
PYTHON:=../lib/darwin/python/bin/python3.7m
|
||||
ifeq (, $(shell command -v $(PYTHON)))
|
||||
PYTHON:=python
|
||||
endif
|
||||
@@ -247,10 +241,6 @@ ifneq "$(findstring developer, $(MAKECMDGOALS))" ""
|
||||
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_developer.cmake" $(CMAKE_CONFIG_ARGS)
|
||||
endif
|
||||
|
||||
ifneq "$(findstring ccache, $(MAKECMDGOALS))" ""
|
||||
CMAKE_CONFIG_ARGS:=-DWITH_COMPILER_CCACHE=YES $(CMAKE_CONFIG_ARGS)
|
||||
endif
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# build tool
|
||||
|
||||
@@ -350,7 +340,6 @@ headless: all
|
||||
bpy: all
|
||||
developer: all
|
||||
ninja: all
|
||||
ccache: all
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Build dependencies
|
||||
@@ -525,7 +514,7 @@ format: .FORCE
|
||||
|
||||
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
|
||||
doc_py: .FORCE
|
||||
ASAN_OPTIONS=halt_on_error=0:${ASAN_OPTIONS} \
|
||||
ASAN_OPTIONS=halt_on_error=0 \
|
||||
$(BLENDER_BIN) --background -noaudio --factory-startup \
|
||||
--python doc/python_api/sphinx_doc_gen.py
|
||||
sphinx-build -b html -j $(NPROCS) doc/python_api/sphinx-in doc/python_api/sphinx-out
|
||||
|
@@ -92,10 +92,13 @@ include(cmake/package_python.cmake)
|
||||
include(cmake/numpy.cmake)
|
||||
include(cmake/usd.cmake)
|
||||
include(cmake/potrace.cmake)
|
||||
include(cmake/haru.cmake)
|
||||
# Boost needs to be included after python.cmake due to the PYTHON_BINARY variable being needed.
|
||||
include(cmake/boost.cmake)
|
||||
include(cmake/pugixml.cmake)
|
||||
if(UNIX)
|
||||
# Rely on PugiXML compiled with OpenImageIO
|
||||
else()
|
||||
include(cmake/pugixml.cmake)
|
||||
endif()
|
||||
if((NOT APPLE) OR ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
|
||||
include(cmake/ispc.cmake)
|
||||
include(cmake/openimagedenoise.cmake)
|
||||
|
@@ -42,13 +42,7 @@ if(UNIX)
|
||||
endforeach()
|
||||
|
||||
if(APPLE)
|
||||
# Homebrew has different default locations for ARM and Intel macOS.
|
||||
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
|
||||
set(HOMEBREW_LOCATION "/opt/homebrew")
|
||||
else()
|
||||
set(HOMEBREW_LOCATION "/usr/local")
|
||||
endif()
|
||||
if(NOT EXISTS "${HOMEBREW_LOCATION}/opt/bison/bin/bison")
|
||||
if(NOT EXISTS "/usr/local/opt/bison/bin/bison")
|
||||
string(APPEND _software_missing " bison")
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -17,14 +17,13 @@
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
set(CLANG_EXTRA_ARGS
|
||||
-DLLVM_DIR="${LIBDIR}/llvm/lib/cmake/llvm/"
|
||||
-DCLANG_PATH_TO_LLVM_SOURCE=${BUILD_DIR}/ll/src/ll
|
||||
-DCLANG_PATH_TO_LLVM_BUILD=${LIBDIR}/llvm
|
||||
-DLLVM_USE_CRT_RELEASE=MD
|
||||
-DLLVM_USE_CRT_DEBUG=MDd
|
||||
-DLLVM_CONFIG=${LIBDIR}/llvm/bin/llvm-config
|
||||
)
|
||||
|
||||
set(BUILD_CLANG_TOOLS OFF)
|
||||
|
||||
if(WIN32)
|
||||
set(CLANG_GENERATOR "Ninja")
|
||||
else()
|
||||
@@ -32,32 +31,11 @@ else()
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
set(BUILD_CLANG_TOOLS ON)
|
||||
set(CLANG_EXTRA_ARGS ${CLANG_EXTRA_ARGS}
|
||||
-DLIBXML2_LIBRARY=${LIBDIR}/xml2/lib/libxml2.a
|
||||
)
|
||||
endif()
|
||||
|
||||
if(BUILD_CLANG_TOOLS)
|
||||
# ExternalProject_Add does not allow multiple tarballs to be
|
||||
# downloaded. Work around this by having an empty build action
|
||||
# for the extra tools, and referring the clang build to the location
|
||||
# of the clang-tools-extra source.
|
||||
ExternalProject_Add(external_clang_tools
|
||||
URL ${CLANG_TOOLS_URI}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH MD5=${CLANG_TOOLS_HASH}
|
||||
INSTALL_DIR ${LIBDIR}/clang_tools
|
||||
PREFIX ${BUILD_DIR}/clang_tools
|
||||
CONFIGURE_COMMAND echo "."
|
||||
BUILD_COMMAND echo "."
|
||||
INSTALL_COMMAND echo "."
|
||||
)
|
||||
list(APPEND CLANG_EXTRA_ARGS
|
||||
-DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=${BUILD_DIR}/clang_tools/src/external_clang_tools/
|
||||
)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(external_clang
|
||||
URL ${CLANG_URI}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
@@ -87,14 +65,6 @@ add_dependencies(
|
||||
ll
|
||||
)
|
||||
|
||||
if(BUILD_CLANG_TOOLS)
|
||||
# `external_clang_tools` is for downloading the source, not compiling it.
|
||||
add_dependencies(
|
||||
external_clang
|
||||
external_clang_tools
|
||||
)
|
||||
endif()
|
||||
|
||||
# We currently do not build libxml2 on Windows.
|
||||
if(NOT WIN32)
|
||||
add_dependencies(
|
||||
|
@@ -1,46 +0,0 @@
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
set(HARU_EXTRA_ARGS
|
||||
-DLIBHPDF_SHARED=OFF
|
||||
-DLIBHPDF_STATIC=ON
|
||||
-DLIBHPDF_EXAMPLES=OFF
|
||||
-DLIBHPDF_ENABLE_EXCEPTIONS=ON
|
||||
)
|
||||
|
||||
ExternalProject_Add(external_haru
|
||||
URL ${HARU_URI}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH MD5=${HARU_HASH}
|
||||
PREFIX ${BUILD_DIR}/haru
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/haru/src/external_haru < ${PATCH_DIR}/haru.diff
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/haru
|
||||
${DEFAULT_CMAKE_FLAGS} ${HARU_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/haru
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
ExternalProject_Add_Step(external_haru after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/haru/include ${HARVEST_TARGET}/haru/include
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/haru/lib/libhpdfs.lib ${HARVEST_TARGET}/haru/lib/libhpdfs.lib
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
||||
endif()
|
@@ -98,10 +98,6 @@ harvest(jpg/include jpeg/include "*.h")
|
||||
harvest(jpg/lib jpeg/lib "libjpeg.a")
|
||||
harvest(lame/lib ffmpeg/lib "*.a")
|
||||
harvest(clang/bin llvm/bin "clang-format")
|
||||
if(BUILD_CLANG_TOOLS)
|
||||
harvest(clang/bin llvm/bin "clang-tidy")
|
||||
harvest(clang/share/clang llvm/share "run-clang-tidy.py")
|
||||
endif()
|
||||
harvest(clang/include llvm/include "*")
|
||||
harvest(llvm/include llvm/include "*")
|
||||
harvest(llvm/bin llvm/bin "llvm-config")
|
||||
@@ -160,8 +156,6 @@ harvest(osl/lib osl/lib "*.a")
|
||||
harvest(osl/shaders osl/shaders "*.h")
|
||||
harvest(png/include png/include "*.h")
|
||||
harvest(png/lib png/lib "*.a")
|
||||
harvest(pugixml/include pugixml/include "*.hpp")
|
||||
harvest(pugixml/lib pugixml/lib "*.a")
|
||||
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}m")
|
||||
harvest(python/include python/include "*h")
|
||||
harvest(python/lib python/lib "*")
|
||||
@@ -187,8 +181,6 @@ harvest(usd/lib/usd usd/lib/usd "*")
|
||||
harvest(usd/plugin usd/plugin "*")
|
||||
harvest(potrace/include potrace/include "*.h")
|
||||
harvest(potrace/lib potrace/lib "*.a")
|
||||
harvest(haru/include haru/include "*.h")
|
||||
harvest(haru/lib haru/lib "*.a")
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
harvest(libglu/lib mesa/lib "*.so*")
|
||||
|
@@ -25,13 +25,8 @@ if(WIN32)
|
||||
elseif(APPLE)
|
||||
# Use bison installed via Homebrew.
|
||||
# The one which comes which Xcode toolset is too old.
|
||||
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
|
||||
set(HOMEBREW_LOCATION "/opt/homebrew")
|
||||
else()
|
||||
set(HOMEBREW_LOCATION "/usr/local")
|
||||
endif()
|
||||
set(ISPC_EXTRA_ARGS_APPLE
|
||||
-DBISON_EXECUTABLE=${HOMEBREW_LOCATION}/opt/bison/bin/bison
|
||||
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
|
||||
)
|
||||
elseif(UNIX)
|
||||
set(ISPC_EXTRA_ARGS_UNIX
|
||||
|
@@ -112,9 +112,6 @@ set(OPENIMAGEIO_EXTRA_ARGS
|
||||
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
||||
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
||||
-DSTOP_ON_WARNING=OFF
|
||||
-DUSE_EXTERNAL_PUGIXML=ON
|
||||
-DPUGIXML_LIBRARY=${LIBDIR}/pugixml/lib/${LIBPREFIX}pugixml${LIBEXT}
|
||||
-DPUGIXML_INCLUDE_DIR=${LIBDIR}/pugixml/include/
|
||||
${WEBP_FLAGS}
|
||||
${OIIO_SIMD_FLAGS}
|
||||
)
|
||||
@@ -137,7 +134,6 @@ add_dependencies(
|
||||
external_jpeg
|
||||
external_boost
|
||||
external_tiff
|
||||
external_pugixml
|
||||
external_openjpeg${OPENJPEG_POSTFIX}
|
||||
${WEBP_DEP}
|
||||
)
|
||||
|
@@ -78,10 +78,14 @@ set(OSL_EXTRA_ARGS
|
||||
-DINSTALL_DOCS=OFF
|
||||
${OSL_SIMD_FLAGS}
|
||||
-DPARTIO_LIBRARIES=
|
||||
-DPUGIXML_HOME=${LIBDIR}/pugixml
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
if(WIN32)
|
||||
set(OSL_EXTRA_ARGS
|
||||
${OSL_EXTRA_ARGS}
|
||||
-DPUGIXML_HOME=${LIBDIR}/pugixml
|
||||
)
|
||||
elseif(APPLE)
|
||||
# Make symbol hiding consistent with OIIO which defaults to OFF,
|
||||
# avoids linker warnings on macOS
|
||||
set(OSL_EXTRA_ARGS
|
||||
@@ -110,9 +114,17 @@ add_dependencies(
|
||||
external_zlib
|
||||
external_flexbison
|
||||
external_openimageio
|
||||
external_pugixml
|
||||
)
|
||||
|
||||
if(UNIX)
|
||||
# Rely on PugiXML compiled with OpenImageIO
|
||||
else()
|
||||
add_dependencies(
|
||||
external_osl
|
||||
external_pugixml
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
ExternalProject_Add_Step(external_osl after_install
|
||||
|
@@ -30,13 +30,13 @@ ExternalProject_Add(external_pugixml
|
||||
if(WIN32)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
ExternalProject_Add_Step(external_pugixml after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pugixml ${HARVEST_TARGET}/pugixml
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/osl/lib/pugixml.lib
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
||||
if(BUILD_MODE STREQUAL Debug)
|
||||
ExternalProject_Add_Step(external_pugixml after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/pugixml/lib/pugixml_d.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/osl/lib/pugixml_d.lib
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
||||
|
@@ -42,7 +42,7 @@ if(UNIX)
|
||||
-DSQLITE_MAX_VARIABLE_NUMBER=250000 \
|
||||
-fPIC")
|
||||
set(SQLITE_CONFIGURE_ENV ${SQLITE_CONFIGURE_ENV} && export LDFLAGS=${SQLITE_LDFLAGS} && export CFLAGS=${SQLITE_CFLAGS})
|
||||
set(SQLITE_CONFIGURATION_ARGS ${SQLITE_CONFIGURATION_ARGS} --enable-threadsafe --enable-load-extension --enable-json1 --enable-fts4 --enable-fts5 --disable-tcl
|
||||
set(SQLITE_CONFIGURATION_ARGS ${SQLITE_CONFIGURATION_ARGS} --enable-threadsafe --enable-load-extension --enable-json1 --enable-fts4 --enable-fts5
|
||||
--enable-shared=no)
|
||||
endif()
|
||||
|
||||
|
@@ -120,9 +120,6 @@ set(LLVM_HASH 31eb9ce73dd2a0f8dcab8319fb03f8fc)
|
||||
set(CLANG_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/clang-${LLVM_VERSION}.src.tar.xz)
|
||||
set(CLANG_HASH 13468e4a44940efef1b75e8641752f90)
|
||||
|
||||
set(CLANG_TOOLS_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/clang-tools-extra-${LLVM_VERSION}.src.tar.xz)
|
||||
set(CLANG_TOOLS_HASH c76293870b564c6a7968622b475b7646)
|
||||
|
||||
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/openmp-${LLVM_VERSION}.src.tar.xz)
|
||||
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
|
||||
|
||||
@@ -331,7 +328,3 @@ set(GMP_HASH a325e3f09e6d91e62101e59f9bda3ec1)
|
||||
set(POTRACE_VERSION 1.16)
|
||||
set(POTRACE_URI http://potrace.sourceforge.net/download/${POTRACE_VERSION}/potrace-${POTRACE_VERSION}.tar.gz)
|
||||
set(POTRACE_HASH 5f0bd87ddd9a620b0c4e65652ef93d69)
|
||||
|
||||
set(HARU_VERSION 2_3_0)
|
||||
set(HARU_URI https://github.com/libharu/libharu/archive/RELEASE_${HARU_VERSION}.tar.gz)
|
||||
set(HARU_HASH 4f916aa49c3069b3a10850013c507460)
|
||||
|
@@ -385,25 +385,25 @@ USE_CXX11=true
|
||||
CLANG_FORMAT_VERSION_MIN="6.0"
|
||||
CLANG_FORMAT_VERSION_MAX="10.0"
|
||||
|
||||
PYTHON_VERSION="3.9.1"
|
||||
PYTHON_VERSION_SHORT="3.9"
|
||||
PYTHON_VERSION="3.7.7"
|
||||
PYTHON_VERSION_SHORT="3.7"
|
||||
PYTHON_VERSION_MIN="3.7"
|
||||
PYTHON_VERSION_MAX="3.10"
|
||||
PYTHON_VERSION_MAX="3.9"
|
||||
PYTHON_VERSION_INSTALLED=$PYTHON_VERSION_MIN
|
||||
PYTHON_FORCE_BUILD=false
|
||||
PYTHON_FORCE_REBUILD=false
|
||||
PYTHON_SKIP=false
|
||||
|
||||
NUMPY_VERSION="1.19.5"
|
||||
NUMPY_VERSION_SHORT="1.19"
|
||||
NUMPY_VERSION="1.17.5"
|
||||
NUMPY_VERSION_SHORT="1.17"
|
||||
NUMPY_VERSION_MIN="1.8"
|
||||
NUMPY_VERSION_MAX="2.0"
|
||||
NUMPY_FORCE_BUILD=false
|
||||
NUMPY_FORCE_REBUILD=false
|
||||
NUMPY_SKIP=false
|
||||
|
||||
BOOST_VERSION="1.73.0"
|
||||
BOOST_VERSION_SHORT="1.73"
|
||||
BOOST_VERSION="1.70.0"
|
||||
BOOST_VERSION_SHORT="1.70"
|
||||
BOOST_VERSION_MIN="1.49"
|
||||
BOOST_VERSION_MAX="2.0"
|
||||
BOOST_FORCE_BUILD=false
|
||||
@@ -439,7 +439,7 @@ _with_built_openexr=false
|
||||
OIIO_VERSION="2.1.15.0"
|
||||
OIIO_VERSION_SHORT="2.1"
|
||||
OIIO_VERSION_MIN="2.1.12"
|
||||
OIIO_VERSION_MAX="2.2.10"
|
||||
OIIO_VERSION_MAX="3.0"
|
||||
OIIO_FORCE_BUILD=false
|
||||
OIIO_FORCE_REBUILD=false
|
||||
OIIO_SKIP=false
|
||||
@@ -483,7 +483,7 @@ OPENVDB_FORCE_REBUILD=false
|
||||
OPENVDB_SKIP=false
|
||||
|
||||
# Alembic needs to be compiled for now
|
||||
ALEMBIC_VERSION="1.7.16"
|
||||
ALEMBIC_VERSION="1.7.12"
|
||||
ALEMBIC_VERSION_SHORT="1.7"
|
||||
ALEMBIC_VERSION_MIN="1.7"
|
||||
ALEMBIC_VERSION_MAX="2.0"
|
||||
@@ -2064,6 +2064,7 @@ compile_OIIO() {
|
||||
cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
|
||||
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
|
||||
cmake_d="$cmake_d -D STOP_ON_WARNING=OFF"
|
||||
cmake_d="$cmake_d -D BUILDSTATIC=OFF"
|
||||
cmake_d="$cmake_d -D LINKSTATIC=OFF"
|
||||
cmake_d="$cmake_d -D USE_SIMD=sse2"
|
||||
|
||||
@@ -2085,7 +2086,7 @@ compile_OIIO() {
|
||||
cmake_d="$cmake_d -D USE_OPENCV=OFF"
|
||||
cmake_d="$cmake_d -D BUILD_TESTING=OFF"
|
||||
cmake_d="$cmake_d -D OIIO_BUILD_TESTS=OFF"
|
||||
cmake_d="$cmake_d -D OIIO_BUILD_TOOLS=ON"
|
||||
cmake_d="$cmake_d -D OIIO_BUILD_TOOLS=OFF"
|
||||
cmake_d="$cmake_d -D TXT2MAN="
|
||||
#cmake_d="$cmake_d -D CMAKE_EXPORT_COMPILE_COMMANDS=ON"
|
||||
#cmake_d="$cmake_d -D CMAKE_VERBOSE_MAKEFILE=ON"
|
||||
@@ -2098,6 +2099,9 @@ compile_OIIO() {
|
||||
# if [ -d $INST/ocio ]; then
|
||||
# cmake_d="$cmake_d -D OCIO_PATH=$INST/ocio"
|
||||
# fi
|
||||
cmake_d="$cmake_d -D USE_OCIO=OFF"
|
||||
|
||||
cmake_d="$cmake_d -D OIIO_BUILD_CPP11=ON"
|
||||
|
||||
if file /bin/cp | grep -q '32-bit'; then
|
||||
cflags="-fPIC -m32 -march=i686"
|
||||
@@ -4068,7 +4072,7 @@ install_DEB() {
|
||||
else
|
||||
check_package_version_ge_lt_DEB libopenimageio-dev $OIIO_VERSION_MIN $OIIO_VERSION_MAX
|
||||
if [ $? -eq 0 -a "$_with_built_openexr" = false ]; then
|
||||
install_packages_DEB libopenimageio-dev openimageio-tools
|
||||
install_packages_DEB libopenimageio-dev
|
||||
clean_OIIO
|
||||
else
|
||||
compile_OIIO
|
||||
@@ -4710,13 +4714,13 @@ install_RPM() {
|
||||
INFO "Forced OpenImageIO building, as requested..."
|
||||
compile_OIIO
|
||||
else
|
||||
check_package_version_ge_lt_RPM OpenImageIO-devel $OIIO_VERSION_MIN $OIIO_VERSION_MAX
|
||||
if [ $? -eq 0 -a $_with_built_openexr == false ]; then
|
||||
install_packages_RPM OpenImageIO-devel OpenImageIO-utils
|
||||
clean_OIIO
|
||||
else
|
||||
#check_package_version_ge_lt_RPM OpenImageIO-devel $OIIO_VERSION_MIN $OIIO_VERSION_MAX
|
||||
#if [ $? -eq 0 -a $_with_built_openexr == false ]; then
|
||||
# install_packages_RPM OpenImageIO-devel
|
||||
# clean_OIIO
|
||||
#else
|
||||
compile_OIIO
|
||||
fi
|
||||
#fi
|
||||
fi
|
||||
|
||||
|
||||
|
@@ -1,12 +0,0 @@
|
||||
diff --git a/src/hpdf_image_ccitt.c b/src/hpdf_image_ccitt.c
|
||||
index 8672763..9be531a 100644
|
||||
--- a/src/hpdf_image_ccitt.c
|
||||
+++ b/src/hpdf_image_ccitt.c
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <memory.h>
|
||||
#include <assert.h>
|
||||
|
||||
-#define G3CODES
|
||||
#include "t4.h"
|
||||
|
||||
typedef unsigned int uint32;
|
@@ -34,24 +34,3 @@ diff -Naur orig/src/include/OpenImageIO/platform.h external_openimageio/src/incl
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
diff -Naur orig/src/libutil/ustring.cpp external_openimageio/src/libutil/ustring.cpp
|
||||
--- orig/src/libutil/ustring.cpp 2020-05-11 05:43:52.000000000 +0200
|
||||
+++ external_openimageio/src/libutil/ustring.cpp 2020-11-26 12:06:08.000000000 +0100
|
||||
@@ -337,6 +337,8 @@
|
||||
// the std::string to make it point to our chars! In such a case, the
|
||||
// destructor will be careful not to allow a deallocation.
|
||||
|
||||
+ // Disable internal std::string for Apple silicon based Macs
|
||||
+#if !(defined(__APPLE__) && defined(__arm64__))
|
||||
#if defined(__GNUC__) && !defined(_LIBCPP_VERSION) \
|
||||
&& defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI
|
||||
// NEW gcc ABI
|
||||
@@ -382,7 +384,7 @@
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
-
|
||||
+#endif
|
||||
// Remaining cases - just assign the internal string. This may result
|
||||
// in double allocation for the chars. If you care about that, do
|
||||
// something special for your platform, much like we did for gcc and
|
@@ -88,6 +88,7 @@ class VersionInfo:
|
||||
self.short_version = "%d.%02d" % (version_numbers[0], version_numbers[1])
|
||||
self.version = "%d.%02d.%d" % version_numbers
|
||||
self.version_cycle = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE')
|
||||
self.version_cycle_number = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE_NUMBER')
|
||||
self.hash = self._parse_header_file(buildinfo_h, 'BUILD_HASH')[1:-1]
|
||||
|
||||
if self.version_cycle == "release":
|
||||
@@ -96,7 +97,8 @@ class VersionInfo:
|
||||
self.is_development_build = False
|
||||
elif self.version_cycle == "rc":
|
||||
# Release candidate
|
||||
self.full_version = self.version + self.version_cycle
|
||||
version_cycle = self.version_cycle + self.version_cycle_number
|
||||
self.full_version = self.version + version_cycle
|
||||
self.is_development_build = False
|
||||
else:
|
||||
# Development build
|
||||
|
@@ -64,12 +64,7 @@ class WindowsCodeSigner(BaseCodeSigner):
|
||||
|
||||
def run_codesign_tool(self, filepath: Path) -> None:
|
||||
command = self.get_sign_command_prefix() + [filepath]
|
||||
|
||||
try:
|
||||
codesign_output = self.check_output_or_mock(command, util.Platform.WINDOWS)
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise SigntoolException(f'Error running signtool {e}')
|
||||
|
||||
codesign_output = self.check_output_or_mock(command, util.Platform.WINDOWS)
|
||||
logger_server.info(f'signtool output:\n{codesign_output}')
|
||||
|
||||
got_number_of_success = False
|
||||
|
@@ -42,7 +42,7 @@ def get_cmake_options(builder):
|
||||
elif builder.platform == 'linux':
|
||||
config_file = "build_files/buildbot/config/blender_linux.cmake"
|
||||
|
||||
optix_sdk_dir = os.path.join(builder.blender_dir, '..', '..', 'NVIDIA-Optix-SDK-7.1')
|
||||
optix_sdk_dir = os.path.join(builder.blender_dir, '..', '..', 'NVIDIA-Optix-SDK')
|
||||
options.append('-DOPTIX_ROOT_DIR:PATH=' + optix_sdk_dir)
|
||||
|
||||
# Workaround to build sm_30 kernels with CUDA 10, since CUDA 11 no longer supports that architecture
|
||||
|
@@ -34,8 +34,6 @@ set(_clang_tidy_SEARCH_DIRS
|
||||
# TODO(sergey): Find more reliable way of finding the latest clang-tidy.
|
||||
find_program(CLANG_TIDY_EXECUTABLE
|
||||
NAMES
|
||||
clang-tidy-12
|
||||
clang-tidy-11
|
||||
clang-tidy-10
|
||||
clang-tidy-9
|
||||
clang-tidy-8
|
||||
|
@@ -1,64 +0,0 @@
|
||||
# - Find HARU library
|
||||
# Find the native Haru includes and library
|
||||
# This module defines
|
||||
# HARU_INCLUDE_DIRS, where to find hpdf.h, set when
|
||||
# HARU_INCLUDE_DIR is found.
|
||||
# HARU_LIBRARIES, libraries to link against to use Haru.
|
||||
# HARU_ROOT_DIR, The base directory to search for Haru.
|
||||
# This can also be an environment variable.
|
||||
# HARU_FOUND, If false, do not try to use Haru.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# HARU_LIBRARY, where to find the Haru library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2021 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD 3-Clause License,
|
||||
# see accompanying file BSD-3-Clause-license.txt for details.
|
||||
#=============================================================================
|
||||
|
||||
# If HARU_ROOT_DIR was defined in the environment, use it.
|
||||
if(NOT HARU_ROOT_DIR AND NOT $ENV{HARU_ROOT_DIR} STREQUAL "")
|
||||
set(HARU_ROOT_DIR $ENV{HARU_ROOT_DIR})
|
||||
endif()
|
||||
|
||||
set(_haru_SEARCH_DIRS
|
||||
${HARU_ROOT_DIR}
|
||||
/opt/lib/haru
|
||||
)
|
||||
|
||||
find_path(HARU_INCLUDE_DIR
|
||||
NAMES
|
||||
hpdf.h
|
||||
HINTS
|
||||
${_haru_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include/haru
|
||||
)
|
||||
|
||||
find_library(HARU_LIBRARY
|
||||
NAMES
|
||||
hpdfs
|
||||
HINTS
|
||||
${_haru_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set HARU_FOUND to TRUE if
|
||||
# all listed variables are TRUE.
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Haru DEFAULT_MSG HARU_LIBRARY HARU_INCLUDE_DIR)
|
||||
|
||||
if(HARU_FOUND)
|
||||
set(HARU_LIBRARIES ${HARU_LIBRARY})
|
||||
set(HARU_INCLUDE_DIRS ${HARU_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
HARU_INCLUDE_DIR
|
||||
HARU_LIBRARY
|
||||
)
|
||||
|
||||
unset(_haru_SEARCH_DIRS)
|
@@ -49,7 +49,7 @@ FIND_LIBRARY(PUGIXML_LIBRARY
|
||||
# handle the QUIETLY and REQUIRED arguments and set PUGIXML_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PugiXML DEFAULT_MSG
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PUGIXML DEFAULT_MSG
|
||||
PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
|
||||
|
||||
IF(PUGIXML_FOUND)
|
||||
|
@@ -330,9 +330,6 @@ function(gtest_add_tests)
|
||||
set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+) *, *([A-Za-z_0-9]+) *\\).*")
|
||||
set(gtest_test_type_regex "(TYPED_TEST|TEST_?[FP]?)")
|
||||
|
||||
# This will get a filter for each test suite.
|
||||
set(test_filters "")
|
||||
|
||||
foreach(source IN LISTS ARGS_SOURCES)
|
||||
if(NOT ARGS_SKIP_DEPENDENCY)
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${source})
|
||||
@@ -379,32 +376,175 @@ function(gtest_add_tests)
|
||||
list(APPEND testList ${ctest_test_name})
|
||||
endif()
|
||||
else()
|
||||
# BLENDER: collect tests named "suite.testcase" as list of "suite.*" filters.
|
||||
string(REGEX REPLACE "\\..*$" "" gtest_suite_name ${gtest_test_name})
|
||||
list(APPEND test_filters "${gtest_suite_name}.*")
|
||||
set(ctest_test_name ${ARGS_TEST_PREFIX}${gtest_test_name}${ARGS_TEST_SUFFIX})
|
||||
add_test(NAME ${ctest_test_name}
|
||||
${workDir}
|
||||
COMMAND ${ARGS_TARGET}
|
||||
--gtest_filter=${gtest_test_name}
|
||||
${ARGS_EXTRA_ARGS}
|
||||
)
|
||||
list(APPEND testList ${ctest_test_name})
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
# Join all found GTest suite names into one big filter.
|
||||
list(REMOVE_DUPLICATES test_filters)
|
||||
list(JOIN test_filters ":" gtest_filter)
|
||||
add_test(NAME ${ARGS_TEST_PREFIX}
|
||||
${workDir}
|
||||
COMMAND ${ARGS_TARGET}
|
||||
--gtest_filter=${gtest_filter}
|
||||
${ARGS_EXTRA_ARGS}
|
||||
)
|
||||
list(APPEND testList ${ARGS_TEST_PREFIX})
|
||||
|
||||
if(ARGS_TEST_LIST)
|
||||
set(${ARGS_TEST_LIST} ${testList} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
|
||||
# BLENDER: remove the discovery function gtest_discover_tests(). It's not used,
|
||||
# as it generates too many test invocations.
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
function(gtest_discover_tests TARGET)
|
||||
cmake_parse_arguments(
|
||||
""
|
||||
"NO_PRETTY_TYPES;NO_PRETTY_VALUES"
|
||||
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;DISCOVERY_TIMEOUT;XML_OUTPUT_DIR;DISCOVERY_MODE"
|
||||
"EXTRA_ARGS;PROPERTIES"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
if(NOT _WORKING_DIRECTORY)
|
||||
set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
endif()
|
||||
if(NOT _TEST_LIST)
|
||||
set(_TEST_LIST ${TARGET}_TESTS)
|
||||
endif()
|
||||
if(NOT _DISCOVERY_TIMEOUT)
|
||||
set(_DISCOVERY_TIMEOUT 5)
|
||||
endif()
|
||||
if(NOT _DISCOVERY_MODE)
|
||||
if(NOT CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE)
|
||||
set(CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE "POST_BUILD")
|
||||
endif()
|
||||
set(_DISCOVERY_MODE ${CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE})
|
||||
endif()
|
||||
|
||||
get_property(
|
||||
has_counter
|
||||
TARGET ${TARGET}
|
||||
PROPERTY CTEST_DISCOVERED_TEST_COUNTER
|
||||
SET
|
||||
)
|
||||
if(has_counter)
|
||||
get_property(
|
||||
counter
|
||||
TARGET ${TARGET}
|
||||
PROPERTY CTEST_DISCOVERED_TEST_COUNTER
|
||||
)
|
||||
math(EXPR counter "${counter} + 1")
|
||||
else()
|
||||
set(counter 1)
|
||||
endif()
|
||||
set_property(
|
||||
TARGET ${TARGET}
|
||||
PROPERTY CTEST_DISCOVERED_TEST_COUNTER
|
||||
${counter}
|
||||
)
|
||||
|
||||
# Define rule to generate test list for aforementioned test executable
|
||||
# Blender: use _ instead of [] to avoid problems with zsh regex.
|
||||
set(ctest_file_base "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_${counter}_")
|
||||
set(ctest_include_file "${ctest_file_base}_include.cmake")
|
||||
set(ctest_tests_file "${ctest_file_base}_tests.cmake")
|
||||
get_property(crosscompiling_emulator
|
||||
TARGET ${TARGET}
|
||||
PROPERTY CROSSCOMPILING_EMULATOR
|
||||
)
|
||||
|
||||
if(_DISCOVERY_MODE STREQUAL "POST_BUILD")
|
||||
add_custom_command(
|
||||
TARGET ${TARGET} POST_BUILD
|
||||
BYPRODUCTS "${ctest_tests_file}"
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_TARGET=${TARGET}"
|
||||
-D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
|
||||
-D "TEST_EXECUTOR=${crosscompiling_emulator}"
|
||||
-D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
|
||||
-D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
|
||||
-D "TEST_PROPERTIES=${_PROPERTIES}"
|
||||
-D "TEST_PREFIX=${_TEST_PREFIX}"
|
||||
-D "TEST_SUFFIX=${_TEST_SUFFIX}"
|
||||
-D "NO_PRETTY_TYPES=${_NO_PRETTY_TYPES}"
|
||||
-D "NO_PRETTY_VALUES=${_NO_PRETTY_VALUES}"
|
||||
-D "TEST_LIST=${_TEST_LIST}"
|
||||
-D "CTEST_FILE=${ctest_tests_file}"
|
||||
-D "TEST_DISCOVERY_TIMEOUT=${_DISCOVERY_TIMEOUT}"
|
||||
-D "TEST_XML_OUTPUT_DIR=${_XML_OUTPUT_DIR}"
|
||||
-P "${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
file(WRITE "${ctest_include_file}"
|
||||
"if(EXISTS \"${ctest_tests_file}\")\n"
|
||||
" include(\"${ctest_tests_file}\")\n"
|
||||
"else()\n"
|
||||
" add_test(${TARGET}_NOT_BUILT ${TARGET}_NOT_BUILT)\n"
|
||||
"endif()\n"
|
||||
)
|
||||
elseif(_DISCOVERY_MODE STREQUAL "PRE_TEST")
|
||||
|
||||
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL
|
||||
PROPERTY GENERATOR_IS_MULTI_CONFIG
|
||||
)
|
||||
|
||||
if(GENERATOR_IS_MULTI_CONFIG)
|
||||
set(ctest_tests_file "${ctest_file_base}_tests-$<CONFIG>.cmake")
|
||||
endif()
|
||||
|
||||
string(CONCAT ctest_include_content
|
||||
"if(EXISTS \"$<TARGET_FILE:${TARGET}>\")" "\n"
|
||||
" if(\"$<TARGET_FILE:${TARGET}>\" IS_NEWER_THAN \"${ctest_tests_file}\")" "\n"
|
||||
" include(\"${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}\")" "\n"
|
||||
" gtest_discover_tests_impl(" "\n"
|
||||
" TEST_EXECUTABLE" " [==[" "$<TARGET_FILE:${TARGET}>" "]==]" "\n"
|
||||
" TEST_EXECUTOR" " [==[" "${crosscompiling_emulator}" "]==]" "\n"
|
||||
" TEST_WORKING_DIR" " [==[" "${_WORKING_DIRECTORY}" "]==]" "\n"
|
||||
" TEST_EXTRA_ARGS" " [==[" "${_EXTRA_ARGS}" "]==]" "\n"
|
||||
" TEST_PROPERTIES" " [==[" "${_PROPERTIES}" "]==]" "\n"
|
||||
" TEST_PREFIX" " [==[" "${_TEST_PREFIX}" "]==]" "\n"
|
||||
" TEST_SUFFIX" " [==[" "${_TEST_SUFFIX}" "]==]" "\n"
|
||||
" NO_PRETTY_TYPES" " [==[" "${_NO_PRETTY_TYPES}" "]==]" "\n"
|
||||
" NO_PRETTY_VALUES" " [==[" "${_NO_PRETTY_VALUES}" "]==]" "\n"
|
||||
" TEST_LIST" " [==[" "${_TEST_LIST}" "]==]" "\n"
|
||||
" CTEST_FILE" " [==[" "${ctest_tests_file}" "]==]" "\n"
|
||||
" TEST_DISCOVERY_TIMEOUT" " [==[" "${_DISCOVERY_TIMEOUT}" "]==]" "\n"
|
||||
" TEST_XML_OUTPUT_DIR" " [==[" "${_XML_OUTPUT_DIR}" "]==]" "\n"
|
||||
" )" "\n"
|
||||
" endif()" "\n"
|
||||
" include(\"${ctest_tests_file}\")" "\n"
|
||||
"else()" "\n"
|
||||
" add_test(${TARGET}_NOT_BUILT ${TARGET}_NOT_BUILT)" "\n"
|
||||
"endif()" "\n"
|
||||
)
|
||||
|
||||
if(GENERATOR_IS_MULTI_CONFIG)
|
||||
foreach(_config ${CMAKE_CONFIGURATION_TYPES})
|
||||
file(GENERATE OUTPUT "${ctest_file_base}_include-${_config}.cmake" CONTENT "${ctest_include_content}" CONDITION $<CONFIG:${_config}>)
|
||||
endforeach()
|
||||
file(WRITE "${ctest_include_file}" "include(\"${ctest_file_base}_include-\${CTEST_CONFIGURATION_TYPE}.cmake\")")
|
||||
else()
|
||||
file(GENERATE OUTPUT "${ctest_file_base}_include.cmake" CONTENT "${ctest_include_content}")
|
||||
file(WRITE "${ctest_include_file}" "include(\"${ctest_file_base}_include.cmake\")")
|
||||
endif()
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown DISCOVERY_MODE: ${_DISCOVERY_MODE}")
|
||||
endif()
|
||||
|
||||
# Add discovered tests to directory TEST_INCLUDE_FILES
|
||||
set_property(DIRECTORY
|
||||
APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
|
||||
)
|
||||
|
||||
endfunction()
|
||||
|
||||
###############################################################################
|
||||
|
||||
set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT
|
||||
${CMAKE_CURRENT_LIST_DIR}/GTestAddTests.cmake
|
||||
)
|
||||
|
||||
# Restore project's policies
|
||||
cmake_policy(POP)
|
||||
|
191
build_files/cmake/Modules/GTestAddTests.cmake
Normal file
191
build_files/cmake/Modules/GTestAddTests.cmake
Normal file
@@ -0,0 +1,191 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License,
|
||||
# see accompanying file BSD-3-Clause-license.txt for details.
|
||||
|
||||
# Blender: disable ASAN leak detection when trying to discover tests.
|
||||
set(ENV{ASAN_OPTIONS} "detect_leaks=0")
|
||||
|
||||
cmake_minimum_required(VERSION ${CMAKE_VERSION})
|
||||
|
||||
# Overwrite possibly existing ${_CTEST_FILE} with empty file
|
||||
set(flush_tests_MODE WRITE)
|
||||
|
||||
# Flushes script to ${_CTEST_FILE}
|
||||
macro(flush_script)
|
||||
file(${flush_tests_MODE} "${_CTEST_FILE}" "${script}")
|
||||
set(flush_tests_MODE APPEND)
|
||||
|
||||
set(script "")
|
||||
endmacro()
|
||||
|
||||
# Flushes tests_buffer to tests
|
||||
macro(flush_tests_buffer)
|
||||
list(APPEND tests "${tests_buffer}")
|
||||
set(tests_buffer "")
|
||||
endmacro()
|
||||
|
||||
macro(add_command NAME)
|
||||
set(_args "")
|
||||
foreach(_arg ${ARGN})
|
||||
if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
|
||||
string(APPEND _args " [==[${_arg}]==]")
|
||||
else()
|
||||
string(APPEND _args " ${_arg}")
|
||||
endif()
|
||||
endforeach()
|
||||
string(APPEND script "${NAME}(${_args})\n")
|
||||
string(LENGTH "${script}" _script_len)
|
||||
if(${_script_len} GREATER "50000")
|
||||
flush_script()
|
||||
endif()
|
||||
# Unsets macro local variables to prevent leakage outside of this macro.
|
||||
unset(_args)
|
||||
unset(_script_len)
|
||||
endmacro()
|
||||
|
||||
function(gtest_discover_tests_impl)
|
||||
|
||||
cmake_parse_arguments(
|
||||
""
|
||||
""
|
||||
"NO_PRETTY_TYPES;NO_PRETTY_VALUES;TEST_EXECUTABLE;TEST_EXECUTOR;TEST_WORKING_DIR;TEST_PREFIX;TEST_SUFFIX;TEST_LIST;CTEST_FILE;TEST_DISCOVERY_TIMEOUT;TEST_XML_OUTPUT_DIR"
|
||||
"TEST_EXTRA_ARGS;TEST_PROPERTIES"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
set(prefix "${_TEST_PREFIX}")
|
||||
set(suffix "${_TEST_SUFFIX}")
|
||||
set(extra_args ${_TEST_EXTRA_ARGS})
|
||||
set(properties ${_TEST_PROPERTIES})
|
||||
set(script)
|
||||
set(suite)
|
||||
set(tests)
|
||||
set(tests_buffer)
|
||||
|
||||
# Run test executable to get list of available tests
|
||||
if(NOT EXISTS "${_TEST_EXECUTABLE}")
|
||||
message(FATAL_ERROR
|
||||
"Specified test executable does not exist.\n"
|
||||
" Path: '${_TEST_EXECUTABLE}'"
|
||||
)
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND ${_TEST_EXECUTOR} "${_TEST_EXECUTABLE}" --gtest_list_tests
|
||||
WORKING_DIRECTORY "${_TEST_WORKING_DIR}"
|
||||
TIMEOUT ${_TEST_DISCOVERY_TIMEOUT}
|
||||
OUTPUT_VARIABLE output
|
||||
RESULT_VARIABLE result
|
||||
)
|
||||
if(NOT ${result} EQUAL 0)
|
||||
string(REPLACE "\n" "\n " output "${output}")
|
||||
message(FATAL_ERROR
|
||||
"Error running test executable.\n"
|
||||
" Path: '${_TEST_EXECUTABLE}'\n"
|
||||
" Result: ${result}\n"
|
||||
" Output:\n"
|
||||
" ${output}\n"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Preserve semicolon in test-parameters
|
||||
string(REPLACE [[;]] [[\;]] output "${output}")
|
||||
string(REPLACE "\n" ";" output "${output}")
|
||||
|
||||
# Parse output
|
||||
foreach(line ${output})
|
||||
# Skip header
|
||||
if(NOT line MATCHES "gtest_main\\.cc")
|
||||
# Do we have a module name or a test name?
|
||||
if(NOT line MATCHES "^ ")
|
||||
# Module; remove trailing '.' to get just the name...
|
||||
string(REGEX REPLACE "\\.( *#.*)?" "" suite "${line}")
|
||||
if(line MATCHES "#" AND NOT _NO_PRETTY_TYPES)
|
||||
string(REGEX REPLACE "/[0-9]\\.+ +#.*= +" "/" pretty_suite "${line}")
|
||||
else()
|
||||
set(pretty_suite "${suite}")
|
||||
endif()
|
||||
string(REGEX REPLACE "^DISABLED_" "" pretty_suite "${pretty_suite}")
|
||||
else()
|
||||
# Test name; strip spaces and comments to get just the name...
|
||||
string(REGEX REPLACE " +" "" test "${line}")
|
||||
if(test MATCHES "#" AND NOT _NO_PRETTY_VALUES)
|
||||
string(REGEX REPLACE "/[0-9]+#GetParam..=" "/" pretty_test "${test}")
|
||||
else()
|
||||
string(REGEX REPLACE "#.*" "" pretty_test "${test}")
|
||||
endif()
|
||||
string(REGEX REPLACE "^DISABLED_" "" pretty_test "${pretty_test}")
|
||||
string(REGEX REPLACE "#.*" "" test "${test}")
|
||||
if(NOT "${_TEST_XML_OUTPUT_DIR}" STREQUAL "")
|
||||
set(TEST_XML_OUTPUT_PARAM "--gtest_output=xml:${_TEST_XML_OUTPUT_DIR}/${prefix}${suite}.${test}${suffix}.xml")
|
||||
else()
|
||||
unset(TEST_XML_OUTPUT_PARAM)
|
||||
endif()
|
||||
|
||||
# sanitize test name for further processing downstream
|
||||
set(testname "${prefix}${pretty_suite}.${pretty_test}${suffix}")
|
||||
# escape \
|
||||
string(REPLACE [[\]] [[\\]] testname "${testname}")
|
||||
# escape ;
|
||||
string(REPLACE [[;]] [[\;]] testname "${testname}")
|
||||
# escape $
|
||||
string(REPLACE [[$]] [[\$]] testname "${testname}")
|
||||
|
||||
# ...and add to script
|
||||
add_command(add_test
|
||||
"${testname}"
|
||||
${_TEST_EXECUTOR}
|
||||
"${_TEST_EXECUTABLE}"
|
||||
"--gtest_filter=${suite}.${test}"
|
||||
"--gtest_also_run_disabled_tests"
|
||||
${TEST_XML_OUTPUT_PARAM}
|
||||
${extra_args}
|
||||
)
|
||||
if(suite MATCHES "^DISABLED" OR test MATCHES "^DISABLED")
|
||||
add_command(set_tests_properties
|
||||
"${testname}"
|
||||
PROPERTIES DISABLED TRUE
|
||||
)
|
||||
endif()
|
||||
add_command(set_tests_properties
|
||||
"${testname}"
|
||||
PROPERTIES
|
||||
WORKING_DIRECTORY "${_TEST_WORKING_DIR}"
|
||||
SKIP_REGULAR_EXPRESSION "\\\\[ SKIPPED \\\\]"
|
||||
${properties}
|
||||
)
|
||||
list(APPEND tests_buffer "${testname}")
|
||||
list(LENGTH tests_buffer tests_buffer_length)
|
||||
if(${tests_buffer_length} GREATER "250")
|
||||
flush_tests_buffer()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
# Create a list of all discovered tests, which users may use to e.g. set
|
||||
# properties on the tests
|
||||
flush_tests_buffer()
|
||||
add_command(set ${_TEST_LIST} ${tests})
|
||||
|
||||
# Write CTest script
|
||||
flush_script()
|
||||
|
||||
endfunction()
|
||||
|
||||
if(CMAKE_SCRIPT_MODE_FILE)
|
||||
gtest_discover_tests_impl(
|
||||
NO_PRETTY_TYPES ${NO_PRETTY_TYPES}
|
||||
NO_PRETTY_VALUES ${NO_PRETTY_VALUES}
|
||||
TEST_EXECUTABLE ${TEST_EXECUTABLE}
|
||||
TEST_EXECUTOR ${TEST_EXECUTOR}
|
||||
TEST_WORKING_DIR ${TEST_WORKING_DIR}
|
||||
TEST_PREFIX ${TEST_PREFIX}
|
||||
TEST_SUFFIX ${TEST_SUFFIX}
|
||||
TEST_LIST ${TEST_LIST}
|
||||
CTEST_FILE ${CTEST_FILE}
|
||||
TEST_DISCOVERY_TIMEOUT ${TEST_DISCOVERY_TIMEOUT}
|
||||
TEST_XML_OUTPUT_DIR ${TEST_XML_OUTPUT_DIR}
|
||||
TEST_EXTRA_ARGS ${TEST_EXTRA_ARGS}
|
||||
TEST_PROPERTIES ${TEST_PROPERTIES}
|
||||
)
|
||||
endif()
|
@@ -8,17 +8,6 @@
|
||||
#
|
||||
#=============================================================================
|
||||
|
||||
function(GET_BLENDER_TEST_INSTALL_DIR VARIABLE_NAME)
|
||||
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(GENERATOR_IS_MULTI_CONFIG)
|
||||
string(REPLACE "\${BUILD_TYPE}" "$<CONFIG>" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
else()
|
||||
string(REPLACE "\${BUILD_TYPE}" "" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
endif()
|
||||
set(${VARIABLE_NAME} "${TEST_INSTALL_DIR}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
macro(BLENDER_SRC_GTEST_EX)
|
||||
if(WITH_GTESTS)
|
||||
set(options SKIP_ADD_TEST)
|
||||
@@ -86,7 +75,13 @@ macro(BLENDER_SRC_GTEST_EX)
|
||||
target_link_libraries(${TARGET_NAME} ${GMP_LIBRARIES})
|
||||
endif()
|
||||
|
||||
GET_BLENDER_TEST_INSTALL_DIR(TEST_INSTALL_DIR)
|
||||
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(GENERATOR_IS_MULTI_CONFIG)
|
||||
string(REPLACE "\${BUILD_TYPE}" "$<CONFIG>" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
else()
|
||||
string(REPLACE "\${BUILD_TYPE}" "" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
endif()
|
||||
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}"
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${TESTS_OUTPUT_DIR}"
|
||||
@@ -99,9 +94,7 @@ macro(BLENDER_SRC_GTEST_EX)
|
||||
|
||||
# Don't fail tests on leaks since these often happen in external libraries
|
||||
# that we can't fix.
|
||||
set_tests_properties(${TARGET_NAME} PROPERTIES
|
||||
ENVIRONMENT LSAN_OPTIONS=exitcode=0:$ENV{LSAN_OPTIONS}
|
||||
)
|
||||
set_tests_properties(${TARGET_NAME} PROPERTIES ENVIRONMENT LSAN_OPTIONS=exitcode=0)
|
||||
endif()
|
||||
if(WIN32)
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES VS_GLOBAL_VcpkgEnabled "false")
|
||||
|
@@ -13,7 +13,7 @@ Invocation:
|
||||
export CLANG_BIND_DIR="/dsk/src/llvm/tools/clang/bindings/python"
|
||||
export CLANG_LIB_DIR="/opt/llvm/lib"
|
||||
|
||||
python clang_array_check.py somefile.c -DSOME_DEFINE -I/some/include
|
||||
python2 clang_array_check.py somefile.c -DSOME_DEFINE -I/some/include
|
||||
|
||||
... defines and includes are optional
|
||||
|
||||
@@ -76,32 +76,6 @@ defs_precalc = {
|
||||
"glNormal3bv": {0: 3},
|
||||
"glNormal3iv": {0: 3},
|
||||
"glNormal3sv": {0: 3},
|
||||
|
||||
# GPU immediate mode.
|
||||
"immVertex2iv": {1: 2},
|
||||
|
||||
"immVertex2fv": {1: 2},
|
||||
"immVertex3fv": {1: 3},
|
||||
|
||||
"immAttr2fv": {1: 2},
|
||||
"immAttr3fv": {1: 3},
|
||||
"immAttr4fv": {1: 4},
|
||||
|
||||
"immAttr3ubv": {1: 3},
|
||||
"immAttr4ubv": {1: 4},
|
||||
|
||||
"immUniform2fv": {1: 2},
|
||||
"immUniform3fv": {1: 3},
|
||||
"immUniform4fv": {1: 4},
|
||||
|
||||
"immUniformColor3fv": {0: 3},
|
||||
"immUniformColor4fv": {0: 4},
|
||||
|
||||
"immUniformColor3ubv": {1: 3},
|
||||
"immUniformColor4ubv": {1: 4},
|
||||
|
||||
"immUniformColor3fvAlpha": {0: 3},
|
||||
"immUniformColor4fvAlpha": {0: 4},
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
@@ -126,8 +100,7 @@ else:
|
||||
if CLANG_LIB_DIR is None:
|
||||
print("$CLANG_LIB_DIR clang lib dir not set")
|
||||
|
||||
if CLANG_BIND_DIR:
|
||||
sys.path.append(CLANG_BIND_DIR)
|
||||
sys.path.append(CLANG_BIND_DIR)
|
||||
|
||||
import clang
|
||||
import clang.cindex
|
||||
@@ -135,8 +108,7 @@ from clang.cindex import (CursorKind,
|
||||
TypeKind,
|
||||
TokenKind)
|
||||
|
||||
if CLANG_LIB_DIR:
|
||||
clang.cindex.Config.set_library_path(CLANG_LIB_DIR)
|
||||
clang.cindex.Config.set_library_path(CLANG_LIB_DIR)
|
||||
|
||||
index = clang.cindex.Index.create()
|
||||
|
||||
|
@@ -20,8 +20,6 @@
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# Note: this code should be cleaned up / refactored.
|
||||
|
||||
import sys
|
||||
if sys.version_info.major < 3:
|
||||
print("\nPython3.x needed, found %s.\nAborting!\n" %
|
||||
@@ -39,23 +37,12 @@ from cmake_consistency_check_config import (
|
||||
|
||||
|
||||
import os
|
||||
from os.path import (
|
||||
dirname,
|
||||
join,
|
||||
normpath,
|
||||
splitext,
|
||||
)
|
||||
from os.path import join, dirname, normpath, splitext
|
||||
|
||||
global_h = set()
|
||||
global_c = set()
|
||||
global_refs = {}
|
||||
|
||||
# Flatten `IGNORE_SOURCE_MISSING` to avoid nested looping.
|
||||
IGNORE_SOURCE_MISSING = [
|
||||
(k, ignore_path) for k, ig_list in IGNORE_SOURCE_MISSING
|
||||
for ignore_path in ig_list
|
||||
]
|
||||
|
||||
# Ignore cmake file, path pairs.
|
||||
global_ignore_source_missing = {}
|
||||
for k, v in IGNORE_SOURCE_MISSING:
|
||||
@@ -191,8 +178,6 @@ def cmake_get_src(f):
|
||||
|
||||
if not l:
|
||||
pass
|
||||
elif l in local_ignore_source_missing:
|
||||
local_ignore_source_missing.remove(l)
|
||||
elif l.startswith("$"):
|
||||
if context_name == "SRC":
|
||||
# assume if it ends with context_name we know about it
|
||||
@@ -242,7 +227,10 @@ def cmake_get_src(f):
|
||||
# replace_line(f, i - 1, new_path_rel)
|
||||
|
||||
else:
|
||||
raise Exception("non existent include %s:%d -> %s" % (f, i, new_file))
|
||||
if l in local_ignore_source_missing:
|
||||
local_ignore_source_missing.remove(l)
|
||||
else:
|
||||
raise Exception("non existent include %s:%d -> %s" % (f, i, new_file))
|
||||
|
||||
# print(new_file)
|
||||
|
||||
@@ -270,16 +258,16 @@ def cmake_get_src(f):
|
||||
|
||||
|
||||
def is_ignore_source(f, ignore_used):
|
||||
for index, ignore_path in enumerate(IGNORE_SOURCE):
|
||||
if ignore_path in f:
|
||||
for index, ig in enumerate(IGNORE_SOURCE):
|
||||
if ig in f:
|
||||
ignore_used[index] = True
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def is_ignore_cmake(f, ignore_used):
|
||||
for index, ignore_path in enumerate(IGNORE_CMAKE):
|
||||
if ignore_path in f:
|
||||
for index, ig in enumerate(IGNORE_CMAKE):
|
||||
if ig in f:
|
||||
ignore_used[index] = True
|
||||
return True
|
||||
return False
|
||||
@@ -310,7 +298,7 @@ def main():
|
||||
for cf, i in refs:
|
||||
errs.append((cf, i))
|
||||
else:
|
||||
raise Exception("CMake references missing, internal error, aborting!")
|
||||
raise Exception("CMake referenecs missing, internal error, aborting!")
|
||||
is_err = True
|
||||
|
||||
errs.sort()
|
||||
@@ -321,7 +309,7 @@ def main():
|
||||
# print("sed '%dd' '%s' > '%s.tmp' ; mv '%s.tmp' '%s'" % (i, cf, cf, cf, cf))
|
||||
|
||||
if is_err:
|
||||
raise Exception("CMake references missing files, aborting!")
|
||||
raise Exception("CMake referenecs missing files, aborting!")
|
||||
del is_err
|
||||
del errs
|
||||
|
||||
@@ -332,7 +320,7 @@ def main():
|
||||
if cf not in global_c:
|
||||
print("missing_c: ", cf)
|
||||
|
||||
# Check if automake builds a corresponding .o file.
|
||||
# check if automake builds a corrasponding .o file.
|
||||
'''
|
||||
if cf in global_c:
|
||||
out1 = os.path.splitext(cf)[0] + ".o"
|
||||
@@ -368,21 +356,21 @@ def main():
|
||||
|
||||
# Check ignores aren't stale
|
||||
print("\nCheck for unused 'IGNORE_SOURCE' paths...")
|
||||
for index, ignore_path in enumerate(IGNORE_SOURCE):
|
||||
for index, ig in enumerate(IGNORE_SOURCE):
|
||||
if not ignore_used_source[index]:
|
||||
print("unused ignore: %r" % ignore_path)
|
||||
print("unused ignore: %r" % ig)
|
||||
|
||||
# Check ignores aren't stale
|
||||
print("\nCheck for unused 'IGNORE_SOURCE_MISSING' paths...")
|
||||
for k, v in sorted(global_ignore_source_missing.items()):
|
||||
for ignore_path in v:
|
||||
print("unused ignore: %r -> %r" % (ignore_path, k))
|
||||
for ig in v:
|
||||
print("unused ignore: %r -> %r" % (ig, k))
|
||||
|
||||
# Check ignores aren't stale
|
||||
print("\nCheck for unused 'IGNORE_CMAKE' paths...")
|
||||
for index, ignore_path in enumerate(IGNORE_CMAKE):
|
||||
for index, ig in enumerate(IGNORE_CMAKE):
|
||||
if not ignore_used_cmake[index]:
|
||||
print("unused ignore: %r" % ignore_path)
|
||||
print("unused ignore: %r" % ig)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@@ -34,18 +34,8 @@ IGNORE_SOURCE = (
|
||||
|
||||
# Ignore cmake file, path pairs.
|
||||
IGNORE_SOURCE_MISSING = (
|
||||
( # Use for cycles stand-alone.
|
||||
"intern/cycles/util/CMakeLists.txt", (
|
||||
"../../third_party/numaapi/include",
|
||||
)),
|
||||
( # Use for `WITH_NANOVDB`.
|
||||
"intern/cycles/kernel/CMakeLists.txt", (
|
||||
"nanovdb/util/CSampleFromVoxels.h",
|
||||
"nanovdb/util/SampleFromVoxels.h",
|
||||
"nanovdb/NanoVDB.h",
|
||||
"nanovdb/CNanoVDB.h",
|
||||
),
|
||||
),
|
||||
# Use for cycles stand-alone.
|
||||
("intern/cycles/util/CMakeLists.txt", "../../third_party/numaapi/include"),
|
||||
)
|
||||
|
||||
IGNORE_CMAKE = (
|
||||
|
@@ -32,7 +32,7 @@ CHECKER_IGNORE_PREFIX = [
|
||||
"intern/moto",
|
||||
]
|
||||
|
||||
CHECKER_BIN = "python3"
|
||||
CHECKER_BIN = "python2"
|
||||
|
||||
CHECKER_ARGS = [
|
||||
os.path.join(os.path.dirname(__file__), "clang_array_check.py"),
|
||||
|
@@ -19,7 +19,6 @@ set(WITH_DRACO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_HARU ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||
@@ -45,8 +44,6 @@ set(WITH_OPENMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENVDB ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_POTRACE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_PUGIXML ON CACHE BOOL "" FORCE)
|
||||
set(WITH_NANOVDB ON CACHE BOOL "" FORCE)
|
||||
set(WITH_POTRACE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
|
||||
|
@@ -24,7 +24,6 @@ set(WITH_DRACO OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_HARU OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_SOLVER OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)
|
||||
@@ -52,8 +51,6 @@ set(WITH_OPENIMAGEIO OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENMP OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_POTRACE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_PUGIXML OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_NANOVDB OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_QUADRIFLOW OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_SDL OFF CACHE BOOL "" FORCE)
|
||||
|
@@ -20,7 +20,6 @@ set(WITH_DRACO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_HARU ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||
@@ -46,8 +45,6 @@ set(WITH_OPENMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENVDB ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_POTRACE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_PUGIXML ON CACHE BOOL "" FORCE)
|
||||
set(WITH_NANOVDB ON CACHE BOOL "" FORCE)
|
||||
set(WITH_POTRACE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
|
||||
|
@@ -388,43 +388,6 @@ function(blender_add_lib
|
||||
set_property(GLOBAL APPEND PROPERTY BLENDER_LINK_LIBS ${name})
|
||||
endfunction()
|
||||
|
||||
function(blender_add_test_suite)
|
||||
if (ARGC LESS 1)
|
||||
message(FATAL_ERROR "No arguments supplied to blender_add_test_suite()")
|
||||
endif()
|
||||
|
||||
# Parse the arguments
|
||||
set(oneValueArgs TARGET SUITE_NAME)
|
||||
set(multiValueArgs SOURCES)
|
||||
cmake_parse_arguments(ARGS "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
# Figure out the release dir, as some tests need files from there.
|
||||
GET_BLENDER_TEST_INSTALL_DIR(TEST_INSTALL_DIR)
|
||||
if(APPLE)
|
||||
set(_test_release_dir ${TEST_INSTALL_DIR}/Blender.app/Contents/Resources/${BLENDER_VERSION})
|
||||
else()
|
||||
if(WIN32 OR WITH_INSTALL_PORTABLE)
|
||||
set(_test_release_dir ${TEST_INSTALL_DIR}/${BLENDER_VERSION})
|
||||
else()
|
||||
set(_test_release_dir ${TEST_INSTALL_DIR}/share/blender/${BLENDER_VERSION})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Define a test case with our custom gtest_add_tests() command.
|
||||
include(GTest)
|
||||
gtest_add_tests(
|
||||
TARGET ${ARGS_TARGET}
|
||||
SOURCES "${ARGS_SOURCES}"
|
||||
TEST_PREFIX ${ARGS_SUITE_NAME}
|
||||
WORKING_DIRECTORY "${TEST_INSTALL_DIR}"
|
||||
EXTRA_ARGS
|
||||
--test-assets-dir "${CMAKE_SOURCE_DIR}/../lib/tests"
|
||||
--test-release-dir "${_test_release_dir}"
|
||||
)
|
||||
|
||||
unset(_test_release_dir)
|
||||
endfunction()
|
||||
|
||||
# Add tests for a Blender library, to be called in tandem with blender_add_lib().
|
||||
# The tests will be part of the blender_test executable (see tests/gtests/runner).
|
||||
function(blender_add_test_lib
|
||||
@@ -458,12 +421,6 @@ function(blender_add_test_lib
|
||||
blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}" "${library_deps}")
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY BLENDER_TEST_LIBS ${name})
|
||||
|
||||
blender_add_test_suite(
|
||||
TARGET blender_test
|
||||
SUITE_NAME ${name}
|
||||
SOURCES "${sources}"
|
||||
)
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -497,10 +454,14 @@ function(blender_add_test_executable
|
||||
SKIP_ADD_TEST
|
||||
)
|
||||
|
||||
blender_add_test_suite(
|
||||
TARGET ${name}_test
|
||||
SUITE_NAME ${name}
|
||||
SOURCES "${sources}"
|
||||
include(GTest)
|
||||
set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT
|
||||
${CMAKE_SOURCE_DIR}/build_files/cmake/Modules/GTestAddTests.cmake
|
||||
)
|
||||
|
||||
gtest_discover_tests(${name}_test
|
||||
DISCOVERY_MODE PRE_TEST
|
||||
WORKING_DIRECTORY "${TEST_INSTALL_DIR}"
|
||||
)
|
||||
endfunction()
|
||||
|
||||
@@ -1178,7 +1139,6 @@ endfunction()
|
||||
|
||||
function(find_python_package
|
||||
package
|
||||
relative_include_dir
|
||||
)
|
||||
|
||||
string(TOUPPER ${package} _upper_package)
|
||||
@@ -1210,10 +1170,7 @@ function(find_python_package
|
||||
dist-packages
|
||||
vendor-packages
|
||||
NO_DEFAULT_PATH
|
||||
DOC
|
||||
"Path to python site-packages or dist-packages containing '${package}' module"
|
||||
)
|
||||
mark_as_advanced(PYTHON_${_upper_package}_PATH)
|
||||
|
||||
if(NOT EXISTS "${PYTHON_${_upper_package}_PATH}")
|
||||
message(WARNING
|
||||
@@ -1231,50 +1188,6 @@ function(find_python_package
|
||||
set(WITH_PYTHON_INSTALL_${_upper_package} OFF PARENT_SCOPE)
|
||||
else()
|
||||
message(STATUS "${package} found at '${PYTHON_${_upper_package}_PATH}'")
|
||||
|
||||
if(NOT "${relative_include_dir}" STREQUAL "")
|
||||
set(_relative_include_dir "${package}/${relative_include_dir}")
|
||||
unset(PYTHON_${_upper_package}_INCLUDE_DIRS CACHE)
|
||||
find_path(PYTHON_${_upper_package}_INCLUDE_DIRS
|
||||
NAMES
|
||||
"${_relative_include_dir}"
|
||||
HINTS
|
||||
"${PYTHON_LIBPATH}/"
|
||||
"${PYTHON_LIBPATH}/python${PYTHON_VERSION}/"
|
||||
"${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/"
|
||||
PATH_SUFFIXES
|
||||
"site-packages/"
|
||||
"dist-packages/"
|
||||
"vendor-packages/"
|
||||
NO_DEFAULT_PATH
|
||||
DOC
|
||||
"Path to python site-packages or dist-packages containing '${package}' module header files"
|
||||
)
|
||||
mark_as_advanced(PYTHON_${_upper_package}_INCLUDE_DIRS)
|
||||
|
||||
if(NOT EXISTS "${PYTHON_${_upper_package}_INCLUDE_DIRS}")
|
||||
message(WARNING
|
||||
"Python package '${package}' include dir path could not be found in:\n"
|
||||
"'${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/${_relative_include_dir}', "
|
||||
"'${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/site-packages/${_relative_include_dir}', "
|
||||
"'${PYTHON_LIBPATH}/python${PYTHON_VERSION}/dist-packages/${_relative_include_dir}', "
|
||||
"'${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/dist-packages/${_relative_include_dir}', "
|
||||
"'${PYTHON_LIBPATH}/python${PYTHON_VERSION}/vendor-packages/${_relative_include_dir}', "
|
||||
"'${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/vendor-packages/${_relative_include_dir}', "
|
||||
"\n"
|
||||
"The 'WITH_PYTHON_${_upper_package}' option will be disabled.\n"
|
||||
"The build will be usable, only add-ons that depend on this package won't be functional."
|
||||
)
|
||||
set(WITH_PYTHON_${_upper_package} OFF PARENT_SCOPE)
|
||||
else()
|
||||
set(_temp "${PYTHON_${_upper_package}_INCLUDE_DIRS}/${package}/${relative_include_dir}")
|
||||
unset(PYTHON_${_upper_package}_INCLUDE_DIRS CACHE)
|
||||
set(PYTHON_${_upper_package}_INCLUDE_DIRS "${_temp}"
|
||||
CACHE PATH "Path to the include directory of the ${package} module")
|
||||
|
||||
message(STATUS "${package} include files found at '${PYTHON_${_upper_package}_INCLUDE_DIRS}'")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
@@ -72,11 +72,10 @@ if(WITH_JACK)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED LIBDIR)
|
||||
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin)
|
||||
else()
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin_${CMAKE_OSX_ARCHITECTURES})
|
||||
endif()
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin)
|
||||
# Prefer lib directory paths
|
||||
file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
|
||||
set(CMAKE_PREFIX_PATH ${LIB_SUBDIRS})
|
||||
else()
|
||||
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
||||
endif()
|
||||
@@ -84,10 +83,6 @@ if(NOT EXISTS "${LIBDIR}/")
|
||||
message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'")
|
||||
endif()
|
||||
|
||||
# Prefer lib directory paths
|
||||
file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
|
||||
set(CMAKE_PREFIX_PATH ${LIB_SUBDIRS})
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Find precompiled libraries, and avoid system or user-installed ones.
|
||||
|
||||
@@ -274,14 +269,6 @@ if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
|
||||
string(APPEND PLATFORM_LINKFLAGS " -liconv") # boost_locale and ffmpeg needs it !
|
||||
endif()
|
||||
|
||||
if(WITH_PUGIXML)
|
||||
find_package(PugiXML)
|
||||
if(NOT PUGIXML_FOUND)
|
||||
message(WARNING "PugiXML not found, disabling WITH_PUGIXML")
|
||||
set(WITH_PUGIXML OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_OPENIMAGEIO)
|
||||
find_package(OpenImageIO)
|
||||
list(APPEND OPENIMAGEIO_LIBRARIES
|
||||
@@ -350,7 +337,7 @@ if(WITH_CYCLES_EMBREE)
|
||||
find_package(Embree 3.8.0 REQUIRED)
|
||||
# Increase stack size for Embree, only works for executables.
|
||||
if(NOT WITH_PYTHON_MODULE)
|
||||
string(APPEND PLATFORM_LINKFLAGS " -Wl,-stack_size,0x100000")
|
||||
string(APPEND PLATFORM_LINKFLAGS " -Xlinker -stack_size -Xlinker 0x100000")
|
||||
endif()
|
||||
|
||||
# Embree static library linking can mix up SSE and AVX symbols, causing
|
||||
@@ -432,14 +419,6 @@ if(WITH_GMP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_HARU)
|
||||
find_package(Haru)
|
||||
if(NOT HARU_FOUND)
|
||||
message(WARNING "Haru not found, disabling WITH_HARU")
|
||||
set(WITH_HARU OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EXISTS ${LIBDIR})
|
||||
without_system_libs_end()
|
||||
endif()
|
||||
@@ -470,8 +449,8 @@ endif()
|
||||
|
||||
# Avoid conflicts with Luxrender, and other plug-ins that may use the same
|
||||
# libraries as Blender with a different version or build options.
|
||||
string(APPEND PLATFORM_LINKFLAGS
|
||||
" -Wl,-unexported_symbols_list,'${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
|
||||
set(PLATFORM_LINKFLAGS
|
||||
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker '${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
|
||||
)
|
||||
|
||||
string(APPEND CMAKE_CXX_FLAGS " -stdlib=libc++")
|
||||
@@ -482,17 +461,3 @@ set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
||||
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
||||
|
||||
if(WITH_COMPILER_CCACHE)
|
||||
if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
|
||||
find_program(CCACHE_PROGRAM ccache)
|
||||
if(CCACHE_PROGRAM)
|
||||
# Makefiles and ninja
|
||||
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" CACHE STRING "" FORCE)
|
||||
else()
|
||||
message(WARNING "Ccache NOT found, disabling WITH_COMPILER_CCACHE")
|
||||
set(WITH_COMPILER_CCACHE OFF)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -154,32 +154,3 @@ if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")
|
||||
string(APPEND CMAKE_CXX_FLAGS " -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
add_definitions("-DMACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
endif()
|
||||
|
||||
if(WITH_COMPILER_CCACHE)
|
||||
if(CMAKE_GENERATOR STREQUAL "Xcode")
|
||||
find_program(CCACHE_PROGRAM ccache)
|
||||
if(CCACHE_PROGRAM)
|
||||
get_filename_component(ccompiler "${CMAKE_C_COMPILER}" NAME)
|
||||
get_filename_component(cxxcompiler "${CMAKE_CXX_COMPILER}" NAME)
|
||||
# Ccache can figure out which compiler to use if it's invoked from
|
||||
# a symlink with the name of the compiler.
|
||||
# https://ccache.dev/manual/4.1.html#_run_modes
|
||||
set(_fake_compiler_dir "${CMAKE_BINARY_DIR}/ccache")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${_fake_compiler_dir})
|
||||
set(_fake_C_COMPILER "${_fake_compiler_dir}/${ccompiler}")
|
||||
set(_fake_CXX_COMPILER "${_fake_compiler_dir}/${cxxcompiler}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${CCACHE_PROGRAM}" ${_fake_C_COMPILER})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${CCACHE_PROGRAM}" ${_fake_CXX_COMPILER})
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CC ${_fake_C_COMPILER} CACHE STRING "" FORCE)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CXX ${_fake_CXX_COMPILER} CACHE STRING "" FORCE)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_LD ${_fake_C_COMPILER} CACHE STRING "" FORCE)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS ${_fake_CXX_COMPILER} CACHE STRING "" FORCE)
|
||||
unset(_fake_compiler_dir)
|
||||
unset(_fake_C_COMPILER)
|
||||
unset(_fake_CXX_COMPILER)
|
||||
else()
|
||||
message(WARNING "Ccache NOT found, disabling WITH_COMPILER_CCACHE")
|
||||
set(WITH_COMPILER_CCACHE OFF)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -350,17 +350,15 @@ if(WITH_BOOST)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_PUGIXML)
|
||||
find_package_wrapper(PugiXML)
|
||||
|
||||
if (NOT PUGIXML_FOUND)
|
||||
set(WITH_PUGIXML OFF)
|
||||
message(STATUS "PugiXML not found, disabling WITH_PUGIXML")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_OPENIMAGEIO)
|
||||
find_package_wrapper(OpenImageIO)
|
||||
if(NOT OPENIMAGEIO_PUGIXML_FOUND AND WITH_CYCLES_STANDALONE)
|
||||
find_package_wrapper(PugiXML)
|
||||
else()
|
||||
set(PUGIXML_INCLUDE_DIR "${OPENIMAGEIO_INCLUDE_DIR/OpenImageIO}")
|
||||
set(PUGIXML_LIBRARIES "")
|
||||
endif()
|
||||
|
||||
set(OPENIMAGEIO_LIBRARIES
|
||||
${OPENIMAGEIO_LIBRARIES}
|
||||
${PNG_LIBRARIES}
|
||||
@@ -615,13 +613,7 @@ endif()
|
||||
|
||||
# GNU Compiler
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
# ffp-contract=off:
|
||||
# Automatically turned on when building with "-march=native". This is
|
||||
# explicitly turned off here as it will make floating point math give a bit
|
||||
# different results. This will lead to automated test failures. So disable
|
||||
# this until we support it. Seems to default to off in clang and the intel
|
||||
# compiler.
|
||||
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off")
|
||||
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
|
||||
|
||||
# `maybe-uninitialized` is unreliable in release builds, but fine in debug builds.
|
||||
set(GCC_EXTRA_FLAGS_RELEASE "-Wno-maybe-uninitialized")
|
||||
@@ -695,15 +687,3 @@ set(PLATFORM_LINKFLAGS
|
||||
if(WITH_INSTALL_PORTABLE)
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " -no-pie")
|
||||
endif()
|
||||
|
||||
if(WITH_COMPILER_CCACHE)
|
||||
find_program(CCACHE_PROGRAM ccache)
|
||||
if(CCACHE_PROGRAM)
|
||||
# Makefiles and ninja
|
||||
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" CACHE STRING "" FORCE)
|
||||
else()
|
||||
message(WARNING "Ccache NOT found, disabling WITH_COMPILER_CCACHE")
|
||||
set(WITH_COMPILER_CCACHE OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -239,24 +239,9 @@ if(NOT EXISTS "${LIBDIR}/")
|
||||
message(FATAL_ERROR "\n\nWindows requires pre-compiled libs at: '${LIBDIR}'. Please run `make update` in the blender source folder to obtain them.")
|
||||
endif()
|
||||
|
||||
if(CMAKE_GENERATOR MATCHES "^Visual Studio.+" AND # Only supported in the VS IDE
|
||||
MSVC_VERSION GREATER_EQUAL 1924 AND # Supported for 16.4+
|
||||
WITH_CLANG_TIDY # And Clang Tidy needs to be on
|
||||
)
|
||||
set(CMAKE_VS_GLOBALS
|
||||
"RunCodeAnalysis=false"
|
||||
"EnableMicrosoftCodeAnalysis=false"
|
||||
"EnableClangTidyCodeAnalysis=true"
|
||||
)
|
||||
set(VS_CLANG_TIDY On)
|
||||
endif()
|
||||
|
||||
# Mark libdir as system headers with a lower warn level, to resolve some warnings
|
||||
# that we have very little control over
|
||||
if(MSVC_VERSION GREATER_EQUAL 1914 AND # Available with 15.7+
|
||||
NOT MSVC_CLANG AND # But not for clang
|
||||
NOT WITH_WINDOWS_SCCACHE AND # And not when sccache is enabled
|
||||
NOT VS_CLANG_TIDY) # Clang-tidy does not like these options
|
||||
if(MSVC_VERSION GREATER_EQUAL 1914 AND NOT MSVC_CLANG AND NOT WITH_WINDOWS_SCCACHE)
|
||||
add_compile_options(/experimental:external /external:templates- /external:I "${LIBDIR}" /external:W0)
|
||||
endif()
|
||||
|
||||
@@ -268,11 +253,6 @@ foreach(child ${children})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(WITH_PUGIXML)
|
||||
set(PUGIXML_LIBRARIES optimized ${LIBDIR}/pugixml/lib/pugixml.lib debug ${LIBDIR}/pugixml/lib/pugixml_d.lib)
|
||||
set(PUGIXML_INCLUDE_DIR ${LIBDIR}/pugixml/include)
|
||||
endif()
|
||||
|
||||
set(ZLIB_INCLUDE_DIRS ${LIBDIR}/zlib/include)
|
||||
set(ZLIB_LIBRARIES ${LIBDIR}/zlib/lib/libz_st.lib)
|
||||
set(ZLIB_INCLUDE_DIR ${LIBDIR}/zlib/include)
|
||||
@@ -671,10 +651,11 @@ if(WITH_CYCLES_OSL)
|
||||
optimized ${OSL_LIB_COMP}
|
||||
optimized ${OSL_LIB_EXEC}
|
||||
optimized ${OSL_LIB_QUERY}
|
||||
optimized ${CYCLES_OSL}/lib/pugixml.lib
|
||||
debug ${OSL_LIB_EXEC_DEBUG}
|
||||
debug ${OSL_LIB_COMP_DEBUG}
|
||||
debug ${OSL_LIB_QUERY_DEBUG}
|
||||
${PUGIXML_LIBRARIES}
|
||||
debug ${CYCLES_OSL}/lib/pugixml_d.lib
|
||||
)
|
||||
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
|
||||
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
|
||||
@@ -739,7 +720,7 @@ if(WINDOWS_PYTHON_DEBUG)
|
||||
string(REPLACE "/" "\\" _group_path "${_source_path}")
|
||||
source_group("${_group_path}" FILES "${_source}")
|
||||
endforeach()
|
||||
|
||||
|
||||
# If the user scripts env var is set, include scripts from there otherwise
|
||||
# include user scripts in the profile folder.
|
||||
if(DEFINED ENV{BLENDER_USER_SCRIPTS})
|
||||
@@ -750,7 +731,7 @@ if(WINDOWS_PYTHON_DEBUG)
|
||||
# Include the user scripts from the profile folder in the blender_python_user_scripts project.
|
||||
set(USER_SCRIPTS_ROOT "$ENV{appdata}/blender foundation/blender/${BLENDER_VERSION}/scripts")
|
||||
endif()
|
||||
|
||||
|
||||
file(TO_CMAKE_PATH ${USER_SCRIPTS_ROOT} USER_SCRIPTS_ROOT)
|
||||
FILE(GLOB_RECURSE inFiles "${USER_SCRIPTS_ROOT}/*.*" )
|
||||
ADD_CUSTOM_TARGET(blender_python_user_scripts SOURCES ${inFiles})
|
||||
@@ -800,15 +781,3 @@ if(WITH_POTRACE)
|
||||
set(POTRACE_LIBRARIES ${LIBDIR}/potrace/lib/potrace.lib)
|
||||
set(POTRACE_FOUND On)
|
||||
endif()
|
||||
|
||||
if(WITH_HARU)
|
||||
if(EXISTS ${LIBDIR}/haru)
|
||||
set(HARU_FOUND On)
|
||||
set(HARU_ROOT_DIR ${LIBDIR}/haru)
|
||||
set(HARU_INCLUDE_DIRS ${HARU_ROOT_DIR}/include)
|
||||
set(HARU_LIBRARIES ${HARU_ROOT_DIR}/lib/libhpdfs.lib)
|
||||
else()
|
||||
message(WARNING "Haru was not found, disabling WITH_HARU")
|
||||
set(WITH_HARU OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -8,7 +8,6 @@
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import platform
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
@@ -50,12 +49,7 @@ def svn_update(args, release_version):
|
||||
|
||||
# Checkout precompiled libraries
|
||||
if sys.platform == 'darwin':
|
||||
if platform.machine() == 'x86_64':
|
||||
lib_platform = "darwin"
|
||||
elif platform.machine() == 'arm64':
|
||||
lib_platform = "darwin_arm64"
|
||||
else:
|
||||
lib_platform = None
|
||||
lib_platform = "darwin"
|
||||
elif sys.platform == 'win32':
|
||||
# Windows checkout is usually handled by bat scripts since python3 to run
|
||||
# this script is bundled as part of the precompiled libraries. However it
|
||||
|
@@ -92,5 +92,5 @@ echo if "%%VSCMD_VER%%" == "" ^( >> %BUILD_DIR%\rebuild.cmd
|
||||
echo call "%VCVARS%" %BUILD_ARCH% >> %BUILD_DIR%\rebuild.cmd
|
||||
echo ^) >> %BUILD_DIR%\rebuild.cmd
|
||||
echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
|
||||
echo ninja install %%* >> %BUILD_DIR%\rebuild.cmd
|
||||
echo ninja install >> %BUILD_DIR%\rebuild.cmd
|
||||
echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
|
@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = "V2.93"
|
||||
PROJECT_NUMBER = "V2.92"
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
@@ -453,7 +453,7 @@ TYPEDEF_HIDES_STRUCT = NO
|
||||
# the optimal cache size from a speed point of view.
|
||||
# Minimum value: 0, maximum value: 9, default value: 0.
|
||||
|
||||
LOOKUP_CACHE_SIZE = 3
|
||||
LOOKUP_CACHE_SIZE = 0
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
@@ -1321,7 +1321,7 @@ DOCSET_PUBLISHER_NAME = Publisher
|
||||
# The default value is: NO.
|
||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||
|
||||
GENERATE_HTMLHELP = NO
|
||||
GENERATE_HTMLHELP = YES
|
||||
|
||||
# The CHM_FILE tag can be used to specify the file name of the resulting .chm
|
||||
# file. You can add a path in front of the file if the result should not be
|
||||
|
@@ -121,10 +121,6 @@
|
||||
* \ingroup editors
|
||||
*/
|
||||
|
||||
/** \defgroup edasset asset
|
||||
* \ingroup editors
|
||||
*/
|
||||
|
||||
/** \defgroup edcurve curve
|
||||
* \ingroup editors
|
||||
*/
|
||||
|
@@ -52,11 +52,10 @@ outfilename = sys.argv[2]
|
||||
|
||||
cmd = [blender_bin, "--help"]
|
||||
print(" executing:", " ".join(cmd))
|
||||
ASAN_OPTIONS = "exitcode=0:" + os.environ.get("ASAN_OPTIONS", "")
|
||||
blender_help = subprocess.run(
|
||||
cmd, env={"ASAN_OPTIONS": ASAN_OPTIONS}, check=True, stdout=subprocess.PIPE).stdout.decode(encoding="utf-8")
|
||||
cmd, env={"ASAN_OPTIONS": "exitcode=0"}, check=True, stdout=subprocess.PIPE).stdout.decode(encoding="utf-8")
|
||||
blender_version = subprocess.run(
|
||||
[blender_bin, "--version"], env={"ASAN_OPTIONS": ASAN_OPTIONS}, check=True, stdout=subprocess.PIPE).stdout.decode(encoding="utf-8").strip()
|
||||
[blender_bin, "--version"], env={"ASAN_OPTIONS": "exitcode=0"}, check=True, stdout=subprocess.PIPE).stdout.decode(encoding="utf-8").strip()
|
||||
blender_version, blender_date = (blender_version.split("build") + [None, None])[0:2]
|
||||
blender_version = blender_version.rstrip().partition(" ")[2] # remove 'Blender' prefix.
|
||||
if blender_date is None:
|
||||
|
@@ -1,30 +0,0 @@
|
||||
"""
|
||||
.. note::
|
||||
|
||||
Properties defined at run-time store the values of the properties as custom-properties.
|
||||
|
||||
This method checks if the underlying data exists, causing the property to be considered *set*.
|
||||
|
||||
A common pattern for operators is to calculate a value for the properties
|
||||
that have not had their values explicitly set by the caller
|
||||
(where the caller could be a key-binding, menu-items or Python script for example).
|
||||
|
||||
In the case of executing operators multiple times, values are re-used from the previous execution.
|
||||
|
||||
For example: subdividing a mesh with a smooth value of 1.0 will keep using
|
||||
that value on subsequent calls to subdivision, unless the operator is called with
|
||||
that property set to a different value.
|
||||
|
||||
This behavior can be disabled using the ``SKIP_SAVE`` option when the property is declared (see: :mod:`bpy.props`).
|
||||
|
||||
The ``ghost`` argument allows detecting how a value from a previous execution is handled.
|
||||
|
||||
- When true: The property is considered unset even if the value from a previous call is used.
|
||||
- When false: The existence of any values causes ``is_property_set`` to return true.
|
||||
|
||||
While this argument should typically be omitted, there are times when
|
||||
it's important to know if a value is anything besides the default.
|
||||
|
||||
For example, the previous value may have been scaled by the scene's unit scale.
|
||||
In this case scaling the value multiple times would cause problems, so the ``ghost`` argument should be false.
|
||||
"""
|
@@ -163,13 +163,13 @@ Now in the button's context menu select *Copy Data Path*, then paste the result
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
bpy.context.active_object.modifiers["Subdivision"].levels
|
||||
bpy.context.active_object.modifiers["Subsurf"].levels
|
||||
|
||||
Press :kbd:`Return` and you'll get the current value of 1. Now try changing the value to 2:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
bpy.context.active_object.modifiers["Subdivision"].levels = 2
|
||||
bpy.context.active_object.modifiers["Subsurf"].levels = 2
|
||||
|
||||
You can see the value update in the Subdivision Surface modifier's UI as well as the cube.
|
||||
|
||||
@@ -185,31 +185,43 @@ For example, if you want to access the texture of a brush via Python to adjust i
|
||||
#. Start in the default scene and enable Sculpt Mode from the 3D Viewport header.
|
||||
#. From the Sidebar expand the Brush Settings panel's *Texture* subpanel and add a new texture.
|
||||
*Notice the texture data-block menu itself doesn't have very useful links (you can check the tooltips).*
|
||||
#. The contrast setting isn't exposed in the Sidebar, so view the texture in the
|
||||
:ref:`Properties Editor <blender_manual:bpy.types.Texture.contrast`
|
||||
#. The contrast setting isn't exposed in the Sidebar, so view the texture in the properties editor:
|
||||
|
||||
- In the properties editor select the Texture tab.
|
||||
- Select brush texture.
|
||||
- Expand the *Colors* panel to locate the *Contrast* number field.
|
||||
#. Open the context menu of the contrast field and select *Online Python Reference*.
|
||||
This takes you to ``bpy.types.Texture.contrast``. Now you can see that ``contrast`` is a property of texture.
|
||||
#. To find out how to access the texture from the brush check on the references at the bottom of the page.
|
||||
Sometimes there are many references, and it may take some guesswork to find the right one,
|
||||
but in this case it's ``tool_settings.sculpt.brush.texture``.
|
||||
but in this case it's ``Brush.texture``.
|
||||
|
||||
#. Now you know that the texture can be accessed from ``bpy.data.brushes["BrushName"].texture``
|
||||
but normally you *won't* want to access the brush by name, instead you want to access the active brush.
|
||||
So the next step is to check on where brushes are accessed from via the references.
|
||||
In this case there it is simply ``bpy.context.brush``.
|
||||
|
||||
Now you can use the Python console to form the nested properties needed to access brush textures contrast:
|
||||
:menuselection:`Context --> Tool Settings --> Sculpt --> Brush --> Texture --> Contrast`.
|
||||
*Context -> Brush -> Texture -> Contrast*.
|
||||
|
||||
Since the attribute for each is given along the way you can compose the data path in the Python console:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
bpy.context.tool_settings.sculpt.brush.texture.contrast
|
||||
bpy.context.brush.texture.contrast
|
||||
|
||||
There can be multiple ways to access the same data, which you choose often depends on the task.
|
||||
An alternate path to access the same setting is:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
bpy.context.sculpt.brush.texture.contrast
|
||||
|
||||
Or access the brush directly:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
bpy.data.textures["Texture"].contrast
|
||||
bpy.data.brushes["BrushName"].texture.contrast
|
||||
|
||||
|
||||
If you are writing a user tool normally you want to use the :mod:`bpy.context` since the user normally expects
|
||||
|
@@ -35,13 +35,12 @@ but not to fully cover each topic.
|
||||
|
||||
A quick list of helpful things to know before starting:
|
||||
|
||||
- Enable :ref:`Developer Extra <blender_manual:prefs-interface-dev-extras`
|
||||
and :ref:`Python Tooltips <blender_manual:prefs-interface-tooltips-python>`.
|
||||
- The :ref:`Python Console <blender_manual:bpy.types.SpaceConsole>`
|
||||
is great for testing one-liners; it has autocompletion so you can inspect the API quickly.
|
||||
- Button tooltips show Python attributes and operator names (when enabled see above).
|
||||
- The context menu of buttons directly links to this API documentation (when enabled see above).
|
||||
- Many python examples can be found in the text editor's template menu.
|
||||
- Blender uses Python 3.x; some online documentation still assumes version 2.x.
|
||||
- The interactive console is great for testing one-liners.
|
||||
It also has autocompletion so you can inspect the API quickly.
|
||||
- Button tooltips show Python attributes and operator names.
|
||||
- The context menu of buttons directly links to this API documentation.
|
||||
- More operator examples can be found in the text editor's template menu.
|
||||
- To examine further scripts distributed with Blender, see:
|
||||
|
||||
- ``scripts/startup/bl_ui`` for the user interface.
|
||||
@@ -238,7 +237,7 @@ Examples:
|
||||
{'FINISHED'}
|
||||
>>> bpy.ops.mesh.hide(unselected=False)
|
||||
{'FINISHED'}
|
||||
>>> bpy.ops.object.transform_apply()
|
||||
>>> bpy.ops.object.scale_apply()
|
||||
{'FINISHED'}
|
||||
|
||||
.. tip::
|
||||
|
@@ -24,9 +24,10 @@ The three main use cases for the terminal are:
|
||||
- If the script runs for too long or you accidentally enter an infinite loop,
|
||||
:kbd:`Ctrl-C` in the terminal (:kbd:`Ctrl-Break` on Windows) will quit the script early.
|
||||
|
||||
.. seealso::
|
||||
.. note::
|
||||
|
||||
:ref:`blender_manual:command_line-launch-index`.
|
||||
For Linux and macOS users this means starting the terminal first, then running Blender from within it.
|
||||
On Windows the terminal can be enabled from the Help menu.
|
||||
|
||||
|
||||
Interface Tricks
|
||||
|
@@ -551,7 +551,7 @@ def example_extract_docstring(filepath):
|
||||
file.close()
|
||||
return "", 0
|
||||
|
||||
for line in file:
|
||||
for line in file.readlines():
|
||||
line_no += 1
|
||||
if line.startswith('"""'):
|
||||
break
|
||||
@@ -559,13 +559,6 @@ def example_extract_docstring(filepath):
|
||||
text.append(line.rstrip())
|
||||
|
||||
line_no += 1
|
||||
|
||||
# Skip over blank lines so the Python code doesn't have blank lines at the top.
|
||||
for line in file:
|
||||
if line.strip():
|
||||
break
|
||||
line_no += 1
|
||||
|
||||
file.close()
|
||||
return "\n".join(text), line_no
|
||||
|
||||
@@ -2195,20 +2188,9 @@ def setup_blender():
|
||||
|
||||
# Remove handlers since the functions get included
|
||||
# in the doc-string and don't have meaningful names.
|
||||
lists_to_restore = []
|
||||
for var in bpy.app.handlers:
|
||||
if isinstance(var, list):
|
||||
lists_to_restore.append((var[:], var))
|
||||
var.clear()
|
||||
|
||||
return {
|
||||
"lists_to_restore": lists_to_restore,
|
||||
}
|
||||
|
||||
|
||||
def teardown_blender(setup_data):
|
||||
for var_src, var_dst in setup_data["lists_to_restore"]:
|
||||
var_dst[:] = var_src
|
||||
for ls in bpy.app.handlers:
|
||||
if isinstance(ls, list):
|
||||
ls.clear()
|
||||
|
||||
|
||||
def main():
|
||||
@@ -2217,7 +2199,7 @@ def main():
|
||||
setup_monkey_patch()
|
||||
|
||||
# Perform changes to Blender it's self.
|
||||
setup_data = setup_blender()
|
||||
setup_blender()
|
||||
|
||||
# eventually, create the dirs
|
||||
for dir_path in [ARGS.output_dir, SPHINX_IN]:
|
||||
@@ -2323,8 +2305,6 @@ def main():
|
||||
shutil.copy(os.path.join(SPHINX_OUT_PDF, "contents.pdf"),
|
||||
os.path.join(REFERENCE_PATH, BLENDER_PDF_FILENAME))
|
||||
|
||||
teardown_blender(setup_data)
|
||||
|
||||
sys.exit()
|
||||
|
||||
|
||||
|
@@ -55,7 +55,7 @@ if $DO_EXE_BLENDER ; then
|
||||
# Don't delete existing docs, now partial updates are used for quick builds.
|
||||
#
|
||||
# Disable ASAN error halt since it results in nonzero exit code on any minor issue.
|
||||
ASAN_OPTIONS=halt_on_error=0:${ASAN_OPTIONS} \
|
||||
ASAN_OPTIONS=halt_on_error=0 \
|
||||
$BLENDER_BIN \
|
||||
--background \
|
||||
-noaudio \
|
||||
|
@@ -1,5 +1,7 @@
|
||||
/* T76453: Prevent Long enum lists */
|
||||
.field-list li {
|
||||
/* Prevent Long enum lists */
|
||||
.field-body {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-height: 245px;
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
|
4
extern/README
vendored
4
extern/README
vendored
@@ -1,4 +0,0 @@
|
||||
When updating a library remember to:
|
||||
|
||||
* Update the README.blender with the corresponding version.
|
||||
* Update the THIRD-PARTY-LICENSE.txt document
|
5
extern/audaspace/README.blender
vendored
5
extern/audaspace/README.blender
vendored
@@ -1,5 +0,0 @@
|
||||
Project: Audaspace
|
||||
URL: https://audaspace.github.io/
|
||||
License: Apache 2.0
|
||||
Upstream version: 1.3 (Last Release)
|
||||
Local modifications: None
|
2
extern/audaspace/blender_config.cmake
vendored
2
extern/audaspace/blender_config.cmake
vendored
@@ -24,6 +24,6 @@ set(JACK_FOUND ${WITH_JACK})
|
||||
set(LIBSNDFILE_FOUND ${WITH_CODEC_SNDFILE})
|
||||
set(OPENAL_FOUND ${WITH_OPENAL})
|
||||
set(PYTHONLIBS_FOUND TRUE)
|
||||
set(NUMPY_FOUND ${WITH_PYTHON_NUMPY})
|
||||
set(NUMPY_FOUND TRUE)
|
||||
set(NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_INCLUDE_DIRS})
|
||||
set(SDL_FOUND ${WITH_SDL})
|
||||
|
@@ -72,9 +72,6 @@ protected:
|
||||
/// The channel mapper reader in between.
|
||||
std::shared_ptr<ChannelMapperReader> m_mapper;
|
||||
|
||||
/// Whether the source is being read for the first time.
|
||||
bool m_first_reading;
|
||||
|
||||
/// Whether to keep the source if end of it is reached.
|
||||
bool m_keep;
|
||||
|
||||
|
19
extern/audaspace/src/devices/SoftwareDevice.cpp
vendored
19
extern/audaspace/src/devices/SoftwareDevice.cpp
vendored
@@ -78,7 +78,7 @@ bool SoftwareDevice::SoftwareHandle::pause(bool keep)
|
||||
}
|
||||
|
||||
SoftwareDevice::SoftwareHandle::SoftwareHandle(SoftwareDevice* device, std::shared_ptr<IReader> reader, std::shared_ptr<PitchReader> pitch, std::shared_ptr<ResampleReader> resampler, std::shared_ptr<ChannelMapperReader> mapper, bool keep) :
|
||||
m_reader(reader), m_pitch(pitch), m_resampler(resampler), m_mapper(mapper), m_first_reading(true), m_keep(keep), m_user_pitch(1.0f), m_user_volume(1.0f), m_user_pan(0.0f), m_volume(0.0f), m_old_volume(0.0f), m_loopcount(0),
|
||||
m_reader(reader), m_pitch(pitch), m_resampler(resampler), m_mapper(mapper), m_keep(keep), m_user_pitch(1.0f), m_user_volume(1.0f), m_user_pan(0.0f), m_volume(0.0f), m_old_volume(0.0f), m_loopcount(0),
|
||||
m_relative(true), m_volume_max(1.0f), m_volume_min(0), m_distance_max(std::numeric_limits<float>::max()),
|
||||
m_distance_reference(1.0f), m_attenuation(1.0f), m_cone_angle_outer(M_PI), m_cone_angle_inner(M_PI), m_cone_volume_outer(0),
|
||||
m_flags(RENDER_CONE), m_stop(nullptr), m_stop_data(nullptr), m_status(STATUS_PLAYING), m_device(device)
|
||||
@@ -106,14 +106,6 @@ void SoftwareDevice::SoftwareHandle::update()
|
||||
if(m_pitch->getSpecs().channels != CHANNELS_MONO)
|
||||
{
|
||||
m_volume = m_user_volume;
|
||||
|
||||
// we don't know a previous volume if this source has never been read before
|
||||
if(m_first_reading)
|
||||
{
|
||||
m_old_volume = m_volume;
|
||||
m_first_reading = false;
|
||||
}
|
||||
|
||||
m_pitch->setPitch(m_user_pitch);
|
||||
return;
|
||||
}
|
||||
@@ -222,13 +214,6 @@ void SoftwareDevice::SoftwareHandle::update()
|
||||
m_volume *= m_user_volume;
|
||||
}
|
||||
|
||||
// we don't know a previous volume if this source has never been read before
|
||||
if(m_first_reading)
|
||||
{
|
||||
m_old_volume = m_volume;
|
||||
m_first_reading = false;
|
||||
}
|
||||
|
||||
// 3D Cue
|
||||
|
||||
Quaternion orientation;
|
||||
@@ -769,8 +754,6 @@ void SoftwareDevice::mix(data_t* buffer, int length)
|
||||
{
|
||||
m_mixer->mix(buf, pos, len, sound->m_volume, sound->m_old_volume);
|
||||
|
||||
sound->m_old_volume = sound->m_volume;
|
||||
|
||||
pos += len;
|
||||
|
||||
if(sound->m_loopcount > 0)
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include <mutex>
|
||||
|
||||
#define KEEP_TIME 10
|
||||
#define POSITION_EPSILON (1.0 / static_cast<double>(RATE_48000))
|
||||
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
@@ -65,7 +64,7 @@ bool SequenceHandle::updatePosition(double position)
|
||||
if(m_handle.get())
|
||||
{
|
||||
// we currently have a handle, let's check where we are
|
||||
if(position - POSITION_EPSILON >= m_entry->m_end)
|
||||
if(position >= m_entry->m_end)
|
||||
{
|
||||
if(position >= m_entry->m_end + KEEP_TIME)
|
||||
// far end, stopping
|
||||
@@ -77,7 +76,7 @@ bool SequenceHandle::updatePosition(double position)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if(position + POSITION_EPSILON >= m_entry->m_begin)
|
||||
else if(position >= m_entry->m_begin)
|
||||
{
|
||||
// inside, resuming
|
||||
m_handle->resume();
|
||||
@@ -99,7 +98,7 @@ bool SequenceHandle::updatePosition(double position)
|
||||
else
|
||||
{
|
||||
// we don't have a handle, let's start if we should be playing
|
||||
if(position + POSITION_EPSILON >= m_entry->m_begin && position - POSITION_EPSILON <= m_entry->m_end)
|
||||
if(position >= m_entry->m_begin && position <= m_entry->m_end)
|
||||
{
|
||||
start();
|
||||
return m_valid;
|
||||
|
5
extern/bullet2/README.blender
vendored
5
extern/bullet2/README.blender
vendored
@@ -1,5 +0,0 @@
|
||||
Project: Bullet Continuous Collision Detection and Physics Library
|
||||
URL: http://bulletphysics.org
|
||||
License: zlib
|
||||
Upstream version: 3.07
|
||||
Local modifications: Fixed inertia
|
1
extern/ceres/README.blender
vendored
1
extern/ceres/README.blender
vendored
@@ -1,5 +1,4 @@
|
||||
Project: Ceres Solver
|
||||
URL: http://ceres-solver.org/
|
||||
License: BSD 3-Clause
|
||||
Upstream version 2.0.0
|
||||
Local modifications: None
|
||||
|
2
extern/curve_fit_nd/README.blender
vendored
2
extern/curve_fit_nd/README.blender
vendored
@@ -1,5 +1,5 @@
|
||||
Project: Curve-Fit-nD
|
||||
URL: https://github.com/ideasman42/curve-fit-nd
|
||||
License: BSD 3-Clause
|
||||
Upstream version: ddcd5bd (Last Release)
|
||||
Upstream version: Unknown (Last Release)
|
||||
Local modifications: None
|
||||
|
16
extern/draco/CMakeLists.txt
vendored
16
extern/draco/CMakeLists.txt
vendored
@@ -19,24 +19,20 @@
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
# Build Draco library.
|
||||
add_subdirectory(draco)
|
||||
add_subdirectory(dracoenc)
|
||||
|
||||
# Build Draco-Blender bridging module.
|
||||
# Build blender-draco-exporter module.
|
||||
set(SRC
|
||||
src/common.cpp
|
||||
src/common.h
|
||||
src/decoder.cpp
|
||||
src/decoder.h
|
||||
src/encoder.cpp
|
||||
src/encoder.h
|
||||
src/draco-compressor.cpp
|
||||
src/draco-compressor.h
|
||||
)
|
||||
|
||||
set(INC
|
||||
draco/src
|
||||
dracoenc/src
|
||||
)
|
||||
|
||||
set(LIB
|
||||
draco
|
||||
dracoenc
|
||||
)
|
||||
|
||||
add_library(extern_draco SHARED "${SRC}")
|
||||
|
5
extern/draco/README.blender
vendored
5
extern/draco/README.blender
vendored
@@ -1,5 +0,0 @@
|
||||
Project: Draco
|
||||
URL: https://google.github.io/draco/
|
||||
License: Apache 2.0
|
||||
Upstream version: 1.3.6
|
||||
Local modifications: None
|
10
extern/draco/draco/src/draco/draco_features.h
vendored
10
extern/draco/draco/src/draco/draco_features.h
vendored
@@ -1,10 +0,0 @@
|
||||
#ifndef DRACO_FEATURES_H_
|
||||
#define DRACO_FEATURES_H_
|
||||
|
||||
#define DRACO_MESH_COMPRESSION_SUPPORTED
|
||||
#define DRACO_NORMAL_ENCODING_SUPPORTED
|
||||
#define DRACO_STANDARD_EDGEBREAKER_SUPPORTED
|
||||
#define DRACO_ATTRIBUTE_INDICES_DEDUPLICATION_SUPPORTED
|
||||
#define DRACO_ATTRIBUTE_VALUES_DEDUPLICATION_SUPPORTED
|
||||
|
||||
#endif // DRACO_FEATURES_H_
|
@@ -2,165 +2,103 @@ remove_strict_flags()
|
||||
|
||||
set(SRC
|
||||
src/draco/animation/keyframe_animation.cc
|
||||
src/draco/animation/keyframe_animation.h
|
||||
src/draco/animation/keyframe_animation_decoder.cc
|
||||
src/draco/animation/keyframe_animation_decoder.h
|
||||
src/draco/animation/keyframe_animation_encoder.cc
|
||||
src/draco/animation/keyframe_animation_encoder.h
|
||||
src/draco/animation/keyframe_animation.h
|
||||
src/draco/attributes/attribute_octahedron_transform.cc
|
||||
src/draco/attributes/attribute_octahedron_transform.h
|
||||
src/draco/attributes/attribute_quantization_transform.cc
|
||||
src/draco/attributes/attribute_quantization_transform.h
|
||||
src/draco/attributes/attribute_transform.cc
|
||||
src/draco/attributes/attribute_transform.h
|
||||
src/draco/attributes/attribute_transform_data.h
|
||||
src/draco/attributes/attribute_transform.h
|
||||
src/draco/attributes/attribute_transform_type.h
|
||||
src/draco/attributes/geometry_attribute.cc
|
||||
src/draco/attributes/geometry_attribute.h
|
||||
src/draco/attributes/geometry_indices.h
|
||||
src/draco/attributes/point_attribute.cc
|
||||
src/draco/attributes/point_attribute.h
|
||||
src/draco/compression/attributes/attributes_decoder.cc
|
||||
src/draco/compression/attributes/attributes_decoder.h
|
||||
src/draco/compression/attributes/attributes_decoder_interface.h
|
||||
src/draco/compression/attributes/attributes_encoder.cc
|
||||
src/draco/compression/attributes/attributes_encoder.h
|
||||
src/draco/compression/attributes/kd_tree_attributes_decoder.cc
|
||||
src/draco/compression/attributes/kd_tree_attributes_decoder.h
|
||||
src/draco/compression/attributes/kd_tree_attributes_encoder.cc
|
||||
src/draco/compression/attributes/kd_tree_attributes_encoder.h
|
||||
src/draco/compression/attributes/kd_tree_attributes_shared.h
|
||||
src/draco/compression/attributes/linear_sequencer.h
|
||||
src/draco/compression/attributes/mesh_attribute_indices_encoding_data.h
|
||||
src/draco/compression/attributes/normal_compression_utils.h
|
||||
src/draco/compression/attributes/point_d_vector.h
|
||||
src/draco/compression/attributes/points_sequencer.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_constrained_multi_parallelogram_decoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_constrained_multi_parallelogram_encoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_constrained_multi_parallelogram_shared.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_data.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_decoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_encoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_decoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_encoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_predictor_area.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_predictor_base.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_multi_parallelogram_decoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_multi_parallelogram_encoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_parallelogram_decoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_parallelogram_encoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_parallelogram_shared.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_decoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_encoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_decoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_encoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_predictor.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_decoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_decoder_factory.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_decoder_interface.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_decoding_transform.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_delta_decoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_delta_encoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_encoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_encoder_factory.cc
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_encoder_factory.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_encoder.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_encoder_interface.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_encoding_transform.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_factory.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_interface.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_decoding_transform.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_encoding_transform.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_transform_base.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_decoding_transform.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_encoding_transform.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_transform_base.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_wrap_decoding_transform.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_wrap_encoding_transform.h
|
||||
src/draco/compression/attributes/prediction_schemes/prediction_scheme_wrap_transform_base.h
|
||||
src/draco/compression/attributes/sequential_attribute_decoder.cc
|
||||
src/draco/compression/attributes/sequential_attribute_decoder.h
|
||||
src/draco/compression/attributes/sequential_attribute_decoders_controller.cc
|
||||
src/draco/compression/attributes/sequential_attribute_decoders_controller.h
|
||||
src/draco/compression/attributes/sequential_attribute_encoder.cc
|
||||
src/draco/compression/attributes/sequential_attribute_encoder.h
|
||||
src/draco/compression/attributes/sequential_attribute_encoders_controller.cc
|
||||
src/draco/compression/attributes/sequential_attribute_encoders_controller.h
|
||||
src/draco/compression/attributes/sequential_integer_attribute_decoder.cc
|
||||
src/draco/compression/attributes/sequential_integer_attribute_decoder.h
|
||||
src/draco/compression/attributes/sequential_integer_attribute_encoder.cc
|
||||
src/draco/compression/attributes/sequential_integer_attribute_encoder.h
|
||||
src/draco/compression/attributes/sequential_normal_attribute_decoder.cc
|
||||
src/draco/compression/attributes/sequential_normal_attribute_decoder.h
|
||||
src/draco/compression/attributes/sequential_normal_attribute_encoder.cc
|
||||
src/draco/compression/attributes/sequential_normal_attribute_encoder.h
|
||||
src/draco/compression/attributes/sequential_quantization_attribute_decoder.cc
|
||||
src/draco/compression/attributes/sequential_quantization_attribute_decoder.h
|
||||
src/draco/compression/attributes/sequential_quantization_attribute_encoder.cc
|
||||
src/draco/compression/attributes/sequential_quantization_attribute_encoder.h
|
||||
src/draco/compression/bit_coders/adaptive_rans_bit_coding_shared.h
|
||||
src/draco/compression/bit_coders/adaptive_rans_bit_decoder.cc
|
||||
src/draco/compression/bit_coders/adaptive_rans_bit_decoder.h
|
||||
src/draco/compression/bit_coders/adaptive_rans_bit_encoder.cc
|
||||
src/draco/compression/bit_coders/adaptive_rans_bit_encoder.h
|
||||
src/draco/compression/bit_coders/direct_bit_decoder.cc
|
||||
src/draco/compression/bit_coders/direct_bit_decoder.h
|
||||
src/draco/compression/bit_coders/direct_bit_encoder.cc
|
||||
src/draco/compression/bit_coders/direct_bit_encoder.h
|
||||
src/draco/compression/bit_coders/folded_integer_bit_decoder.h
|
||||
src/draco/compression/bit_coders/folded_integer_bit_encoder.h
|
||||
src/draco/compression/bit_coders/rans_bit_decoder.cc
|
||||
src/draco/compression/bit_coders/rans_bit_decoder.h
|
||||
src/draco/compression/bit_coders/rans_bit_encoder.cc
|
||||
src/draco/compression/bit_coders/rans_bit_encoder.h
|
||||
src/draco/compression/bit_coders/symbol_bit_decoder.cc
|
||||
src/draco/compression/bit_coders/symbol_bit_decoder.h
|
||||
src/draco/compression/bit_coders/symbol_bit_encoder.cc
|
||||
src/draco/compression/bit_coders/symbol_bit_encoder.h
|
||||
src/draco/compression/config/compression_shared.h
|
||||
src/draco/compression/config/decoder_options.h
|
||||
src/draco/compression/config/draco_options.h
|
||||
src/draco/compression/config/encoder_options.h
|
||||
src/draco/compression/config/encoding_features.h
|
||||
src/draco/compression/decode.cc
|
||||
src/draco/compression/decode.h
|
||||
src/draco/compression/encode_base.h
|
||||
src/draco/compression/encode.cc
|
||||
src/draco/compression/encode.h
|
||||
src/draco/compression/encode_base.h
|
||||
src/draco/compression/entropy/ans.h
|
||||
src/draco/compression/entropy/rans_symbol_coding.h
|
||||
src/draco/compression/entropy/rans_symbol_decoder.h
|
||||
src/draco/compression/entropy/rans_symbol_encoder.h
|
||||
src/draco/compression/entropy/shannon_entropy.cc
|
||||
src/draco/compression/entropy/shannon_entropy.h
|
||||
src/draco/compression/entropy/symbol_decoding.cc
|
||||
src/draco/compression/entropy/symbol_decoding.h
|
||||
src/draco/compression/entropy/symbol_encoding.cc
|
||||
src/draco/compression/entropy/symbol_encoding.h
|
||||
src/draco/compression/expert_encode.cc
|
||||
src/draco/compression/expert_encode.h
|
||||
src/draco/compression/mesh/mesh_decoder.cc
|
||||
src/draco/compression/mesh/mesh_decoder.h
|
||||
src/draco/compression/mesh/mesh_edgebreaker_decoder.cc
|
||||
src/draco/compression/mesh/mesh_edgebreaker_decoder.h
|
||||
src/draco/compression/mesh/mesh_edgebreaker_decoder_impl.cc
|
||||
src/draco/compression/mesh/mesh_edgebreaker_decoder_impl.h
|
||||
src/draco/compression/mesh/mesh_edgebreaker_decoder_impl_interface.h
|
||||
src/draco/compression/mesh/mesh_edgebreaker_encoder.cc
|
||||
src/draco/compression/mesh/mesh_edgebreaker_encoder.h
|
||||
src/draco/compression/mesh/mesh_edgebreaker_encoder_impl.cc
|
||||
src/draco/compression/mesh/mesh_edgebreaker_encoder_impl.h
|
||||
src/draco/compression/mesh/mesh_edgebreaker_encoder_impl_interface.h
|
||||
src/draco/compression/mesh/mesh_edgebreaker_shared.h
|
||||
src/draco/compression/mesh/mesh_edgebreaker_traversal_decoder.h
|
||||
src/draco/compression/mesh/mesh_edgebreaker_traversal_encoder.h
|
||||
src/draco/compression/mesh/mesh_edgebreaker_traversal_predictive_decoder.h
|
||||
src/draco/compression/mesh/mesh_edgebreaker_traversal_predictive_encoder.h
|
||||
src/draco/compression/mesh/mesh_edgebreaker_traversal_valence_decoder.h
|
||||
src/draco/compression/mesh/mesh_edgebreaker_traversal_valence_encoder.h
|
||||
src/draco/compression/mesh/mesh_encoder.cc
|
||||
src/draco/compression/mesh/mesh_encoder.h
|
||||
src/draco/compression/mesh/mesh_sequential_decoder.cc
|
||||
src/draco/compression/mesh/mesh_sequential_decoder.h
|
||||
src/draco/compression/mesh/mesh_encoder_helpers.h
|
||||
src/draco/compression/mesh/mesh_sequential_encoder.cc
|
||||
src/draco/compression/mesh/mesh_sequential_encoder.h
|
||||
src/draco/compression/mesh/traverser/depth_first_traverser.h
|
||||
@@ -168,32 +106,18 @@ set(SRC
|
||||
src/draco/compression/mesh/traverser/mesh_attribute_indices_encoding_observer.h
|
||||
src/draco/compression/mesh/traverser/mesh_traversal_sequencer.h
|
||||
src/draco/compression/mesh/traverser/traverser_base.h
|
||||
src/draco/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_decoder.cc
|
||||
src/draco/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_decoder.h
|
||||
src/draco/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_encoder.cc
|
||||
src/draco/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_encoder.h
|
||||
src/draco/compression/point_cloud/algorithms/float_points_tree_decoder.cc
|
||||
src/draco/compression/point_cloud/algorithms/float_points_tree_decoder.h
|
||||
src/draco/compression/point_cloud/algorithms/float_points_tree_encoder.cc
|
||||
src/draco/compression/point_cloud/algorithms/float_points_tree_encoder.h
|
||||
src/draco/compression/point_cloud/algorithms/integer_points_kd_tree_decoder.cc
|
||||
src/draco/compression/point_cloud/algorithms/integer_points_kd_tree_decoder.h
|
||||
src/draco/compression/point_cloud/algorithms/integer_points_kd_tree_encoder.cc
|
||||
src/draco/compression/point_cloud/algorithms/integer_points_kd_tree_encoder.h
|
||||
src/draco/compression/point_cloud/algorithms/point_cloud_compression_method.h
|
||||
src/draco/compression/point_cloud/algorithms/point_cloud_types.h
|
||||
src/draco/compression/point_cloud/algorithms/quantize_points_3.h
|
||||
src/draco/compression/point_cloud/algorithms/queuing_policy.h
|
||||
src/draco/compression/point_cloud/point_cloud_decoder.cc
|
||||
src/draco/compression/point_cloud/point_cloud_decoder.h
|
||||
src/draco/compression/point_cloud/point_cloud_encoder.cc
|
||||
src/draco/compression/point_cloud/point_cloud_encoder.h
|
||||
src/draco/compression/point_cloud/point_cloud_kd_tree_decoder.cc
|
||||
src/draco/compression/point_cloud/point_cloud_kd_tree_decoder.h
|
||||
src/draco/compression/point_cloud/point_cloud_kd_tree_encoder.cc
|
||||
src/draco/compression/point_cloud/point_cloud_kd_tree_encoder.h
|
||||
src/draco/compression/point_cloud/point_cloud_sequential_decoder.cc
|
||||
src/draco/compression/point_cloud/point_cloud_sequential_decoder.h
|
||||
src/draco/compression/point_cloud/point_cloud_sequential_encoder.cc
|
||||
src/draco/compression/point_cloud/point_cloud_sequential_encoder.h
|
||||
src/draco/core/bit_utils.cc
|
||||
@@ -204,15 +128,12 @@ set(SRC
|
||||
src/draco/core/cycle_timer.h
|
||||
src/draco/core/data_buffer.cc
|
||||
src/draco/core/data_buffer.h
|
||||
src/draco/core/decoder_buffer.cc
|
||||
src/draco/core/decoder_buffer.h
|
||||
src/draco/core/divide.cc
|
||||
src/draco/core/divide.h
|
||||
src/draco/core/draco_index_type.h
|
||||
src/draco/core/draco_index_type_vector.h
|
||||
src/draco/core/draco_types.cc
|
||||
src/draco/core/draco_types.h
|
||||
src/draco/core/draco_version.h
|
||||
src/draco/core/encoder_buffer.cc
|
||||
src/draco/core/encoder_buffer.h
|
||||
src/draco/core/hash_utils.cc
|
||||
@@ -224,21 +145,20 @@ set(SRC
|
||||
src/draco/core/quantization_utils.cc
|
||||
src/draco/core/quantization_utils.h
|
||||
src/draco/core/status.h
|
||||
src/draco/core/status_or.h
|
||||
src/draco/core/varint_decoding.h
|
||||
src/draco/core/statusor.h
|
||||
src/draco/core/varint_encoding.h
|
||||
src/draco/core/vector_d.h
|
||||
src/draco/mesh/corner_table.cc
|
||||
src/draco/mesh/corner_table.h
|
||||
src/draco/mesh/corner_table_iterators.h
|
||||
src/draco/mesh/mesh.cc
|
||||
src/draco/mesh/mesh.h
|
||||
src/draco/mesh/mesh_are_equivalent.cc
|
||||
src/draco/mesh/mesh_are_equivalent.h
|
||||
src/draco/mesh/mesh_attribute_corner_table.cc
|
||||
src/draco/mesh/mesh_attribute_corner_table.h
|
||||
src/draco/mesh/mesh.cc
|
||||
src/draco/mesh/mesh_cleanup.cc
|
||||
src/draco/mesh/mesh_cleanup.h
|
||||
src/draco/mesh/mesh.h
|
||||
src/draco/mesh/mesh_misc_functions.cc
|
||||
src/draco/mesh/mesh_misc_functions.h
|
||||
src/draco/mesh/mesh_stripifier.cc
|
||||
@@ -249,15 +169,13 @@ set(SRC
|
||||
src/draco/metadata/geometry_metadata.cc
|
||||
src/draco/metadata/geometry_metadata.h
|
||||
src/draco/metadata/metadata.cc
|
||||
src/draco/metadata/metadata.h
|
||||
src/draco/metadata/metadata_decoder.cc
|
||||
src/draco/metadata/metadata_decoder.h
|
||||
src/draco/metadata/metadata_encoder.cc
|
||||
src/draco/metadata/metadata_encoder.h
|
||||
src/draco/point_cloud/point_cloud.cc
|
||||
src/draco/point_cloud/point_cloud.h
|
||||
src/draco/metadata/metadata.h
|
||||
src/draco/point_cloud/point_cloud_builder.cc
|
||||
src/draco/point_cloud/point_cloud_builder.h
|
||||
src/draco/point_cloud/point_cloud.cc
|
||||
src/draco/point_cloud/point_cloud.h
|
||||
)
|
||||
|
||||
set(LIB
|
||||
@@ -267,4 +185,4 @@ set(INC
|
||||
src
|
||||
)
|
||||
|
||||
blender_add_lib(draco "${SRC}" "${INC}" "" "${LIB}")
|
||||
blender_add_lib(dracoenc "${SRC}" "${INC}" "" "${LIB}")
|
3
extern/draco/dracoenc/cmake/DracoConfig.cmake
vendored
Normal file
3
extern/draco/dracoenc/cmake/DracoConfig.cmake
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
@PACKAGE_INIT@
|
||||
set_and_check(draco_INCLUDE_DIR "@PACKAGE_draco_include_install_dir@")
|
||||
set_and_check(draco_LIBRARY_DIR "@PACKAGE_draco_lib_install_dir@")
|
58
extern/draco/dracoenc/cmake/FindDraco.cmake
vendored
Normal file
58
extern/draco/dracoenc/cmake/FindDraco.cmake
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
# Finddraco
|
||||
#
|
||||
# Locates draco and sets the following variables:
|
||||
#
|
||||
# draco_FOUND
|
||||
# draco_INCLUDE_DIRS
|
||||
# draco_LIBARY_DIRS
|
||||
# draco_LIBRARIES
|
||||
# draco_VERSION_STRING
|
||||
#
|
||||
# draco_FOUND is set to YES only when all other variables are successfully
|
||||
# configured.
|
||||
|
||||
unset(draco_FOUND)
|
||||
unset(draco_INCLUDE_DIRS)
|
||||
unset(draco_LIBRARY_DIRS)
|
||||
unset(draco_LIBRARIES)
|
||||
unset(draco_VERSION_STRING)
|
||||
|
||||
mark_as_advanced(draco_FOUND)
|
||||
mark_as_advanced(draco_INCLUDE_DIRS)
|
||||
mark_as_advanced(draco_LIBRARY_DIRS)
|
||||
mark_as_advanced(draco_LIBRARIES)
|
||||
mark_as_advanced(draco_VERSION_STRING)
|
||||
|
||||
set(draco_version_file_no_prefix "draco/src/draco/core/draco_version.h")
|
||||
|
||||
# Set draco_INCLUDE_DIRS
|
||||
find_path(draco_INCLUDE_DIRS NAMES "${draco_version_file_no_prefix}")
|
||||
|
||||
# Extract the version string from draco_version.h.
|
||||
if (draco_INCLUDE_DIRS)
|
||||
set(draco_version_file
|
||||
"${draco_INCLUDE_DIRS}/draco/src/draco/core/draco_version.h")
|
||||
file(STRINGS "${draco_version_file}" draco_version
|
||||
REGEX "kdracoVersion")
|
||||
list(GET draco_version 0 draco_version)
|
||||
string(REPLACE "static const char kdracoVersion[] = " "" draco_version
|
||||
"${draco_version}")
|
||||
string(REPLACE ";" "" draco_version "${draco_version}")
|
||||
string(REPLACE "\"" "" draco_version "${draco_version}")
|
||||
set(draco_VERSION_STRING ${draco_version})
|
||||
endif ()
|
||||
|
||||
# Find the library.
|
||||
if (BUILD_SHARED_LIBS)
|
||||
find_library(draco_LIBRARIES NAMES draco.dll libdraco.dylib libdraco.so)
|
||||
else ()
|
||||
find_library(draco_LIBRARIES NAMES draco.lib libdraco.a)
|
||||
endif ()
|
||||
|
||||
# Store path to library.
|
||||
get_filename_component(draco_LIBRARY_DIRS ${draco_LIBRARIES} DIRECTORY)
|
||||
|
||||
if (draco_INCLUDE_DIRS AND draco_LIBRARY_DIRS AND draco_LIBRARIES AND
|
||||
draco_VERSION_STRING)
|
||||
set(draco_FOUND YES)
|
||||
endif ()
|
216
extern/draco/dracoenc/cmake/compiler_flags.cmake
vendored
Normal file
216
extern/draco/dracoenc/cmake/compiler_flags.cmake
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
if (NOT DRACO_CMAKE_COMPILER_FLAGS_CMAKE_)
|
||||
set(DRACO_CMAKE_COMPILER_FLAGS_CMAKE_ 1)
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
include("${draco_root}/cmake/compiler_tests.cmake")
|
||||
|
||||
# Strings used to cache failed C/CXX flags.
|
||||
set(DRACO_FAILED_C_FLAGS)
|
||||
set(DRACO_FAILED_CXX_FLAGS)
|
||||
|
||||
# Checks C compiler for support of $c_flag. Adds $c_flag to $CMAKE_C_FLAGS when
|
||||
# the compile test passes. Caches $c_flag in $DRACO_FAILED_C_FLAGS when the test
|
||||
# fails.
|
||||
macro (add_c_flag_if_supported c_flag)
|
||||
unset(C_FLAG_FOUND CACHE)
|
||||
string(FIND "${CMAKE_C_FLAGS}" "${c_flag}" C_FLAG_FOUND)
|
||||
unset(C_FLAG_FAILED CACHE)
|
||||
string(FIND "${DRACO_FAILED_C_FLAGS}" "${c_flag}" C_FLAG_FAILED)
|
||||
|
||||
if (${C_FLAG_FOUND} EQUAL -1 AND ${C_FLAG_FAILED} EQUAL -1)
|
||||
unset(C_FLAG_SUPPORTED CACHE)
|
||||
message("Checking C compiler flag support for: " ${c_flag})
|
||||
check_c_compiler_flag("${c_flag}" C_FLAG_SUPPORTED)
|
||||
if (${C_FLAG_SUPPORTED})
|
||||
string(APPEND CMAKE_C_FLAGS " ${c_flag}" CACHE STRING "")
|
||||
else ()
|
||||
string(APPEND DRACO_FAILED_C_FLAGS " ${c_flag}" CACHE STRING
|
||||
"" FORCE)
|
||||
endif ()
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Checks C++ compiler for support of $cxx_flag. Adds $cxx_flag to
|
||||
# $CMAKE_CXX_FLAGS when the compile test passes. Caches $c_flag in
|
||||
# $DRACO_FAILED_CXX_FLAGS when the test fails.
|
||||
macro (add_cxx_flag_if_supported cxx_flag)
|
||||
unset(CXX_FLAG_FOUND CACHE)
|
||||
string(FIND "${CMAKE_CXX_FLAGS}" "${cxx_flag}" CXX_FLAG_FOUND)
|
||||
unset(CXX_FLAG_FAILED CACHE)
|
||||
string(FIND "${DRACO_FAILED_CXX_FLAGS}" "${cxx_flag}" CXX_FLAG_FAILED)
|
||||
|
||||
if (${CXX_FLAG_FOUND} EQUAL -1 AND ${CXX_FLAG_FAILED} EQUAL -1)
|
||||
unset(CXX_FLAG_SUPPORTED CACHE)
|
||||
message("Checking CXX compiler flag support for: " ${cxx_flag})
|
||||
check_cxx_compiler_flag("${cxx_flag}" CXX_FLAG_SUPPORTED)
|
||||
if (${CXX_FLAG_SUPPORTED})
|
||||
string(APPEND CMAKE_CXX_FLAGS " ${cxx_flag}" CACHE STRING "")
|
||||
else()
|
||||
string(APPEND DRACO_FAILED_CXX_FLAGS " ${cxx_flag}" CACHE
|
||||
STRING "" FORCE)
|
||||
endif ()
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Convenience method for adding a flag to both the C and C++ compiler command
|
||||
# lines.
|
||||
macro (add_compiler_flag_if_supported flag)
|
||||
add_c_flag_if_supported(${flag})
|
||||
add_cxx_flag_if_supported(${flag})
|
||||
endmacro ()
|
||||
|
||||
# Checks C compiler for support of $c_flag and terminates generation when
|
||||
# support is not present.
|
||||
macro (require_c_flag c_flag update_c_flags)
|
||||
unset(C_FLAG_FOUND CACHE)
|
||||
string(FIND "${CMAKE_C_FLAGS}" "${c_flag}" C_FLAG_FOUND)
|
||||
|
||||
if (${C_FLAG_FOUND} EQUAL -1)
|
||||
unset(HAVE_C_FLAG CACHE)
|
||||
message("Checking C compiler flag support for: " ${c_flag})
|
||||
check_c_compiler_flag("${c_flag}" HAVE_C_FLAG)
|
||||
if (NOT ${HAVE_C_FLAG})
|
||||
message(FATAL_ERROR
|
||||
"${PROJECT_NAME} requires support for C flag: ${c_flag}.")
|
||||
endif ()
|
||||
if (${update_c_flags})
|
||||
set(CMAKE_C_FLAGS "${c_flag} ${CMAKE_C_FLAGS}" CACHE STRING "" FORCE)
|
||||
endif ()
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Checks CXX compiler for support of $cxx_flag and terminates generation when
|
||||
# support is not present.
|
||||
macro (require_cxx_flag cxx_flag update_cxx_flags)
|
||||
unset(CXX_FLAG_FOUND CACHE)
|
||||
string(FIND "${CMAKE_CXX_FLAGS}" "${cxx_flag}" CXX_FLAG_FOUND)
|
||||
|
||||
if (${CXX_FLAG_FOUND} EQUAL -1)
|
||||
unset(HAVE_CXX_FLAG CACHE)
|
||||
message("Checking CXX compiler flag support for: " ${cxx_flag})
|
||||
check_cxx_compiler_flag("${cxx_flag}" HAVE_CXX_FLAG)
|
||||
if (NOT ${HAVE_CXX_FLAG})
|
||||
message(FATAL_ERROR
|
||||
"${PROJECT_NAME} requires support for CXX flag: ${cxx_flag}.")
|
||||
endif ()
|
||||
if (${update_cxx_flags})
|
||||
set(CMAKE_CXX_FLAGS "${cxx_flag} ${CMAKE_CXX_FLAGS}" CACHE STRING ""
|
||||
FORCE)
|
||||
endif ()
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Checks for support of $flag by both the C and CXX compilers. Terminates
|
||||
# generation when support is not present in both compilers.
|
||||
macro (require_compiler_flag flag update_cmake_flags)
|
||||
require_c_flag(${flag} ${update_cmake_flags})
|
||||
require_cxx_flag(${flag} ${update_cmake_flags})
|
||||
endmacro ()
|
||||
|
||||
# Checks only non-MSVC targets for support of $c_flag and terminates generation
|
||||
# when support is not present.
|
||||
macro (require_c_flag_nomsvc c_flag update_c_flags)
|
||||
if (NOT MSVC)
|
||||
require_c_flag(${c_flag} ${update_c_flags})
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Checks only non-MSVC targets for support of $cxx_flag and terminates
|
||||
# generation when support is not present.
|
||||
macro (require_cxx_flag_nomsvc cxx_flag update_cxx_flags)
|
||||
if (NOT MSVC)
|
||||
require_cxx_flag(${cxx_flag} ${update_cxx_flags})
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Checks only non-MSVC targets for support of $flag by both the C and CXX
|
||||
# compilers. Terminates generation when support is not present in both
|
||||
# compilers.
|
||||
macro (require_compiler_flag_nomsvc flag update_cmake_flags)
|
||||
require_c_flag_nomsvc(${flag} ${update_cmake_flags})
|
||||
require_cxx_flag_nomsvc(${flag} ${update_cmake_flags})
|
||||
endmacro ()
|
||||
|
||||
# Adds $flag to assembler command line.
|
||||
macro (append_as_flag flag)
|
||||
unset(AS_FLAG_FOUND CACHE)
|
||||
string(FIND "${DRACO_AS_FLAGS}" "${flag}" AS_FLAG_FOUND)
|
||||
|
||||
if (${AS_FLAG_FOUND} EQUAL -1)
|
||||
string(APPEND DRACO_AS_FLAGS " ${flag}")
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Adds $flag to the C compiler command line.
|
||||
macro (append_c_flag flag)
|
||||
unset(C_FLAG_FOUND CACHE)
|
||||
string(FIND "${CMAKE_C_FLAGS}" "${flag}" C_FLAG_FOUND)
|
||||
|
||||
if (${C_FLAG_FOUND} EQUAL -1)
|
||||
string(APPEND CMAKE_C_FLAGS " ${flag}")
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Adds $flag to the CXX compiler command line.
|
||||
macro (append_cxx_flag flag)
|
||||
unset(CXX_FLAG_FOUND CACHE)
|
||||
string(FIND "${CMAKE_CXX_FLAGS}" "${flag}" CXX_FLAG_FOUND)
|
||||
|
||||
if (${CXX_FLAG_FOUND} EQUAL -1)
|
||||
string(APPEND CMAKE_CXX_FLAGS " ${flag}")
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Adds $flag to the C and CXX compiler command lines.
|
||||
macro (append_compiler_flag flag)
|
||||
append_c_flag(${flag})
|
||||
append_cxx_flag(${flag})
|
||||
endmacro ()
|
||||
|
||||
# Adds $flag to the executable linker command line.
|
||||
macro (append_exe_linker_flag flag)
|
||||
unset(LINKER_FLAG_FOUND CACHE)
|
||||
string(FIND "${CMAKE_EXE_LINKER_FLAGS}" "${flag}" LINKER_FLAG_FOUND)
|
||||
|
||||
if (${LINKER_FLAG_FOUND} EQUAL -1)
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " ${flag}")
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Adds $flag to the link flags for $target.
|
||||
function (append_link_flag_to_target target flags)
|
||||
unset(target_link_flags)
|
||||
get_target_property(target_link_flags ${target} LINK_FLAGS)
|
||||
|
||||
if (target_link_flags)
|
||||
unset(link_flag_found)
|
||||
string(FIND "${target_link_flags}" "${flags}" link_flag_found)
|
||||
|
||||
if (NOT ${link_flag_found} EQUAL -1)
|
||||
return()
|
||||
endif ()
|
||||
|
||||
string(APPEND target_link_flags " ${flags}")
|
||||
else ()
|
||||
set(target_link_flags "${flags}")
|
||||
endif ()
|
||||
|
||||
set_target_properties(${target} PROPERTIES LINK_FLAGS ${target_link_flags})
|
||||
endfunction ()
|
||||
|
||||
# Adds $flag to executable linker flags, and makes sure C/CXX builds still work.
|
||||
macro (require_linker_flag flag)
|
||||
append_exe_linker_flag(${flag})
|
||||
|
||||
unset(c_passed)
|
||||
draco_check_c_compiles("LINKER_FLAG_C_TEST(${flag})" "" c_passed)
|
||||
unset(cxx_passed)
|
||||
draco_check_cxx_compiles("LINKER_FLAG_CXX_TEST(${flag})" "" cxx_passed)
|
||||
|
||||
if (NOT c_passed OR NOT cxx_passed)
|
||||
message(FATAL_ERROR "Linker flag test for ${flag} failed.")
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
endif () # DRACO_CMAKE_COMPILER_FLAGS_CMAKE_
|
124
extern/draco/dracoenc/cmake/compiler_tests.cmake
vendored
Normal file
124
extern/draco/dracoenc/cmake/compiler_tests.cmake
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
if (NOT DRACO_CMAKE_COMPILER_TESTS_CMAKE_)
|
||||
set(DRACO_CMAKE_COMPILER_TESTS_CMAKE_ 1)
|
||||
|
||||
include(CheckCSourceCompiles)
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
# The basic main() macro used in all compile tests.
|
||||
set(DRACO_C_MAIN "\nint main(void) { return 0; }")
|
||||
set(DRACO_CXX_MAIN "\nint main() { return 0; }")
|
||||
|
||||
# Strings containing the names of passed and failed tests.
|
||||
set(DRACO_C_PASSED_TESTS)
|
||||
set(DRACO_C_FAILED_TESTS)
|
||||
set(DRACO_CXX_PASSED_TESTS)
|
||||
set(DRACO_CXX_FAILED_TESTS)
|
||||
|
||||
macro(draco_push_var var new_value)
|
||||
set(SAVED_${var} ${var})
|
||||
set(${var} ${new_value})
|
||||
endmacro ()
|
||||
|
||||
macro(draco_pop_var var)
|
||||
set(var ${SAVED_${var}})
|
||||
unset(SAVED_${var})
|
||||
endmacro ()
|
||||
|
||||
# Confirms $test_source compiles and stores $test_name in one of
|
||||
# $DRACO_C_PASSED_TESTS or $DRACO_C_FAILED_TESTS depending on out come. When the
|
||||
# test passes $result_var is set to 1. When it fails $result_var is unset.
|
||||
# The test is not run if the test name is found in either of the passed or
|
||||
# failed test variables.
|
||||
macro(draco_check_c_compiles test_name test_source result_var)
|
||||
unset(C_TEST_PASSED CACHE)
|
||||
unset(C_TEST_FAILED CACHE)
|
||||
string(FIND "${DRACO_C_PASSED_TESTS}" "${test_name}" C_TEST_PASSED)
|
||||
string(FIND "${DRACO_C_FAILED_TESTS}" "${test_name}" C_TEST_FAILED)
|
||||
if (${C_TEST_PASSED} EQUAL -1 AND ${C_TEST_FAILED} EQUAL -1)
|
||||
unset(C_TEST_COMPILED CACHE)
|
||||
message("Running C compiler test: ${test_name}")
|
||||
check_c_source_compiles("${test_source} ${DRACO_C_MAIN}" C_TEST_COMPILED)
|
||||
set(${result_var} ${C_TEST_COMPILED})
|
||||
|
||||
if (${C_TEST_COMPILED})
|
||||
string(APPEND DRACO_C_PASSED_TESTS " ${test_name}")
|
||||
else ()
|
||||
string(APPEND DRACO_C_FAILED_TESTS " ${test_name}")
|
||||
message("C Compiler test ${test_name} failed.")
|
||||
endif ()
|
||||
elseif (NOT ${C_TEST_PASSED} EQUAL -1)
|
||||
set(${result_var} 1)
|
||||
else () # ${C_TEST_FAILED} NOT EQUAL -1
|
||||
unset(${result_var})
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Confirms $test_source compiles and stores $test_name in one of
|
||||
# $DRACO_CXX_PASSED_TESTS or $DRACO_CXX_FAILED_TESTS depending on out come. When
|
||||
# the test passes $result_var is set to 1. When it fails $result_var is unset.
|
||||
# The test is not run if the test name is found in either of the passed or
|
||||
# failed test variables.
|
||||
macro(draco_check_cxx_compiles test_name test_source result_var)
|
||||
unset(CXX_TEST_PASSED CACHE)
|
||||
unset(CXX_TEST_FAILED CACHE)
|
||||
string(FIND "${DRACO_CXX_PASSED_TESTS}" "${test_name}" CXX_TEST_PASSED)
|
||||
string(FIND "${DRACO_CXX_FAILED_TESTS}" "${test_name}" CXX_TEST_FAILED)
|
||||
if (${CXX_TEST_PASSED} EQUAL -1 AND ${CXX_TEST_FAILED} EQUAL -1)
|
||||
unset(CXX_TEST_COMPILED CACHE)
|
||||
message("Running CXX compiler test: ${test_name}")
|
||||
check_cxx_source_compiles("${test_source} ${DRACO_CXX_MAIN}"
|
||||
CXX_TEST_COMPILED)
|
||||
set(${result_var} ${CXX_TEST_COMPILED})
|
||||
|
||||
if (${CXX_TEST_COMPILED})
|
||||
string(APPEND DRACO_CXX_PASSED_TESTS " ${test_name}")
|
||||
else ()
|
||||
string(APPEND DRACO_CXX_FAILED_TESTS " ${test_name}")
|
||||
message("CXX Compiler test ${test_name} failed.")
|
||||
endif ()
|
||||
elseif (NOT ${CXX_TEST_PASSED} EQUAL -1)
|
||||
set(${result_var} 1)
|
||||
else () # ${CXX_TEST_FAILED} NOT EQUAL -1
|
||||
unset(${result_var})
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Convenience macro that confirms $test_source compiles as C and C++.
|
||||
# $result_var is set to 1 when both tests are successful, and 0 when one or both
|
||||
# tests fail.
|
||||
# Note: This macro is intended to be used to write to result variables that
|
||||
# are expanded via configure_file(). $result_var is set to 1 or 0 to allow
|
||||
# direct usage of the value in generated source files.
|
||||
macro(draco_check_source_compiles test_name test_source result_var)
|
||||
unset(C_PASSED)
|
||||
unset(CXX_PASSED)
|
||||
draco_check_c_compiles(${test_name} ${test_source} C_PASSED)
|
||||
draco_check_cxx_compiles(${test_name} ${test_source} CXX_PASSED)
|
||||
if (${C_PASSED} AND ${CXX_PASSED})
|
||||
set(${result_var} 1)
|
||||
else ()
|
||||
set(${result_var} 0)
|
||||
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_
|
57
extern/draco/dracoenc/cmake/draco_features.cmake
vendored
Normal file
57
extern/draco/dracoenc/cmake/draco_features.cmake
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
if (NOT DRACO_CMAKE_DRACO_FEATURES_CMAKE_)
|
||||
set(DRACO_CMAKE_DRACO_FEATURES_CMAKE_ 1)
|
||||
|
||||
set(draco_features_file_name "${draco_build_dir}/draco/draco_features.h")
|
||||
set(draco_features_list)
|
||||
|
||||
# Macro that handles tracking of Draco preprocessor symbols for the purpose of
|
||||
# producing draco_features.h.
|
||||
#
|
||||
# draco_enable_feature(FEATURE <feature_name> [TARGETS <target_name>])
|
||||
# FEATURE is required. It should be a Draco preprocessor symbol.
|
||||
# TARGETS is optional. It can be one or more draco targets.
|
||||
#
|
||||
# When the TARGETS argument is not present the preproc symbol is added to
|
||||
# draco_features.h. When it is draco_features.h is unchanged, and
|
||||
# target_compile_options() is called for each target specified.
|
||||
macro (draco_enable_feature)
|
||||
set(def_flags)
|
||||
set(def_single_arg_opts FEATURE)
|
||||
set(def_multi_arg_opts TARGETS)
|
||||
cmake_parse_arguments(DEF "${def_flags}" "${def_single_arg_opts}"
|
||||
"${def_multi_arg_opts}" ${ARGN})
|
||||
if ("${DEF_FEATURE}" STREQUAL "")
|
||||
message(FATAL_ERROR "Empty FEATURE passed to draco_enable_feature().")
|
||||
endif ()
|
||||
|
||||
# Do nothing/return early if $DEF_FEATURE is already in the list.
|
||||
list(FIND draco_features_list ${DEF_FEATURE} df_index)
|
||||
if (NOT df_index EQUAL -1)
|
||||
return ()
|
||||
endif ()
|
||||
|
||||
list(LENGTH DEF_TARGETS df_targets_list_length)
|
||||
if (${df_targets_list_length} EQUAL 0)
|
||||
list(APPEND draco_features_list ${DEF_FEATURE})
|
||||
else ()
|
||||
foreach (target ${DEF_TARGETS})
|
||||
target_compile_definitions(${target} PRIVATE ${DEF_FEATURE})
|
||||
endforeach ()
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Function for generating draco_features.h.
|
||||
function (draco_generate_features_h)
|
||||
file(WRITE "${draco_features_file_name}"
|
||||
"// GENERATED FILE -- DO NOT EDIT\n\n"
|
||||
"#ifndef DRACO_FEATURES_H_\n"
|
||||
"#define DRACO_FEATURES_H_\n\n")
|
||||
|
||||
foreach (feature ${draco_features_list})
|
||||
file(APPEND "${draco_features_file_name}" "#define ${feature}\n")
|
||||
endforeach ()
|
||||
|
||||
file(APPEND "${draco_features_file_name}" "\n#endif // DRACO_FEATURES_H_")
|
||||
endfunction ()
|
||||
|
||||
endif () # DRACO_CMAKE_DRACO_FEATURES_CMAKE_
|
13
extern/draco/dracoenc/cmake/draco_test_config.h.cmake
vendored
Normal file
13
extern/draco/dracoenc/cmake/draco_test_config.h.cmake
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef DRACO_TESTING_DRACO_TEST_CONFIG_H_
|
||||
#define DRACO_TESTING_DRACO_TEST_CONFIG_H_
|
||||
|
||||
// If this file is named draco_test_config.h.cmake:
|
||||
// This file is used as input at cmake generation time.
|
||||
|
||||
// If this file is named draco_test_config.h:
|
||||
// GENERATED FILE, DO NOT EDIT. SEE ABOVE.
|
||||
|
||||
#define DRACO_TEST_DATA_DIR "${DRACO_TEST_DATA_DIR}"
|
||||
#define DRACO_TEST_TEMP_DIR "${DRACO_TEST_TEMP_DIR}"
|
||||
|
||||
#endif // DRACO_TESTING_DRACO_TEST_CONFIG_H_
|
21
extern/draco/dracoenc/cmake/draco_version.cc.cmake
vendored
Normal file
21
extern/draco/dracoenc/cmake/draco_version.cc.cmake
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// If this file is named draco_version.cc.cmake:
|
||||
// This file is used as input at cmake generation time.
|
||||
|
||||
// If this file is named draco_version.cc:
|
||||
// GENERATED FILE, DO NOT EDIT. SEE ABOVE.
|
||||
#include "draco_version.h"
|
||||
|
||||
static const char kDracoGitHash[] = "${draco_git_hash}";
|
||||
static const char kDracoGitDesc[] = "${draco_git_desc}";
|
||||
|
||||
const char *draco_git_hash() {
|
||||
return kDracoGitHash;
|
||||
}
|
||||
|
||||
const char *draco_git_version() {
|
||||
return kDracoGitDesc;
|
||||
}
|
||||
|
||||
const char* draco_version() {
|
||||
return draco::Version();
|
||||
}
|
21
extern/draco/dracoenc/cmake/draco_version.h.cmake
vendored
Normal file
21
extern/draco/dracoenc/cmake/draco_version.h.cmake
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// If this file is named draco_version.h.cmake:
|
||||
// This file is used as input at cmake generation time.
|
||||
|
||||
// If this file is named draco_version.h:
|
||||
// GENERATED FILE, DO NOT EDIT. SEE ABOVE.
|
||||
#ifndef DRACO_DRACO_VERSION_H_
|
||||
#define DRACO_DRACO_VERSION_H_
|
||||
|
||||
#include "draco/core/draco_version.h"
|
||||
|
||||
// Returns git hash of Draco git repository.
|
||||
const char *draco_git_hash();
|
||||
|
||||
// Returns the output of the git describe command when run from the Draco git
|
||||
// repository.
|
||||
const char *draco_git_version();
|
||||
|
||||
// Returns the version string from core/draco_version.h.
|
||||
const char* draco_version();
|
||||
|
||||
#endif // DRACO_DRACO_VERSION_H_
|
14
extern/draco/dracoenc/cmake/msvc_runtime.cmake
vendored
Normal file
14
extern/draco/dracoenc/cmake/msvc_runtime.cmake
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
|
||||
if (MSVC)
|
||||
# Use statically linked versions of the MS standard libraries.
|
||||
if (NOT "${MSVC_RUNTIME}" STREQUAL "dll")
|
||||
foreach (flag_var
|
||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||
if (${flag_var} MATCHES "/MD")
|
||||
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
endif ()
|
19
extern/draco/dracoenc/cmake/sanitizers.cmake
vendored
Normal file
19
extern/draco/dracoenc/cmake/sanitizers.cmake
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
if (NOT DRACO_CMAKE_SANITIZERS_CMAKE_)
|
||||
set(DRACO_CMAKE_SANITIZERS_CMAKE_ 1)
|
||||
|
||||
if (MSVC OR NOT SANITIZE)
|
||||
return ()
|
||||
endif ()
|
||||
|
||||
include("${draco_root}/cmake/compiler_flags.cmake")
|
||||
|
||||
string(TOLOWER ${SANITIZE} SANITIZE)
|
||||
|
||||
# Require the sanitizer requested.
|
||||
require_linker_flag("-fsanitize=${SANITIZE}")
|
||||
require_compiler_flag("-fsanitize=${SANITIZE}" YES)
|
||||
|
||||
# Make callstacks accurate.
|
||||
require_compiler_flag("-fno-omit-frame-pointer -fno-optimize-sibling-calls" YES)
|
||||
|
||||
endif() # DRACO_CMAKE_SANITIZERS_CMAKE_
|
13
extern/draco/dracoenc/cmake/toolchains/arm-ios-common.cmake
vendored
Normal file
13
extern/draco/dracoenc/cmake/toolchains/arm-ios-common.cmake
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
if (NOT DRACO_CMAKE_TOOLCHAINS_ARM_IOS_COMMON_CMAKE_)
|
||||
set(DRACO_CMAKE_ARM_IOS_COMMON_CMAKE_ 1)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME "Darwin")
|
||||
set(CMAKE_OSX_SYSROOT iphoneos)
|
||||
set(CMAKE_C_COMPILER clang)
|
||||
set(CMAKE_C_COMPILER_ARG1 "-arch ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
set(CMAKE_CXX_COMPILER clang++)
|
||||
set(CMAKE_CXX_COMPILER_ARG1 "-arch ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
|
||||
# TODO(tomfinegan): Handle bit code embedding.
|
||||
|
||||
endif () # DRACO_CMAKE_TOOLCHAINS_ARM_IOS_COMMON_CMAKE_
|
12
extern/draco/dracoenc/cmake/toolchains/arm64-android-ndk-libcpp.cmake
vendored
Normal file
12
extern/draco/dracoenc/cmake/toolchains/arm64-android-ndk-libcpp.cmake
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
if (NOT DRACO_CMAKE_TOOLCHAINS_ARM64_ANDROID_NDK_LIBCPP_CMAKE_)
|
||||
set(DRACO_CMAKE_TOOLCHAINS_ARM64_ANDROID_NDK_LIBCPP_CMAKE_ 1)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/../util.cmake")
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Android)
|
||||
set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)
|
||||
require_variable(CMAKE_ANDROID_NDK)
|
||||
set_variable_if_unset(CMAKE_SYSTEM_VERSION 21)
|
||||
set_variable_if_unset(CMAKE_ANDROID_STL_TYPE c++_static)
|
||||
|
||||
endif () # DRACO_CMAKE_TOOLCHAINS_ARM64_ANDROID_NDK_LIBCPP_CMAKE_
|
14
extern/draco/dracoenc/cmake/toolchains/arm64-ios.cmake
vendored
Normal file
14
extern/draco/dracoenc/cmake/toolchains/arm64-ios.cmake
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
if (NOT DRACO_CMAKE_TOOLCHAINS_ARM64_IOS_CMAKE_)
|
||||
set(DRACO_CMAKE_TOOLCHAINS_ARM64_IOS_CMAKE_ 1)
|
||||
|
||||
if (XCODE)
|
||||
# TODO(tomfinegan): Handle arm builds in Xcode.
|
||||
message(FATAL_ERROR "This toolchain does not support Xcode.")
|
||||
endif ()
|
||||
|
||||
set(CMAKE_SYSTEM_PROCESSOR "arm64")
|
||||
set(CMAKE_OSX_ARCHITECTURES "arm64")
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/arm-ios-common.cmake")
|
||||
|
||||
endif () # DRACO_CMAKE_TOOLCHAINS_ARM64_IOS_CMAKE_
|
18
extern/draco/dracoenc/cmake/toolchains/arm64-linux-gcc.cmake
vendored
Normal file
18
extern/draco/dracoenc/cmake/toolchains/arm64-linux-gcc.cmake
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
if (NOT DRACO_CMAKE_TOOLCHAINS_ARM64_LINUX_GCC_CMAKE_)
|
||||
set(DRACO_CMAKE_TOOLCHAINS_ARM64_LINUX_GCC_CMAKE_ 1)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME "Linux")
|
||||
|
||||
if ("${CROSS}" STREQUAL "")
|
||||
# Default the cross compiler prefix to something known to work.
|
||||
set(CROSS aarch64-linux-gnu-)
|
||||
endif ()
|
||||
|
||||
set(CMAKE_C_COMPILER ${CROSS}gcc)
|
||||
set(CMAKE_CXX_COMPILER ${CROSS}g++)
|
||||
set(AS_EXECUTABLE ${CROSS}as)
|
||||
set(CMAKE_C_COMPILER_ARG1 "-march=armv8-a")
|
||||
set(CMAKE_CXX_COMPILER_ARG1 "-march=armv8-a")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "arm64")
|
||||
|
||||
endif () # DRACO_CMAKE_TOOLCHAINS_ARM64_LINUX_GCC_CMAKE_
|
12
extern/draco/dracoenc/cmake/toolchains/armv7-android-ndk-libcpp.cmake
vendored
Normal file
12
extern/draco/dracoenc/cmake/toolchains/armv7-android-ndk-libcpp.cmake
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
if (NOT DRACO_CMAKE_TOOLCHAINS_ARMV7_ANDROID_NDK_LIBCPP_CMAKE_)
|
||||
set(DRACO_CMAKE_TOOLCHAINS_ARMV7_ANDROID_NDK_LIBCPP_CMAKE_ 1)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/../util.cmake")
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Android)
|
||||
set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a)
|
||||
require_variable(CMAKE_ANDROID_NDK)
|
||||
set_variable_if_unset(CMAKE_SYSTEM_VERSION 18)
|
||||
set_variable_if_unset(CMAKE_ANDROID_STL_TYPE c++_static)
|
||||
|
||||
endif () # DRACO_CMAKE_TOOLCHAINS_ARMV7_ANDROID_NDK_LIBCPP_CMAKE_
|
14
extern/draco/dracoenc/cmake/toolchains/armv7-ios.cmake
vendored
Normal file
14
extern/draco/dracoenc/cmake/toolchains/armv7-ios.cmake
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
if (NOT DRACO_CMAKE_TOOLCHAINS_ARMV7_IOS_CMAKE_)
|
||||
set(DRACO_CMAKE_TOOLCHAINS_ARMV7_IOS_CMAKE_ 1)
|
||||
|
||||
if (XCODE)
|
||||
# TODO(tomfinegan): Handle arm builds in Xcode.
|
||||
message(FATAL_ERROR "This toolchain does not support Xcode.")
|
||||
endif ()
|
||||
|
||||
set(CMAKE_SYSTEM_PROCESSOR "armv7")
|
||||
set(CMAKE_OSX_ARCHITECTURES "armv7")
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/arm-ios-common.cmake")
|
||||
|
||||
endif () # DRACO_CMAKE_TOOLCHAINS_ARMV7_IOS_CMAKE_
|
24
extern/draco/dracoenc/cmake/toolchains/armv7-linux-gcc.cmake
vendored
Normal file
24
extern/draco/dracoenc/cmake/toolchains/armv7-linux-gcc.cmake
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
if (NOT DRACO_CMAKE_TOOLCHAINS_ARMV7_LINUX_GCC_CMAKE_)
|
||||
set(DRACO_CMAKE_TOOLCHAINS_ARMV7_LINUX_GCC_CMAKE_ 1)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME "Linux")
|
||||
|
||||
if ("${CROSS}" STREQUAL "")
|
||||
# Default the cross compiler prefix to something known to work.
|
||||
set(CROSS arm-linux-gnueabihf-)
|
||||
endif ()
|
||||
|
||||
if (NOT ${CROSS} MATCHES hf-$)
|
||||
set(DRACO_EXTRA_TOOLCHAIN_FLAGS "-mfloat-abi=softfp")
|
||||
endif ()
|
||||
|
||||
set(CMAKE_C_COMPILER ${CROSS}gcc)
|
||||
set(CMAKE_CXX_COMPILER ${CROSS}g++)
|
||||
set(AS_EXECUTABLE ${CROSS}as)
|
||||
set(CMAKE_C_COMPILER_ARG1
|
||||
"-march=armv7-a -mfpu=neon ${DRACO_EXTRA_TOOLCHAIN_FLAGS}")
|
||||
set(CMAKE_CXX_COMPILER_ARG1
|
||||
"-march=armv7-a -mfpu=neon ${DRACO_EXTRA_TOOLCHAIN_FLAGS}")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "armv7")
|
||||
|
||||
endif () # DRACO_CMAKE_TOOLCHAINS_ARMV7_LINUX_GCC_CMAKE_
|
14
extern/draco/dracoenc/cmake/toolchains/armv7s-ios.cmake
vendored
Normal file
14
extern/draco/dracoenc/cmake/toolchains/armv7s-ios.cmake
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
if (NOT DRACO_CMAKE_TOOLCHAINS_ARMV7S_IOS_CMAKE_)
|
||||
set(DRACO_CMAKE_TOOLCHAINS_ARMV7S_IOS_CMAKE_ 1)
|
||||
|
||||
if (XCODE)
|
||||
# TODO(tomfinegan): Handle arm builds in Xcode.
|
||||
message(FATAL_ERROR "This toolchain does not support Xcode.")
|
||||
endif ()
|
||||
|
||||
set(CMAKE_SYSTEM_PROCESSOR "armv7s")
|
||||
set(CMAKE_OSX_ARCHITECTURES "armv7s")
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/arm-ios-common.cmake")
|
||||
|
||||
endif () # DRACO_CMAKE_TOOLCHAINS_ARMV7S_IOS_CMAKE_
|
12
extern/draco/dracoenc/cmake/toolchains/x86-android-ndk-libcpp.cmake
vendored
Normal file
12
extern/draco/dracoenc/cmake/toolchains/x86-android-ndk-libcpp.cmake
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
if (NOT DRACO_CMAKE_TOOLCHAINS_X86_ANDROID_NDK_LIBCPP_CMAKE_)
|
||||
set(DRACO_CMAKE_TOOLCHAINS_X86_ANDROID_NDK_LIBCPP_CMAKE_ 1)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/../util.cmake")
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Android)
|
||||
set(CMAKE_ANDROID_ARCH_ABI x86)
|
||||
require_variable(CMAKE_ANDROID_NDK)
|
||||
set_variable_if_unset(CMAKE_SYSTEM_VERSION 18)
|
||||
set_variable_if_unset(CMAKE_ANDROID_STL_TYPE c++_static)
|
||||
|
||||
endif () # DRACO_CMAKE_TOOLCHAINS_X86_ANDROID_NDK_LIBCPP_CMAKE_
|
12
extern/draco/dracoenc/cmake/toolchains/x86_64-android-ndk-libcpp.cmake
vendored
Normal file
12
extern/draco/dracoenc/cmake/toolchains/x86_64-android-ndk-libcpp.cmake
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
if (NOT DRACO_CMAKE_TOOLCHAINS_X86_64_ANDROID_NDK_LIBCPP_CMAKE_)
|
||||
set(DRACO_CMAKE_TOOLCHAINS_X86_64_ANDROID_NDK_LIBCPP_CMAKE_ 1)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/../util.cmake")
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Android)
|
||||
set(CMAKE_ANDROID_ARCH_ABI x86_64)
|
||||
require_variable(CMAKE_ANDROID_NDK)
|
||||
set_variable_if_unset(CMAKE_SYSTEM_VERSION 21)
|
||||
set_variable_if_unset(CMAKE_ANDROID_STL_TYPE c++_static)
|
||||
|
||||
endif () # DRACO_CMAKE_TOOLCHAINS_X86_64_ANDROID_NDK_LIBCPP_CMAKE_
|
73
extern/draco/dracoenc/cmake/util.cmake
vendored
Normal file
73
extern/draco/dracoenc/cmake/util.cmake
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
if (NOT DRACO_CMAKE_UTIL_CMAKE_)
|
||||
set(DRACO_CMAKE_UTIL_CMAKE_ 1)
|
||||
|
||||
# Creates dummy source file in $draco_build_dir named $basename.$extension and
|
||||
# returns the full path to the dummy source file via the $out_file_path
|
||||
# parameter.
|
||||
function (create_dummy_source_file basename extension out_file_path)
|
||||
set(dummy_source_file "${draco_build_dir}/${basename}.${extension}")
|
||||
file(WRITE "${dummy_source_file}"
|
||||
"// Generated file. DO NOT EDIT!\n"
|
||||
"// ${target_name} needs a ${extension} file to force link language, \n"
|
||||
"// or to silence a harmless CMake warning: Ignore me.\n"
|
||||
"void ${target_name}_dummy_function(void) {}\n")
|
||||
set(${out_file_path} ${dummy_source_file} PARENT_SCOPE)
|
||||
endfunction ()
|
||||
|
||||
# Convenience function for adding a dummy source file to $target_name using
|
||||
# $extension as the file extension. Wraps create_dummy_source_file().
|
||||
function (add_dummy_source_file_to_target target_name extension)
|
||||
create_dummy_source_file("${target_name}" "${extension}" "dummy_source_file")
|
||||
target_sources(${target_name} PRIVATE ${dummy_source_file})
|
||||
endfunction ()
|
||||
|
||||
# Extracts the version number from $version_file and returns it to the user via
|
||||
# $version_string_out_var. This is achieved by finding the first instance of
|
||||
# the kDracoVersion variable and then removing everything but the string literal
|
||||
# assigned to the variable. Quotes and semicolon are stripped from the returned
|
||||
# string.
|
||||
function (extract_version_string version_file version_string_out_var)
|
||||
file(STRINGS "${version_file}" draco_version REGEX "kDracoVersion")
|
||||
list(GET draco_version 0 draco_version)
|
||||
string(REPLACE "static const char kDracoVersion[] = " "" draco_version
|
||||
"${draco_version}")
|
||||
string(REPLACE ";" "" draco_version "${draco_version}")
|
||||
string(REPLACE "\"" "" draco_version "${draco_version}")
|
||||
set("${version_string_out_var}" "${draco_version}" PARENT_SCOPE)
|
||||
endfunction ()
|
||||
|
||||
# Sets CMake compiler launcher to $launcher_name when $launcher_name is found in
|
||||
# $PATH. Warns user about ignoring build flag $launcher_flag when $launcher_name
|
||||
# is not found in $PATH.
|
||||
function (set_compiler_launcher launcher_flag launcher_name)
|
||||
find_program(launcher_path "${launcher_name}")
|
||||
if (launcher_path)
|
||||
set(CMAKE_C_COMPILER_LAUNCHER "${launcher_path}" PARENT_SCOPE)
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${launcher_path}" PARENT_SCOPE)
|
||||
message("--- Using ${launcher_name} as compiler launcher.")
|
||||
else ()
|
||||
message(WARNING
|
||||
"--- Cannot find ${launcher_name}, ${launcher_flag} ignored.")
|
||||
endif ()
|
||||
endfunction ()
|
||||
|
||||
# Terminates CMake execution when $var_name is unset in the environment. Sets
|
||||
# CMake variable to the value of the environment variable when the variable is
|
||||
# present in the environment.
|
||||
macro(require_variable var_name)
|
||||
if ("$ENV{${var_name}}" STREQUAL "")
|
||||
message(FATAL_ERROR "${var_name} must be set in environment.")
|
||||
endif ()
|
||||
set_variable_if_unset(${var_name} "")
|
||||
endmacro ()
|
||||
|
||||
# Sets $var_name to $default_value if not already set in the environment.
|
||||
macro (set_variable_if_unset var_name default_value)
|
||||
if (NOT "$ENV{${var_name}}" STREQUAL "")
|
||||
set(${var_name} $ENV{${var_name}})
|
||||
else ()
|
||||
set(${var_name} ${default_value})
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
endif() # DRACO_CMAKE_UTIL_CMAKE_
|
@@ -29,9 +29,8 @@ bool KeyframeAnimation::SetTimestamps(
|
||||
} else {
|
||||
// Check if the number of frames is consistent with
|
||||
// the existing keyframes.
|
||||
if (num_frames != num_points()) {
|
||||
if (num_frames != num_points())
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// This is the first attribute.
|
||||
@@ -41,8 +40,10 @@ bool KeyframeAnimation::SetTimestamps(
|
||||
// Add attribute for time stamp data.
|
||||
std::unique_ptr<PointAttribute> timestamp_att =
|
||||
std::unique_ptr<PointAttribute>(new PointAttribute());
|
||||
timestamp_att->Init(GeometryAttribute::GENERIC, 1, DT_FLOAT32, false,
|
||||
num_frames);
|
||||
timestamp_att->Init(GeometryAttribute::GENERIC, nullptr, 1, DT_FLOAT32, false,
|
||||
sizeof(float), 0);
|
||||
timestamp_att->SetIdentityMapping();
|
||||
timestamp_att->Reset(num_frames);
|
||||
for (PointIndex i(0); i < num_frames; ++i) {
|
||||
timestamp_att->SetAttributeValue(timestamp_att->mapped_index(i),
|
||||
×tamp[i.value()]);
|
@@ -71,29 +71,30 @@ int32_t KeyframeAnimation::AddKeyframes(DataType data_type,
|
||||
uint32_t num_components,
|
||||
const std::vector<T> &data) {
|
||||
// TODO(draco-eng): Verify T is consistent with |data_type|.
|
||||
if (num_components == 0) {
|
||||
if (num_components == 0)
|
||||
return -1;
|
||||
}
|
||||
// If timestamps is not added yet, then reserve attribute 0 for timestamps.
|
||||
if (!num_attributes()) {
|
||||
// Add a temporary attribute with 0 points to fill attribute id 0.
|
||||
std::unique_ptr<PointAttribute> temp_att =
|
||||
std::unique_ptr<PointAttribute>(new PointAttribute());
|
||||
temp_att->Init(GeometryAttribute::GENERIC, num_components, data_type, false,
|
||||
0);
|
||||
temp_att->Init(GeometryAttribute::GENERIC, nullptr, num_components,
|
||||
data_type, false, DataTypeLength(data_type), 0);
|
||||
temp_att->Reset(0);
|
||||
this->AddAttribute(std::move(temp_att));
|
||||
|
||||
set_num_frames(data.size() / num_components);
|
||||
}
|
||||
|
||||
if (data.size() != num_components * num_frames()) {
|
||||
if (data.size() != num_components * num_frames())
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::unique_ptr<PointAttribute> keyframe_att =
|
||||
std::unique_ptr<PointAttribute>(new PointAttribute());
|
||||
keyframe_att->Init(GeometryAttribute::GENERIC, num_components, data_type,
|
||||
false, num_frames());
|
||||
keyframe_att->Init(GeometryAttribute::GENERIC, nullptr, num_components,
|
||||
data_type, false, DataTypeLength(data_type), 0);
|
||||
keyframe_att->SetIdentityMapping();
|
||||
keyframe_att->Reset(num_frames());
|
||||
const size_t stride = num_components;
|
||||
for (PointIndex i(0); i < num_frames(); ++i) {
|
||||
keyframe_att->SetAttributeValue(keyframe_att->mapped_index(i),
|
@@ -21,9 +21,8 @@ Status KeyframeAnimationDecoder::Decode(const DecoderOptions &options,
|
||||
KeyframeAnimation *animation) {
|
||||
const auto status = PointCloudSequentialDecoder::Decode(
|
||||
options, in_buffer, static_cast<PointCloud *>(animation));
|
||||
if (!status.ok()) {
|
||||
if (!status.ok())
|
||||
return status;
|
||||
}
|
||||
return OkStatus();
|
||||
}
|
||||
|
168
extern/draco/dracoenc/src/draco/animation/keyframe_animation_encoding_test.cc
vendored
Normal file
168
extern/draco/dracoenc/src/draco/animation/keyframe_animation_encoding_test.cc
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
// Copyright 2017 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.
|
||||
//
|
||||
#include "draco/animation/keyframe_animation.h"
|
||||
#include "draco/animation/keyframe_animation_decoder.h"
|
||||
#include "draco/animation/keyframe_animation_encoder.h"
|
||||
#include "draco/core/draco_test_base.h"
|
||||
#include "draco/core/draco_test_utils.h"
|
||||
|
||||
namespace draco {
|
||||
|
||||
class KeyframeAnimationEncodingTest : public ::testing::Test {
|
||||
protected:
|
||||
KeyframeAnimationEncodingTest() {}
|
||||
|
||||
bool CreateAndAddTimestamps(int32_t num_frames) {
|
||||
timestamps_.resize(num_frames);
|
||||
for (int i = 0; i < timestamps_.size(); ++i)
|
||||
timestamps_[i] = static_cast<draco::KeyframeAnimation::TimestampType>(i);
|
||||
return keyframe_animation_.SetTimestamps(timestamps_);
|
||||
}
|
||||
|
||||
int32_t CreateAndAddAnimationData(int32_t num_frames,
|
||||
uint32_t num_components) {
|
||||
// Create and add animation data with.
|
||||
animation_data_.resize(num_frames * num_components);
|
||||
for (int i = 0; i < animation_data_.size(); ++i)
|
||||
animation_data_[i] = static_cast<float>(i);
|
||||
return keyframe_animation_.AddKeyframes(draco::DT_FLOAT32, num_components,
|
||||
animation_data_);
|
||||
}
|
||||
|
||||
template <int num_components_t>
|
||||
void CompareAnimationData(const KeyframeAnimation &animation0,
|
||||
const KeyframeAnimation &animation1,
|
||||
bool quantized) {
|
||||
ASSERT_EQ(animation0.num_frames(), animation1.num_frames());
|
||||
ASSERT_EQ(animation0.num_animations(), animation1.num_animations());
|
||||
|
||||
if (quantized) {
|
||||
// TODO(hemmer) : Add test for stable quantization.
|
||||
// Quantization will result in slightly different values.
|
||||
// Skip comparing values.
|
||||
return;
|
||||
}
|
||||
|
||||
// Compare time stamp.
|
||||
const auto timestamp_att0 = animation0.timestamps();
|
||||
const auto timestamp_att1 = animation0.timestamps();
|
||||
for (int i = 0; i < animation0.num_frames(); ++i) {
|
||||
std::array<float, 1> att_value0;
|
||||
std::array<float, 1> att_value1;
|
||||
ASSERT_TRUE((timestamp_att0->GetValue<float, 1>(
|
||||
draco::AttributeValueIndex(i), &att_value0)));
|
||||
ASSERT_TRUE((timestamp_att1->GetValue<float, 1>(
|
||||
draco::AttributeValueIndex(i), &att_value1)));
|
||||
ASSERT_FLOAT_EQ(att_value0[0], att_value1[0]);
|
||||
}
|
||||
|
||||
for (int animation_id = 1; animation_id < animation0.num_animations();
|
||||
++animation_id) {
|
||||
// Compare keyframe data.
|
||||
const auto keyframe_att0 = animation0.keyframes(animation_id);
|
||||
const auto keyframe_att1 = animation1.keyframes(animation_id);
|
||||
ASSERT_EQ(keyframe_att0->num_components(),
|
||||
keyframe_att1->num_components());
|
||||
for (int i = 0; i < animation0.num_frames(); ++i) {
|
||||
std::array<float, num_components_t> att_value0;
|
||||
std::array<float, num_components_t> att_value1;
|
||||
ASSERT_TRUE((keyframe_att0->GetValue<float, num_components_t>(
|
||||
draco::AttributeValueIndex(i), &att_value0)));
|
||||
ASSERT_TRUE((keyframe_att1->GetValue<float, num_components_t>(
|
||||
draco::AttributeValueIndex(i), &att_value1)));
|
||||
for (int j = 0; j < att_value0.size(); ++j) {
|
||||
ASSERT_FLOAT_EQ(att_value0[j], att_value1[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <int num_components_t>
|
||||
void TestKeyframeAnimationEncoding() {
|
||||
TestKeyframeAnimationEncoding<num_components_t>(false);
|
||||
}
|
||||
|
||||
template <int num_components_t>
|
||||
void TestKeyframeAnimationEncoding(bool quantized) {
|
||||
// Encode animation class.
|
||||
draco::EncoderBuffer buffer;
|
||||
draco::KeyframeAnimationEncoder encoder;
|
||||
EncoderOptions options = EncoderOptions::CreateDefaultOptions();
|
||||
if (quantized) {
|
||||
// Set quantization for timestamps.
|
||||
options.SetAttributeInt(0, "quantization_bits", 20);
|
||||
// Set quantization for keyframes.
|
||||
for (int i = 1; i <= keyframe_animation_.num_animations(); ++i) {
|
||||
options.SetAttributeInt(i, "quantization_bits", 20);
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT_TRUE(
|
||||
encoder.EncodeKeyframeAnimation(keyframe_animation_, options, &buffer)
|
||||
.ok());
|
||||
|
||||
draco::DecoderBuffer dec_decoder;
|
||||
draco::KeyframeAnimationDecoder decoder;
|
||||
DecoderBuffer dec_buffer;
|
||||
dec_buffer.Init(buffer.data(), buffer.size());
|
||||
|
||||
// Decode animation class.
|
||||
std::unique_ptr<KeyframeAnimation> decoded_animation(
|
||||
new KeyframeAnimation());
|
||||
DecoderOptions dec_options;
|
||||
ASSERT_TRUE(
|
||||
decoder.Decode(dec_options, &dec_buffer, decoded_animation.get()).ok());
|
||||
|
||||
// Verify if animation before and after compression is identical.
|
||||
CompareAnimationData<num_components_t>(keyframe_animation_,
|
||||
*decoded_animation, quantized);
|
||||
}
|
||||
|
||||
draco::KeyframeAnimation keyframe_animation_;
|
||||
std::vector<draco::KeyframeAnimation::TimestampType> timestamps_;
|
||||
std::vector<float> animation_data_;
|
||||
};
|
||||
|
||||
TEST_F(KeyframeAnimationEncodingTest, OneComponent) {
|
||||
const int num_frames = 1;
|
||||
ASSERT_TRUE(CreateAndAddTimestamps(num_frames));
|
||||
ASSERT_EQ(CreateAndAddAnimationData(num_frames, 1), 1);
|
||||
TestKeyframeAnimationEncoding<1>();
|
||||
}
|
||||
|
||||
TEST_F(KeyframeAnimationEncodingTest, ManyComponents) {
|
||||
const int num_frames = 100;
|
||||
ASSERT_TRUE(CreateAndAddTimestamps(num_frames));
|
||||
ASSERT_EQ(CreateAndAddAnimationData(num_frames, 100), 1);
|
||||
TestKeyframeAnimationEncoding<100>();
|
||||
}
|
||||
|
||||
TEST_F(KeyframeAnimationEncodingTest, ManyComponentsWithQuantization) {
|
||||
const int num_frames = 100;
|
||||
ASSERT_TRUE(CreateAndAddTimestamps(num_frames));
|
||||
ASSERT_EQ(CreateAndAddAnimationData(num_frames, 4), 1);
|
||||
// Test compression with quantization.
|
||||
TestKeyframeAnimationEncoding<4>(true);
|
||||
}
|
||||
|
||||
TEST_F(KeyframeAnimationEncodingTest, MultipleAnimations) {
|
||||
const int num_frames = 5;
|
||||
ASSERT_TRUE(CreateAndAddTimestamps(num_frames));
|
||||
ASSERT_EQ(CreateAndAddAnimationData(num_frames, 3), 1);
|
||||
ASSERT_EQ(CreateAndAddAnimationData(num_frames, 3), 2);
|
||||
TestKeyframeAnimationEncoding<3>();
|
||||
}
|
||||
|
||||
} // namespace draco
|
102
extern/draco/dracoenc/src/draco/animation/keyframe_animation_test.cc
vendored
Normal file
102
extern/draco/dracoenc/src/draco/animation/keyframe_animation_test.cc
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
// Copyright 2017 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.
|
||||
//
|
||||
#include "draco/animation/keyframe_animation.h"
|
||||
|
||||
#include "draco/core/draco_test_base.h"
|
||||
|
||||
namespace {
|
||||
|
||||
class KeyframeAnimationTest : public ::testing::Test {
|
||||
protected:
|
||||
KeyframeAnimationTest() {}
|
||||
|
||||
bool CreateAndAddTimestamps(int32_t num_frames) {
|
||||
timestamps_.resize(num_frames);
|
||||
for (int i = 0; i < timestamps_.size(); ++i)
|
||||
timestamps_[i] = static_cast<draco::KeyframeAnimation::TimestampType>(i);
|
||||
return keyframe_animation_.SetTimestamps(timestamps_);
|
||||
}
|
||||
|
||||
int32_t CreateAndAddAnimationData(int32_t num_frames,
|
||||
uint32_t num_components) {
|
||||
// Create and add animation data with.
|
||||
animation_data_.resize(num_frames * num_components);
|
||||
for (int i = 0; i < animation_data_.size(); ++i)
|
||||
animation_data_[i] = static_cast<float>(i);
|
||||
return keyframe_animation_.AddKeyframes(draco::DT_FLOAT32, num_components,
|
||||
animation_data_);
|
||||
}
|
||||
|
||||
template <int num_components_t>
|
||||
void CompareAnimationData() {
|
||||
// Compare time stamp.
|
||||
const auto timestamp_att = keyframe_animation_.timestamps();
|
||||
for (int i = 0; i < timestamps_.size(); ++i) {
|
||||
std::array<float, 1> att_value;
|
||||
ASSERT_TRUE((timestamp_att->GetValue<float, 1>(
|
||||
draco::AttributeValueIndex(i), &att_value)));
|
||||
ASSERT_FLOAT_EQ(att_value[0], i);
|
||||
}
|
||||
|
||||
// Compare keyframe data.
|
||||
const auto keyframe_att = keyframe_animation_.keyframes(1);
|
||||
for (int i = 0; i < animation_data_.size() / num_components_t; ++i) {
|
||||
std::array<float, num_components_t> att_value;
|
||||
ASSERT_TRUE((keyframe_att->GetValue<float, num_components_t>(
|
||||
draco::AttributeValueIndex(i), &att_value)));
|
||||
for (int j = 0; j < num_components_t; ++j) {
|
||||
ASSERT_FLOAT_EQ(att_value[j], i * num_components_t + j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <int num_components_t>
|
||||
void TestKeyframeAnimation(int32_t num_frames) {
|
||||
ASSERT_TRUE(CreateAndAddTimestamps(num_frames));
|
||||
ASSERT_EQ(CreateAndAddAnimationData(num_frames, num_components_t), 1);
|
||||
CompareAnimationData<num_components_t>();
|
||||
}
|
||||
|
||||
draco::KeyframeAnimation keyframe_animation_;
|
||||
std::vector<draco::KeyframeAnimation::TimestampType> timestamps_;
|
||||
std::vector<float> animation_data_;
|
||||
};
|
||||
|
||||
// Test animation with 1 component and 10 frames.
|
||||
TEST_F(KeyframeAnimationTest, OneComponent) { TestKeyframeAnimation<1>(10); }
|
||||
|
||||
// Test animation with 4 component and 10 frames.
|
||||
TEST_F(KeyframeAnimationTest, FourComponent) { TestKeyframeAnimation<4>(10); }
|
||||
|
||||
// Test adding animation data before timestamp.
|
||||
TEST_F(KeyframeAnimationTest, AddingAnimationFirst) {
|
||||
ASSERT_EQ(CreateAndAddAnimationData(5, 1), 1);
|
||||
ASSERT_TRUE(CreateAndAddTimestamps(5));
|
||||
}
|
||||
|
||||
// Test adding timestamp more than once.
|
||||
TEST_F(KeyframeAnimationTest, ErrorAddingTimestampsTwice) {
|
||||
ASSERT_TRUE(CreateAndAddTimestamps(5));
|
||||
ASSERT_FALSE(CreateAndAddTimestamps(5));
|
||||
}
|
||||
// Test animation with multiple animation data.
|
||||
TEST_F(KeyframeAnimationTest, MultipleAnimationData) {
|
||||
const int num_frames = 5;
|
||||
ASSERT_TRUE(CreateAndAddTimestamps(num_frames));
|
||||
ASSERT_EQ(CreateAndAddAnimationData(num_frames, 1), 1);
|
||||
ASSERT_EQ(CreateAndAddAnimationData(num_frames, 2), 2);
|
||||
}
|
||||
|
||||
} // namespace
|
@@ -25,9 +25,8 @@ bool AttributeOctahedronTransform::InitFromAttribute(
|
||||
const AttributeTransformData *const transform_data =
|
||||
attribute.GetAttributeTransformData();
|
||||
if (!transform_data ||
|
||||
transform_data->transform_type() != ATTRIBUTE_OCTAHEDRON_TRANSFORM) {
|
||||
transform_data->transform_type() != ATTRIBUTE_OCTAHEDRON_TRANSFORM)
|
||||
return false; // Wrong transform type.
|
||||
}
|
||||
quantization_bits_ = transform_data->GetParameterValue<int32_t>(0);
|
||||
return true;
|
||||
}
|
||||
@@ -69,9 +68,8 @@ AttributeOctahedronTransform::GeneratePortableAttribute(
|
||||
float att_val[3];
|
||||
int32_t dst_index = 0;
|
||||
OctahedronToolBox converter;
|
||||
if (!converter.SetQuantizationBits(quantization_bits_)) {
|
||||
if (!converter.SetQuantizationBits(quantization_bits_))
|
||||
return nullptr;
|
||||
}
|
||||
for (uint32_t i = 0; i < point_ids.size(); ++i) {
|
||||
const AttributeValueIndex att_val_id = attribute.mapped_index(point_ids[i]);
|
||||
attribute.GetValue(att_val_id, att_val);
|
@@ -25,9 +25,8 @@ bool AttributeQuantizationTransform::InitFromAttribute(
|
||||
const AttributeTransformData *const transform_data =
|
||||
attribute.GetAttributeTransformData();
|
||||
if (!transform_data ||
|
||||
transform_data->transform_type() != ATTRIBUTE_QUANTIZATION_TRANSFORM) {
|
||||
transform_data->transform_type() != ATTRIBUTE_QUANTIZATION_TRANSFORM)
|
||||
return false; // Wrong transform type.
|
||||
}
|
||||
int32_t byte_offset = 0;
|
||||
quantization_bits_ = transform_data->GetParameterValue<int32_t>(byte_offset);
|
||||
byte_offset += 4;
|
||||
@@ -81,30 +80,22 @@ bool AttributeQuantizationTransform::ComputeParameters(
|
||||
++i) {
|
||||
attribute.GetValue(i, att_val.get());
|
||||
for (int c = 0; c < num_components; ++c) {
|
||||
if (min_values_[c] > att_val[c]) {
|
||||
if (min_values_[c] > att_val[c])
|
||||
min_values_[c] = att_val[c];
|
||||
}
|
||||
if (max_values[c] < att_val[c]) {
|
||||
if (max_values[c] < att_val[c])
|
||||
max_values[c] = att_val[c];
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int c = 0; c < num_components; ++c) {
|
||||
if (std::isnan(min_values_[c]) || std::isinf(min_values_[c]) ||
|
||||
std::isnan(max_values[c]) || std::isinf(max_values[c])) {
|
||||
return false;
|
||||
}
|
||||
const float dif = max_values[c] - min_values_[c];
|
||||
if (dif > range_) {
|
||||
if (dif > range_)
|
||||
range_ = dif;
|
||||
}
|
||||
}
|
||||
|
||||
// In case all values are the same, initialize the range to unit length. This
|
||||
// will ensure that all values are quantized properly to the same value.
|
||||
if (range_ == 0.f) {
|
||||
if (range_ == 0.f)
|
||||
range_ = 1.f;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user