Compare commits
1 Commits
benchmark
...
temp-ui-po
Author | SHA1 | Date | |
---|---|---|---|
8ed495f27c |
@@ -2,6 +2,5 @@
|
|||||||
"project_id" : "Blender",
|
"project_id" : "Blender",
|
||||||
"conduit_uri" : "https://developer.blender.org/",
|
"conduit_uri" : "https://developer.blender.org/",
|
||||||
"git.default-relative-commit" : "origin/blender2.8",
|
"git.default-relative-commit" : "origin/blender2.8",
|
||||||
"arc.land.update.default" : "rebase",
|
"arc.land.update.default" : "rebase"
|
||||||
"arc.land.onto.default" : "blender2.8"
|
|
||||||
}
|
}
|
||||||
|
@@ -1,44 +0,0 @@
|
|||||||
# C/C++
|
|
||||||
[*.{c,cc,h,hh,inl,glsl}]
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = true
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = 4
|
|
||||||
max_line_length = 120
|
|
||||||
|
|
||||||
# CMake & Text
|
|
||||||
[*.{cmake,txt}]
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = true
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = 4
|
|
||||||
max_line_length = 120
|
|
||||||
|
|
||||||
# Python
|
|
||||||
[*.py]
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = true
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 4
|
|
||||||
max_line_length = 120
|
|
||||||
|
|
||||||
# Shell
|
|
||||||
[*.sh]
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = true
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = 4
|
|
||||||
max_line_length = 120
|
|
||||||
|
|
||||||
# reStructuredText
|
|
||||||
[*.rst]
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = true
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 3
|
|
||||||
max_line_length = 120
|
|
7
.gitmodules
vendored
7
.gitmodules
vendored
@@ -3,21 +3,22 @@
|
|||||||
url = ../blender-addons.git
|
url = ../blender-addons.git
|
||||||
branch = blender2.8
|
branch = blender2.8
|
||||||
ignore = all
|
ignore = all
|
||||||
|
branch = master
|
||||||
[submodule "release/scripts/addons_contrib"]
|
[submodule "release/scripts/addons_contrib"]
|
||||||
path = release/scripts/addons_contrib
|
path = release/scripts/addons_contrib
|
||||||
url = ../blender-addons-contrib.git
|
url = ../blender-addons-contrib.git
|
||||||
branch = master
|
branch = master
|
||||||
ignore = all
|
ignore = all
|
||||||
|
branch = master
|
||||||
[submodule "release/datafiles/locale"]
|
[submodule "release/datafiles/locale"]
|
||||||
path = release/datafiles/locale
|
path = release/datafiles/locale
|
||||||
url = ../blender-translations.git
|
url = ../blender-translations.git
|
||||||
branch = master
|
branch = master
|
||||||
ignore = all
|
ignore = all
|
||||||
|
branch = master
|
||||||
[submodule "source/tools"]
|
[submodule "source/tools"]
|
||||||
path = source/tools
|
path = source/tools
|
||||||
url = ../blender-dev-tools.git
|
url = ../blender-dev-tools.git
|
||||||
branch = master
|
branch = master
|
||||||
ignore = all
|
ignore = all
|
||||||
[submodule "release/scripts/benchmark"]
|
branch = master
|
||||||
path = release/scripts/benchmark
|
|
||||||
url = ../blender-benchmark-bundle.git
|
|
||||||
|
262
CMakeLists.txt
262
CMakeLists.txt
@@ -62,21 +62,25 @@ if(NOT DEFINED CMAKE_BUILD_TYPE_INIT)
|
|||||||
set(CMAKE_BUILD_TYPE_INIT "Release")
|
set(CMAKE_BUILD_TYPE_INIT "Release")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Omit superfluous "Up-to-date" messages.
|
|
||||||
if(NOT DEFINED CMAKE_INSTALL_MESSAGE)
|
|
||||||
set(CMAKE_INSTALL_MESSAGE "LAZY")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# quiet output for Makefiles, 'make -s' helps too
|
# quiet output for Makefiles, 'make -s' helps too
|
||||||
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
|
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
|
||||||
|
|
||||||
# global compile definitions since add_definitions() adds for all.
|
# global compile definitions since add_definitions() adds for all.
|
||||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
|
|
||||||
$<$<CONFIG:Debug>:DEBUG;_DEBUG>
|
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.0))
|
||||||
$<$<CONFIG:Release>:NDEBUG>
|
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
|
||||||
$<$<CONFIG:MinSizeRel>:NDEBUG>
|
$<$<CONFIG:Debug>:DEBUG;_DEBUG>
|
||||||
$<$<CONFIG:RelWithDebInfo>:NDEBUG>
|
$<$<CONFIG:Release>:NDEBUG>
|
||||||
)
|
$<$<CONFIG:MinSizeRel>:NDEBUG>
|
||||||
|
$<$<CONFIG:RelWithDebInfo>:NDEBUG>
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
# keep until CMake-3.0 is min requirement
|
||||||
|
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG _DEBUG)
|
||||||
|
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE NDEBUG)
|
||||||
|
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL NDEBUG)
|
||||||
|
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO NDEBUG)
|
||||||
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Set policy
|
# Set policy
|
||||||
@@ -232,6 +236,8 @@ option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported
|
|||||||
mark_as_advanced(WITH_SYSTEM_BULLET)
|
mark_as_advanced(WITH_SYSTEM_BULLET)
|
||||||
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
|
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
|
||||||
|
|
||||||
|
option(WITH_CLAY_ENGINE "Enable Clay engine" ON)
|
||||||
|
|
||||||
# Compositor
|
# Compositor
|
||||||
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
|
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
|
||||||
|
|
||||||
@@ -313,6 +319,7 @@ option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON)
|
|||||||
option(WITH_IMAGE_DDS "Enable DDS Image Support" ON)
|
option(WITH_IMAGE_DDS "Enable DDS Image Support" ON)
|
||||||
option(WITH_IMAGE_CINEON "Enable CINEON and DPX Image Support" ON)
|
option(WITH_IMAGE_CINEON "Enable CINEON and DPX Image Support" ON)
|
||||||
option(WITH_IMAGE_HDR "Enable HDR Image Support" ON)
|
option(WITH_IMAGE_HDR "Enable HDR Image Support" ON)
|
||||||
|
option(WITH_IMAGE_FRAMESERVER "Enable image FrameServer Support for rendering" ON)
|
||||||
|
|
||||||
# Audio/Video format support
|
# Audio/Video format support
|
||||||
option(WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON)
|
option(WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON)
|
||||||
@@ -444,7 +451,7 @@ mark_as_advanced(WITH_MEM_VALGRIND)
|
|||||||
option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF)
|
option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF)
|
||||||
mark_as_advanced(WITH_CXX_GUARDEDALLOC)
|
mark_as_advanced(WITH_CXX_GUARDEDALLOC)
|
||||||
|
|
||||||
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" ON)
|
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
|
||||||
mark_as_advanced(WITH_ASSERT_ABORT)
|
mark_as_advanced(WITH_ASSERT_ABORT)
|
||||||
|
|
||||||
option(WITH_BOOST "Enable features depending on boost" ON)
|
option(WITH_BOOST "Enable features depending on boost" ON)
|
||||||
@@ -463,13 +470,11 @@ endif()
|
|||||||
|
|
||||||
# OpenGL
|
# OpenGL
|
||||||
|
|
||||||
option(WITH_OPENGL "When off limits visibility of the opengl headers to just bf_gpu and gawain (temporary option for development purposes)" ON)
|
|
||||||
option(WITH_GLEW_ES "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
|
option(WITH_GLEW_ES "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
|
||||||
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF)
|
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF)
|
||||||
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
|
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
|
||||||
|
|
||||||
mark_as_advanced(
|
mark_as_advanced(
|
||||||
WITH_OPENGL
|
|
||||||
WITH_GLEW_ES
|
WITH_GLEW_ES
|
||||||
WITH_GL_EGL
|
WITH_GL_EGL
|
||||||
WITH_GL_PROFILE_ES20
|
WITH_GL_PROFILE_ES20
|
||||||
@@ -490,59 +495,32 @@ if(WIN32)
|
|||||||
set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
|
set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Experimental support of C11 and C++11
|
||||||
|
#
|
||||||
|
# We default options to whatever default standard in the current compiler.
|
||||||
|
if(APPLE)
|
||||||
|
set(_c11_init ON)
|
||||||
|
set(_cxx11_init ON)
|
||||||
|
set(WITH_C11 ON)
|
||||||
|
set(WITH_CXX11 ON)
|
||||||
|
elseif(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
|
||||||
|
set(_c11_init ON)
|
||||||
|
else()
|
||||||
|
set(_c11_init OFF)
|
||||||
|
endif()
|
||||||
|
set(_cxx11_init ON)
|
||||||
|
|
||||||
|
option(WITH_C11 "Build with C11 standard enabled, for development use only!" ${_c11_init})
|
||||||
|
mark_as_advanced(WITH_C11)
|
||||||
|
option(WITH_CXX11 "Build with C++11 standard enabled, for development use only!" ${_cxx11_init})
|
||||||
|
mark_as_advanced(WITH_CXX11)
|
||||||
|
|
||||||
# Compiler toolchain
|
# Compiler toolchain
|
||||||
if(CMAKE_COMPILER_IS_GNUCC)
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
|
option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
|
||||||
mark_as_advanced(WITH_LINKER_GOLD)
|
mark_as_advanced(WITH_LINKER_GOLD)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
||||||
option(WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF)
|
|
||||||
mark_as_advanced(WITH_COMPILER_ASAN)
|
|
||||||
|
|
||||||
if(WITH_COMPILER_ASAN)
|
|
||||||
set(_asan_defaults "\
|
|
||||||
-fsanitize=address \
|
|
||||||
-fsanitize=bool \
|
|
||||||
-fsanitize=bounds \
|
|
||||||
-fsanitize=enum \
|
|
||||||
-fsanitize=float-cast-overflow \
|
|
||||||
-fsanitize=float-divide-by-zero \
|
|
||||||
-fsanitize=nonnull-attribute \
|
|
||||||
-fsanitize=returns-nonnull-attribute \
|
|
||||||
-fsanitize=signed-integer-overflow \
|
|
||||||
-fsanitize=undefined \
|
|
||||||
-fsanitize=vla-bound \
|
|
||||||
-fno-sanitize=alignment \
|
|
||||||
")
|
|
||||||
|
|
||||||
if(NOT MSVC) # not all sanitizers are supported with clang-cl, these two however are very vocal about it
|
|
||||||
set(_asan_defaults "${_asan_defaults} -fsanitize=leak -fsanitize=object-size" )
|
|
||||||
endif()
|
|
||||||
set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer")
|
|
||||||
mark_as_advanced(COMPILER_ASAN_CFLAGS)
|
|
||||||
set(COMPILER_ASAN_CXXFLAGS "${_asan_defaults}" CACHE STRING "C++ flags for address sanitizer")
|
|
||||||
mark_as_advanced(COMPILER_ASAN_CXXFLAGS)
|
|
||||||
|
|
||||||
unset(_asan_defaults)
|
|
||||||
|
|
||||||
if(NOT MSVC)
|
|
||||||
find_library(COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
|
||||||
else()
|
|
||||||
find_library( COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
|
|
||||||
PATHS
|
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
|
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
mark_as_advanced(COMPILER_ASAN_LIBRARY)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Dependency graph
|
|
||||||
option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON)
|
|
||||||
mark_as_advanced(WITH_LEGACY_DEPSGRAPH)
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# Use hardcoded paths or find_package to find externals
|
# Use hardcoded paths or find_package to find externals
|
||||||
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
|
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
|
||||||
@@ -601,14 +579,18 @@ if(NOT WITH_BLENDER AND NOT WITH_CYCLES_STANDALONE)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT WITH_CXX11)
|
||||||
|
if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
|
||||||
|
message(FATAL_ERROR "WITH_AUDASPACE requires WITH_CXX11")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT WITH_AUDASPACE)
|
if(NOT WITH_AUDASPACE)
|
||||||
if(WITH_OPENAL)
|
if(WITH_OPENAL)
|
||||||
message(WARNING "WITH_OPENAL requires WITH_AUDASPACE which is disabled")
|
message(FATAL_ERROR "WITH_OPENAL requires WITH_AUDASPACE")
|
||||||
set(WITH_OPENAL OFF)
|
|
||||||
endif()
|
endif()
|
||||||
if(WITH_JACK)
|
if(WITH_JACK)
|
||||||
message(WARNING "WITH_JACK requires WITH_AUDASPACE which is disabled")
|
message(FATAL_ERROR "WITH_JACK requires WITH_AUDASPACE")
|
||||||
set(WITH_JACK OFF)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -651,8 +633,11 @@ elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
|
|||||||
WITH_OPENVDB OR WITH_OPENCOLORIO)
|
WITH_OPENVDB OR WITH_OPENCOLORIO)
|
||||||
# Keep enabled
|
# Keep enabled
|
||||||
else()
|
else()
|
||||||
# Disable boost if not needed.
|
# New dependency graph needs either Boost or C++11 for function bindings.
|
||||||
set(WITH_BOOST OFF)
|
if(NOT WITH_CXX11)
|
||||||
|
# Enabled but we don't need it
|
||||||
|
set(WITH_BOOST OFF)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# auto enable openimageio for cycles
|
# auto enable openimageio for cycles
|
||||||
@@ -709,6 +694,9 @@ if(WITH_BUILDINFO)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
TEST_SHARED_PTR_SUPPORT()
|
||||||
|
TEST_UNORDERED_MAP_SUPPORT()
|
||||||
|
|
||||||
if(WITH_AUDASPACE)
|
if(WITH_AUDASPACE)
|
||||||
if(NOT WITH_SYSTEM_AUDASPACE)
|
if(NOT WITH_SYSTEM_AUDASPACE)
|
||||||
set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings/C" "${CMAKE_BINARY_DIR}/extern/audaspace")
|
set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings/C" "${CMAKE_BINARY_DIR}/extern/audaspace")
|
||||||
@@ -781,8 +769,7 @@ set(C_WARNINGS)
|
|||||||
set(CXX_WARNINGS)
|
set(CXX_WARNINGS)
|
||||||
|
|
||||||
# for gcc -Wno-blah-blah
|
# for gcc -Wno-blah-blah
|
||||||
set(C_REMOVE_STRICT_FLAGS)
|
set(CC_REMOVE_STRICT_FLAGS)
|
||||||
set(CXX_REMOVE_STRICT_FLAGS)
|
|
||||||
|
|
||||||
# libraries to link the binary with passed to target_link_libraries()
|
# libraries to link the binary with passed to target_link_libraries()
|
||||||
# known as LLIBS to scons
|
# known as LLIBS to scons
|
||||||
@@ -794,21 +781,6 @@ set(PLATFORM_LINKLIBS "")
|
|||||||
set(PLATFORM_LINKFLAGS "")
|
set(PLATFORM_LINKFLAGS "")
|
||||||
set(PLATFORM_LINKFLAGS_DEBUG "")
|
set(PLATFORM_LINKFLAGS_DEBUG "")
|
||||||
|
|
||||||
if (NOT CMAKE_BUILD_TYPE MATCHES "Release")
|
|
||||||
if(WITH_COMPILER_ASAN)
|
|
||||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}")
|
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}")
|
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
|
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
|
|
||||||
if(MSVC)
|
|
||||||
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
|
|
||||||
endif()
|
|
||||||
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}")
|
|
||||||
set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
|
|
||||||
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
#Platform specifics
|
#Platform specifics
|
||||||
@@ -981,10 +953,6 @@ endif()
|
|||||||
find_package(OpenGL)
|
find_package(OpenGL)
|
||||||
blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
|
blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
|
||||||
|
|
||||||
if(WITH_OPENGL)
|
|
||||||
add_definitions(-DWITH_OPENGL)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_SYSTEM_GLES)
|
if(WITH_SYSTEM_GLES)
|
||||||
find_package_wrapper(OpenGLES)
|
find_package_wrapper(OpenGLES)
|
||||||
endif()
|
endif()
|
||||||
@@ -1265,8 +1233,42 @@ endif()
|
|||||||
# Configure Ceres
|
# Configure Ceres
|
||||||
|
|
||||||
if(WITH_LIBMV)
|
if(WITH_LIBMV)
|
||||||
# We always have C++11 which includes unordered_map.
|
set(CERES_DEFINES)
|
||||||
set(CERES_DEFINES -DCERES_STD_UNORDERED_MAP)
|
|
||||||
|
if(WITH_CXX11)
|
||||||
|
# nothing to be done
|
||||||
|
elseif(SHARED_PTR_FOUND)
|
||||||
|
if(SHARED_PTR_TR1_MEMORY_HEADER)
|
||||||
|
list(APPEND CERES_DEFINES -DCERES_TR1_MEMORY_HEADER)
|
||||||
|
endif()
|
||||||
|
if(SHARED_PTR_TR1_NAMESPACE)
|
||||||
|
list(APPEND CERES_DEFINES -DCERES_TR1_SHARED_PTR)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Ceres: Unable to find shared_ptr.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_CXX11)
|
||||||
|
list(APPEND CERES_DEFINES -DCERES_STD_UNORDERED_MAP)
|
||||||
|
elseif(HAVE_STD_UNORDERED_MAP_HEADER)
|
||||||
|
if(HAVE_UNORDERED_MAP_IN_STD_NAMESPACE)
|
||||||
|
list(APPEND CERES_DEFINES -DCERES_STD_UNORDERED_MAP)
|
||||||
|
else()
|
||||||
|
if(HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
|
||||||
|
list(APPEND CERES_DEFINES -DCERES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE)
|
||||||
|
else()
|
||||||
|
list(APPEND CERES_DEFINES -DCERES_NO_UNORDERED_MAP)
|
||||||
|
message(STATUS "Ceres: Replacing unordered_map/set with map/set (warning: slower!)")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
|
||||||
|
list(APPEND CERES_DEFINES -DCERES_TR1_UNORDERED_MAP)
|
||||||
|
else()
|
||||||
|
list(APPEND CERES_DEFINES -DCERES_NO_UNORDERED_MAP)
|
||||||
|
message(STATUS "Ceres: Replacing unordered_map/set with map/set (warning: slower!)")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
@@ -1357,22 +1359,16 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# flags to undo strict flags
|
# flags to undo strict flags
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_TYPE_LIMITS -Wno-type-limits)
|
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INT_IN_BOOL_CONTEXT -Wno-int-in-bool-context)
|
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_FORMAT -Wno-format)
|
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_SWITCH -Wno-switch)
|
|
||||||
|
|
||||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CLASS_MEMACCESS -Wno-class-memaccess)
|
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
|
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
@@ -1401,23 +1397,23 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|||||||
# ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros)
|
# ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros)
|
||||||
|
|
||||||
# flags to undo strict flags
|
# flags to undo strict flags
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
|
||||||
|
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL -Wno-incompatible-pointer-types-discards-qualifiers)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL -Wno-incompatible-pointer-types-discards-qualifiers)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INT_TO_VOID_POINTER_CAST -Wno-int-to-void-pointer-cast)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_INT_TO_VOID_POINTER_CAST -Wno-int-to-void-pointer-cast)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_PROTOTYPES -Wno-missing-prototypes)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_PROTOTYPES -Wno-missing-prototypes)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
|
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
|
||||||
|
|
||||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
|
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
|
||||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
|
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
|
||||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
|
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
|
||||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
|
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
|
||||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
|
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
|
||||||
|
|
||||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||||
|
|
||||||
@@ -1493,26 +1489,28 @@ if(WITH_PYTHON)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(
|
if(WITH_CXX11)
|
||||||
CMAKE_COMPILER_IS_GNUCC OR
|
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
CMAKE_C_COMPILER_ID MATCHES "Clang" OR
|
# TODO(sergey): Do we want c++11 or gnu-c++11 here?
|
||||||
CMAKE_C_COMPILER_ID MATCHES "Intel"
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
)
|
elseif(MSVC)
|
||||||
# TODO(sergey): Do we want c++11 or gnu-c++11 here?
|
# Nothing special is needed, C++11 features are available by default.
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
else()
|
||||||
elseif(MSVC)
|
message(FATAL_ERROR "Compiler ${CMAKE_C_COMPILER_ID} is not supported for C++11 build yet")
|
||||||
# Nothing special is needed, C++11 features are available by default.
|
endif()
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Unknown compiler ${CMAKE_C_COMPILER_ID}, can't enable C++11 build")
|
# GCC-6 switched to C++11 by default, which would break linking with existing libraries
|
||||||
|
# by default. So we explicitly disable C++11 for a new GCC so no linking issues happens.
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0"))
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98")
|
||||||
|
# We also disable any of C++11 ABI from usage, so we wouldn't even try to
|
||||||
|
# link to stuff from std::__cxx11 namespace.
|
||||||
|
add_definitions("-D_GLIBCXX_USE_CXX11_ABI=0")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Visual Studio has all standards it supports available by default
|
# Visual Studio has all standards it supports available by default
|
||||||
# Clang on windows copies this behavior and does not support these switches
|
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||||
if(
|
|
||||||
CMAKE_COMPILER_IS_GNUCC OR
|
|
||||||
(CMAKE_C_COMPILER_ID MATCHES "Clang" AND (NOT MSVC)) OR
|
|
||||||
(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
|
||||||
)
|
|
||||||
# Use C99 + GNU extensions, works with GCC, Clang, ICC
|
# Use C99 + GNU extensions, works with GCC, Clang, ICC
|
||||||
if(WITH_C11)
|
if(WITH_C11)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||||
|
22
GNUmakefile
22
GNUmakefile
@@ -71,10 +71,6 @@ ifneq "$(findstring full, $(MAKECMDGOALS))" ""
|
|||||||
BUILD_DIR:=$(BUILD_DIR)_full
|
BUILD_DIR:=$(BUILD_DIR)_full
|
||||||
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_full.cmake"
|
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_full.cmake"
|
||||||
endif
|
endif
|
||||||
ifneq "$(findstring benchmark, $(MAKECMDGOALS))" ""
|
|
||||||
BUILD_DIR:=$(BUILD_DIR)_benchmark
|
|
||||||
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_benchmark.cmake"
|
|
||||||
endif
|
|
||||||
ifneq "$(findstring lite, $(MAKECMDGOALS))" ""
|
ifneq "$(findstring lite, $(MAKECMDGOALS))" ""
|
||||||
BUILD_DIR:=$(BUILD_DIR)_lite
|
BUILD_DIR:=$(BUILD_DIR)_lite
|
||||||
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake"
|
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake"
|
||||||
@@ -150,7 +146,6 @@ all: .FORCE
|
|||||||
debug: all
|
debug: all
|
||||||
full: all
|
full: all
|
||||||
lite: all
|
lite: all
|
||||||
benchmark: all
|
|
||||||
cycles: all
|
cycles: all
|
||||||
headless: all
|
headless: all
|
||||||
bpy: all
|
bpy: all
|
||||||
@@ -241,14 +236,9 @@ help: .FORCE
|
|||||||
@echo " * check_descriptions - check for duplicate/invalid descriptions"
|
@echo " * check_descriptions - check for duplicate/invalid descriptions"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Utilities (not associated with building blender)"
|
@echo "Utilities (not associated with building blender)"
|
||||||
@echo " * icons - Updates PNG icons from SVG files."
|
@echo " * icons - updates PNG icons from SVG files."
|
||||||
@echo " Set environment variables 'BLENDER_BIN' and 'INKSCAPE_BIN'"
|
@echo " * tgz - create a compressed archive of the source code."
|
||||||
@echo " to define your own commands."
|
@echo " * update - updates git and all submodules"
|
||||||
@echo " * icons_geom - Updates Geometry icons from BLEND file."
|
|
||||||
@echo " Set environment variable 'BLENDER_BIN'"
|
|
||||||
@echo " to define your own command."
|
|
||||||
@echo " * tgz - create a compressed archive of the source code."
|
|
||||||
@echo " * update - updates git and all submodules"
|
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Environment Variables"
|
@echo "Environment Variables"
|
||||||
@echo " * BUILD_CMAKE_ARGS - arguments passed to CMake."
|
@echo " * BUILD_CMAKE_ARGS - arguments passed to CMake."
|
||||||
@@ -433,12 +423,8 @@ icons: .FORCE
|
|||||||
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
|
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
|
||||||
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
|
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
|
||||||
|
|
||||||
icons_geom: .FORCE
|
|
||||||
BLENDER_BIN="$(BUILD_DIR)/bin/blender" \
|
|
||||||
"$(BLENDER_DIR)/release/datafiles/blender_icons_geom_update.py"
|
|
||||||
|
|
||||||
update: .FORCE
|
update: .FORCE
|
||||||
if [ "$(OS_NCASE)" = "darwin" ] && [ ! -d "../lib/$(OS_NCASE)" ]; then \
|
if [ "$(OS_NCASE)" == "darwin" ] && [ ! -d "../lib/$(OS_NCASE)" ]; then \
|
||||||
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/$(OS_NCASE) ../lib/$(OS_NCASE) ; \
|
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/$(OS_NCASE) ../lib/$(OS_NCASE) ; \
|
||||||
fi
|
fi
|
||||||
if [ -d "../lib" ]; then \
|
if [ -d "../lib" ]; then \
|
||||||
|
@@ -25,7 +25,6 @@ set(BLOSC_EXTRA_ARGS
|
|||||||
-DThreads_FOUND=1
|
-DThreads_FOUND=1
|
||||||
-DPTHREAD_LIBS=${LIBDIR}/pthreads/lib/pthreadVC2.lib
|
-DPTHREAD_LIBS=${LIBDIR}/pthreads/lib/pthreadVC2.lib
|
||||||
-DPTHREAD_INCLUDE_DIR=${LIBDIR}/pthreads/inc
|
-DPTHREAD_INCLUDE_DIR=${LIBDIR}/pthreads/inc
|
||||||
-DDEACTIVATE_SNAPPY=ON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
ExternalProject_Add(external_blosc
|
ExternalProject_Add(external_blosc
|
||||||
|
@@ -103,7 +103,6 @@ ExternalProject_Add(external_ffmpeg
|
|||||||
--disable-indev=jack
|
--disable-indev=jack
|
||||||
--disable-indev=alsa
|
--disable-indev=alsa
|
||||||
--disable-outdev=alsa
|
--disable-outdev=alsa
|
||||||
--disable-crystalhd
|
|
||||||
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/ffmpeg/src/external_ffmpeg < ${PATCH_DIR}/ffmpeg.diff
|
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/ffmpeg/src/external_ffmpeg < ${PATCH_DIR}/ffmpeg.diff
|
||||||
BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make -j${MAKE_THREADS}
|
BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make -j${MAKE_THREADS}
|
||||||
INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make install
|
INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make install
|
||||||
|
@@ -16,15 +16,7 @@
|
|||||||
#
|
#
|
||||||
# ***** END GPL LICENSE BLOCK *****
|
# ***** END GPL LICENSE BLOCK *****
|
||||||
|
|
||||||
set(FREETYPE_EXTRA_ARGS
|
set(FREETYPE_EXTRA_ARGS -DCMAKE_RELEASE_POSTFIX:STRING=2ST -DCMAKE_DEBUG_POSTFIX:STRING=2ST_d -DWITH_BZip2=OFF -DWITH_HarfBuzz=OFF)
|
||||||
-DCMAKE_RELEASE_POSTFIX:STRING=2ST
|
|
||||||
-DCMAKE_DEBUG_POSTFIX:STRING=2ST_d
|
|
||||||
-DWITH_BZip2=OFF
|
|
||||||
-DWITH_HarfBuzz=OFF
|
|
||||||
-DFT_WITH_HARFBUZZ=OFF
|
|
||||||
-DFT_WITH_BZIP2=OFF
|
|
||||||
-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE
|
|
||||||
-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE)
|
|
||||||
|
|
||||||
ExternalProject_Add(external_freetype
|
ExternalProject_Add(external_freetype
|
||||||
URL ${FREETYPE_URI}
|
URL ${FREETYPE_URI}
|
||||||
|
@@ -58,3 +58,4 @@ if(MSVC)
|
|||||||
DEPENDEES mkdir update patch download configure build install
|
DEPENDEES mkdir update patch download configure build install
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -39,6 +39,5 @@ if(BUILD_MODE STREQUAL Release)
|
|||||||
PREFIX ${BUILD_DIR}/openal
|
PREFIX ${BUILD_DIR}/openal
|
||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
|
||||||
INSTALL_DIR ${LIBDIR}/openal
|
INSTALL_DIR ${LIBDIR}/openal
|
||||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openal/src/external_openal < ${PATCH_DIR}/openal.diff
|
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -56,27 +56,24 @@ if(WIN32)
|
|||||||
# For OIIO and OSL
|
# For OIIO and OSL
|
||||||
set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
|
set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
|
||||||
|
|
||||||
if(MSVC_VERSION GREATER 1909)
|
# TODO FIXME highly MSVC specific
|
||||||
set(COMMON_MSVC_FLAGS "/Wv:18") #some deps with warnings as error aren't quite ready for dealing with the new 2017 warnings.
|
if(WITH_OPTIMIZED_DEBUG)
|
||||||
|
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
|
else()
|
||||||
|
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
endif()
|
endif()
|
||||||
|
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
|
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
|
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
|
|
||||||
if(WITH_OPTIMIZED_DEBUG)
|
if(WITH_OPTIMIZED_DEBUG)
|
||||||
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
else()
|
else()
|
||||||
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
endif()
|
endif()
|
||||||
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
|
|
||||||
if(WITH_OPTIMIZED_DEBUG)
|
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
|
||||||
else()
|
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
|
||||||
endif()
|
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
|
||||||
|
|
||||||
set(PLATFORM_FLAGS)
|
set(PLATFORM_FLAGS)
|
||||||
set(PLATFORM_CXX_FLAGS)
|
set(PLATFORM_CXX_FLAGS)
|
||||||
|
@@ -216,3 +216,4 @@ if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe")
|
|||||||
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe"
|
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -216,3 +216,4 @@ if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe")
|
|||||||
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe"
|
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -37,3 +37,4 @@ endif()
|
|||||||
if(MSVC)
|
if(MSVC)
|
||||||
set_target_properties(external_zlib_mingw PROPERTIES FOLDER Mingw)
|
set_target_properties(external_zlib_mingw PROPERTIES FOLDER Mingw)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -285,7 +285,7 @@ SUDO="sudo"
|
|||||||
|
|
||||||
NO_BUILD=false
|
NO_BUILD=false
|
||||||
NO_CONFIRM=false
|
NO_CONFIRM=false
|
||||||
USE_CXX11=true
|
USE_CXX11=true # Mandatory in blender2.8
|
||||||
|
|
||||||
PYTHON_VERSION="3.6.2"
|
PYTHON_VERSION="3.6.2"
|
||||||
PYTHON_VERSION_MIN="3.6"
|
PYTHON_VERSION_MIN="3.6"
|
||||||
@@ -794,10 +794,20 @@ OPENCOLLADA_REPO_BRANCH="master"
|
|||||||
|
|
||||||
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
|
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
|
||||||
|
|
||||||
# C++11 is required now
|
|
||||||
CXXFLAGS_BACK=$CXXFLAGS
|
CXXFLAGS_BACK=$CXXFLAGS
|
||||||
CXXFLAGS="$CXXFLAGS -std=c++11"
|
if [ "$USE_CXX11" = true ]; then
|
||||||
export CXXFLAGS
|
WARNING "C++11 is now mandatory for blender2.8, this *should* go smoothly with any very recent distribution.
|
||||||
|
However, if you are experiencing linking errors (also when building Blender itself), please try the following:
|
||||||
|
* Re-run this script with '--build-all --force-all' options.
|
||||||
|
* Ensure your gcc version is at the very least 4.8, if possible you should really rather use gcc-5.1 or above.
|
||||||
|
|
||||||
|
Please note that until the transition to C++11-built libraries if completed in your distribution, situation will
|
||||||
|
remain fuzzy and incompatibilities may happen..."
|
||||||
|
PRINT ""
|
||||||
|
PRINT ""
|
||||||
|
CXXFLAGS="$CXXFLAGS -std=c++11"
|
||||||
|
export CXXFLAGS
|
||||||
|
fi
|
||||||
|
|
||||||
#### Show Dependencies ####
|
#### Show Dependencies ####
|
||||||
|
|
||||||
@@ -1672,7 +1682,9 @@ compile_OIIO() {
|
|||||||
# fi
|
# fi
|
||||||
cmake_d="$cmake_d -D USE_OCIO=OFF"
|
cmake_d="$cmake_d -D USE_OCIO=OFF"
|
||||||
|
|
||||||
cmake_d="$cmake_d -D OIIO_BUILD_CPP11=ON"
|
if [ "$USE_CXX11" = true ]; then
|
||||||
|
cmake_d="$cmake_d -D OIIO_BUILD_CPP11=ON"
|
||||||
|
fi
|
||||||
|
|
||||||
if file /bin/cp | grep -q '32-bit'; then
|
if file /bin/cp | grep -q '32-bit'; then
|
||||||
cflags="-fPIC -m32 -march=i686"
|
cflags="-fPIC -m32 -march=i686"
|
||||||
@@ -1885,7 +1897,9 @@ compile_OSL() {
|
|||||||
cmake_d="$cmake_d -D OSL_BUILD_PLUGINS=OFF"
|
cmake_d="$cmake_d -D OSL_BUILD_PLUGINS=OFF"
|
||||||
cmake_d="$cmake_d -D OSL_BUILD_TESTS=OFF"
|
cmake_d="$cmake_d -D OSL_BUILD_TESTS=OFF"
|
||||||
cmake_d="$cmake_d -D USE_SIMD=sse2"
|
cmake_d="$cmake_d -D USE_SIMD=sse2"
|
||||||
cmake_d="$cmake_d -D OSL_BUILD_CPP11=1"
|
if [ "$USE_CXX11" = true ]; then
|
||||||
|
cmake_d="$cmake_d -D OSL_BUILD_CPP11=1"
|
||||||
|
fi
|
||||||
|
|
||||||
#~ cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
|
#~ cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
|
||||||
|
|
||||||
@@ -2271,6 +2285,12 @@ compile_ALEMBIC() {
|
|||||||
|
|
||||||
cmake_d="-D CMAKE_INSTALL_PREFIX=$_inst"
|
cmake_d="-D CMAKE_INSTALL_PREFIX=$_inst"
|
||||||
|
|
||||||
|
# Without Boost or TR1, Alembic requires C++11.
|
||||||
|
if [ "$USE_CXX11" != true ]; then
|
||||||
|
cmake_d="$cmake_d -D ALEMBIC_LIB_USES_BOOST=ON"
|
||||||
|
cmake_d="$cmake_d -D ALEMBIC_LIB_USES_TR1=OFF"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -d $INST/boost ]; then
|
if [ -d $INST/boost ]; then
|
||||||
if [ -d $INST/boost ]; then
|
if [ -d $INST/boost ]; then
|
||||||
cmake_d="$cmake_d -D BOOST_ROOT=$INST/boost"
|
cmake_d="$cmake_d -D BOOST_ROOT=$INST/boost"
|
||||||
@@ -4207,6 +4227,12 @@ print_info() {
|
|||||||
_buildargs="$_buildargs -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES*"
|
_buildargs="$_buildargs -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES*"
|
||||||
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC*"
|
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC*"
|
||||||
|
|
||||||
|
if [ "$USE_CXX11" = true ]; then
|
||||||
|
_1="-D WITH_CXX11=ON"
|
||||||
|
PRINT " $_1"
|
||||||
|
_buildargs="$_buildargs $_1"
|
||||||
|
fi
|
||||||
|
|
||||||
_1="-D WITH_CODEC_SNDFILE=ON"
|
_1="-D WITH_CODEC_SNDFILE=ON"
|
||||||
PRINT " $_1"
|
PRINT " $_1"
|
||||||
_buildargs="$_buildargs $_1"
|
_buildargs="$_buildargs $_1"
|
||||||
|
@@ -13,25 +13,3 @@
|
|||||||
-# pragma message("Unknown compiler version - please run the configure tests and report the results")
|
-# pragma message("Unknown compiler version - please run the configure tests and report the results")
|
||||||
-# endif
|
-# endif
|
||||||
-#endif
|
-#endif
|
||||||
--- a/boost/type_traits/has_nothrow_assign.hpp 2015-12-13 05:49:42 -0700
|
|
||||||
+++ b/boost/type_traits/has_nothrow_assign.hpp 2018-05-27 11:11:02 -0600
|
|
||||||
@@ -24,7 +24,7 @@
|
|
||||||
#include <boost/type_traits/remove_reference.hpp>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
-#if defined(__GNUC__) || defined(__SUNPRO_CC)
|
|
||||||
+#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__clang__)
|
|
||||||
#include <boost/type_traits/is_const.hpp>
|
|
||||||
#include <boost/type_traits/is_volatile.hpp>
|
|
||||||
#include <boost/type_traits/is_assignable.hpp>
|
|
||||||
--- a/boost/type_traits/has_nothrow_constructor.hpp 2015-12-13 05:49:42 -0700
|
|
||||||
+++ b/boost/type_traits/has_nothrow_constructor.hpp 2018-05-27 11:11:02 -0600
|
|
||||||
@@ -17,7 +17,7 @@
|
|
||||||
#if defined(BOOST_MSVC) || defined(BOOST_INTEL)
|
|
||||||
#include <boost/type_traits/has_trivial_constructor.hpp>
|
|
||||||
#endif
|
|
||||||
-#if defined(__GNUC__ ) || defined(__SUNPRO_CC)
|
|
||||||
+#if defined(__GNUC__ ) || defined(__SUNPRO_CC) || defined(__clang__)
|
|
||||||
#include <boost/type_traits/is_default_constructible.hpp>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
@@ -79,3 +79,4 @@ macro( select_library_configurations basename )
|
|||||||
${basename}_LIBRARY_DEBUG
|
${basename}_LIBRARY_DEBUG
|
||||||
)
|
)
|
||||||
endmacro( select_library_configurations )
|
endmacro( select_library_configurations )
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@ project(OpenVDB)
|
|||||||
|
|
||||||
# --------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
|
||||||
|
|
||||||
# --------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -88,14 +88,6 @@ elseif(WIN32)
|
|||||||
set(DISABLE_RTTI "/EHs- /GR- ")
|
set(DISABLE_RTTI "/EHs- /GR- ")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
||||||
include(CheckCXXCompilerFlag)
|
|
||||||
check_cxx_compiler_flag("-flifetime-dse=1" SUPPORTS_FLIFETIME)
|
|
||||||
if (SUPPORTS_FLIFETIME)
|
|
||||||
add_definitions(-flifetime-dse=1)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Linker export definitions
|
# Linker export definitions
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
add_custom_command(OUTPUT tbb.def
|
add_custom_command(OUTPUT tbb.def
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
diff -Naur external_openal_original/CMakeLists.txt external_openal/CMakeLists.txt
|
|
||||||
--- external_openal_original/CMakeLists.txt 2016-01-24 20:12:39 -0700
|
|
||||||
+++ external_openal/CMakeLists.txt 2018-06-02 12:16:52 -0600
|
|
||||||
@@ -885,7 +885,8 @@
|
|
||||||
OPTION(ALSOFT_REQUIRE_MMDEVAPI "Require MMDevApi backend" OFF)
|
|
||||||
IF(HAVE_WINDOWS_H)
|
|
||||||
# Check MMSystem backend
|
|
||||||
- CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H -D_WIN32_WINNT=0x0502)
|
|
||||||
+ set(CMAKE_REQUIRED_FLAGS "-D_WIN32_WINNT=0x0502")
|
|
||||||
+ CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H)
|
|
||||||
IF(HAVE_MMSYSTEM_H)
|
|
||||||
CHECK_SHARED_FUNCTION_EXISTS(waveOutOpen "windows.h;mmsystem.h" winmm "" HAVE_LIBWINMM)
|
|
||||||
IF(HAVE_LIBWINMM)
|
|
@@ -10,29 +10,3 @@ diff -Naur osl/src/external_osl/src/cmake/flexbison.cmake osl_bak/src/external_o
|
|||||||
MAIN_DEPENDENCY ${flexsrc}
|
MAIN_DEPENDENCY ${flexsrc}
|
||||||
DEPENDS ${${compiler_headers}}
|
DEPENDS ${${compiler_headers}}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||||
--- osl/src/external_osl/src/include/OSL/oslconfig.h 2016-10-31 16:48:19 -0600
|
|
||||||
+++ osl/src/external_osl/src/include/OSL/oslconfig.h 2018-05-27 11:18:08 -0600
|
|
||||||
@@ -44,12 +44,18 @@
|
|
||||||
// same if another packages is compiling against OSL and using these headers
|
|
||||||
// (OSL may be C++11 but the client package may be older, or vice versa --
|
|
||||||
// use these two symbols to differentiate these cases, when important).
|
|
||||||
-#if (__cplusplus >= 201402L)
|
|
||||||
-# define OSL_CPLUSPLUS_VERSION 14
|
|
||||||
-#elif (__cplusplus >= 201103L)
|
|
||||||
-# define OSL_CPLUSPLUS_VERSION 11
|
|
||||||
+
|
|
||||||
+// Force C++03 for MSVC in blender since svn the libraries are build with that
|
|
||||||
+#if !defined(_MSC_VER)
|
|
||||||
+ #if (__cplusplus >= 201402L)
|
|
||||||
+ # define OSL_CPLUSPLUS_VERSION 14
|
|
||||||
+ #elif (__cplusplus >= 201103L)
|
|
||||||
+ # define OSL_CPLUSPLUS_VERSION 11
|
|
||||||
+ #else
|
|
||||||
+ # define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */
|
|
||||||
+ #endif
|
|
||||||
#else
|
|
||||||
-# define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */
|
|
||||||
+ # define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Symbol export defines
|
|
||||||
|
@@ -14,18 +14,10 @@ if NOT "%1" == "" (
|
|||||||
set BuildDir=VS14
|
set BuildDir=VS14
|
||||||
goto par2
|
goto par2
|
||||||
)
|
)
|
||||||
if "%1" == "2017" (
|
|
||||||
echo "Building for VS2017"
|
|
||||||
set VSVER=15.0
|
|
||||||
set VSVER_SHORT=15
|
|
||||||
set BuildDir=VS15
|
|
||||||
goto par2
|
|
||||||
)
|
|
||||||
|
|
||||||
)
|
)
|
||||||
:usage
|
:usage
|
||||||
|
|
||||||
Echo Usage build_deps 2013/2015/2017 x64/x86
|
Echo Usage build_deps 2013/2015 x64/x86
|
||||||
goto exit
|
goto exit
|
||||||
:par2
|
:par2
|
||||||
if NOT "%2" == "" (
|
if NOT "%2" == "" (
|
||||||
@@ -39,10 +31,6 @@ if NOT "%2" == "" (
|
|||||||
if "%1" == "2015" (
|
if "%1" == "2015" (
|
||||||
set CMAKE_BUILDER=Visual Studio 14 2015
|
set CMAKE_BUILDER=Visual Studio 14 2015
|
||||||
)
|
)
|
||||||
if "%1" == "2017" (
|
|
||||||
set CMAKE_BUILDER=Visual Studio 15 2017
|
|
||||||
)
|
|
||||||
|
|
||||||
goto start
|
goto start
|
||||||
)
|
)
|
||||||
if "%2" == "x64" (
|
if "%2" == "x64" (
|
||||||
@@ -55,10 +43,6 @@ if NOT "%2" == "" (
|
|||||||
if "%1" == "2015" (
|
if "%1" == "2015" (
|
||||||
set CMAKE_BUILDER=Visual Studio 14 2015 Win64
|
set CMAKE_BUILDER=Visual Studio 14 2015 Win64
|
||||||
)
|
)
|
||||||
if "%1" == "2017" (
|
|
||||||
set CMAKE_BUILDER=Visual Studio 15 2017 Win64
|
|
||||||
)
|
|
||||||
|
|
||||||
goto start
|
goto start
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@@ -139,10 +139,6 @@ set(ZLIB_LIBRARY "/usr/lib${MULTILIB}/libz.a" CACHE STRING "" FORCE)
|
|||||||
# OpenVDB
|
# OpenVDB
|
||||||
set(OPENVDB_LIBRARY
|
set(OPENVDB_LIBRARY
|
||||||
/opt/lib/openvdb/lib/libopenvdb.a
|
/opt/lib/openvdb/lib/libopenvdb.a
|
||||||
CACHE BOOL "" FORCE
|
|
||||||
)
|
|
||||||
|
|
||||||
set(BLOSC_LIBRARY
|
|
||||||
/opt/lib/blosc/lib/libblosc.a
|
/opt/lib/blosc/lib/libblosc.a
|
||||||
CACHE BOOL "" FORCE
|
CACHE BOOL "" FORCE
|
||||||
)
|
)
|
||||||
|
@@ -77,13 +77,7 @@ if 'cmake' in builder:
|
|||||||
# cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-hack/nvcc')
|
# cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-hack/nvcc')
|
||||||
|
|
||||||
elif builder.startswith('win'):
|
elif builder.startswith('win'):
|
||||||
if builder.endswith('_vs2017'):
|
if builder.endswith('_vc2015'):
|
||||||
if builder.startswith('win64'):
|
|
||||||
cmake_options.extend(['-G', 'Visual Studio 15 2017 Win64'])
|
|
||||||
elif builder.startswith('win32'):
|
|
||||||
bits = 32
|
|
||||||
cmake_options.extend(['-G', 'Visual Studio 15 2017'])
|
|
||||||
elif builder.endswith('_vc2015'):
|
|
||||||
if builder.startswith('win64'):
|
if builder.startswith('win64'):
|
||||||
cmake_options.extend(['-G', 'Visual Studio 14 2015 Win64'])
|
cmake_options.extend(['-G', 'Visual Studio 14 2015 Win64'])
|
||||||
elif builder.startswith('win32'):
|
elif builder.startswith('win32'):
|
||||||
|
@@ -1,72 +0,0 @@
|
|||||||
# - Find Blosc library
|
|
||||||
# Find the native Blosc includes and library
|
|
||||||
# This module defines
|
|
||||||
# BLOSC_INCLUDE_DIRS, where to find blosc.h, Set when
|
|
||||||
# Blosc is found.
|
|
||||||
# BLOSC_LIBRARIES, libraries to link against to use Blosc.
|
|
||||||
# BLOSC_ROOT_DIR, The base directory to search for Blosc.
|
|
||||||
# This can also be an environment variable.
|
|
||||||
# BLOSC_FOUND, If false, do not try to use Blosc.
|
|
||||||
#
|
|
||||||
# also defined, but not for general use are
|
|
||||||
# BLOSC_LIBRARY, where to find the Blosc library.
|
|
||||||
|
|
||||||
#=============================================================================
|
|
||||||
# Copyright 2018 Blender Foundation.
|
|
||||||
#
|
|
||||||
# Distributed under the OSI-approved BSD License (the "License");
|
|
||||||
# see accompanying file Copyright.txt for details.
|
|
||||||
#
|
|
||||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
||||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
# See the License for more information.
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
# If BLOSC_ROOT_DIR was defined in the environment, use it.
|
|
||||||
IF(NOT BLOSC_ROOT_DIR AND NOT $ENV{BLOSC_ROOT_DIR} STREQUAL "")
|
|
||||||
SET(BLOSC_ROOT_DIR $ENV{BLOSC_ROOT_DIR})
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
SET(_blosc_SEARCH_DIRS
|
|
||||||
${BLOSC_ROOT_DIR}
|
|
||||||
/usr/local
|
|
||||||
/sw # Fink
|
|
||||||
/opt/local # DarwinPorts
|
|
||||||
/opt/lib/blosc
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_PATH(BLOSC_INCLUDE_DIR
|
|
||||||
NAMES
|
|
||||||
blosc.h
|
|
||||||
HINTS
|
|
||||||
${_blosc_SEARCH_DIRS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
include
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(BLOSC_LIBRARY
|
|
||||||
NAMES
|
|
||||||
blosc
|
|
||||||
HINTS
|
|
||||||
${_blosc_SEARCH_DIRS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
lib64 lib
|
|
||||||
)
|
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set BLOSC_FOUND to TRUE if
|
|
||||||
# all listed variables are TRUE
|
|
||||||
INCLUDE(FindPackageHandleStandardArgs)
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BLOSC DEFAULT_MSG
|
|
||||||
BLOSC_LIBRARY BLOSC_INCLUDE_DIR)
|
|
||||||
|
|
||||||
IF(BLOSC_FOUND)
|
|
||||||
SET(BLOSC_LIBRARIES ${BLOSC_LIBRARY})
|
|
||||||
SET(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIR})
|
|
||||||
ELSE()
|
|
||||||
SET(BLOSC_BLOSC_FOUND FALSE)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
|
||||||
BLOSC_INCLUDE_DIR
|
|
||||||
BLOSC_LIBRARY
|
|
||||||
)
|
|
@@ -93,3 +93,4 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LLVM DEFAULT_MSG
|
|||||||
MARK_AS_ADVANCED(
|
MARK_AS_ADVANCED(
|
||||||
LLVM_LIBRARY
|
LLVM_LIBRARY
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -32,7 +32,6 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
|
|||||||
${EXTRA_LIBS}
|
${EXTRA_LIBS}
|
||||||
${PLATFORM_LINKLIBS}
|
${PLATFORM_LINKLIBS}
|
||||||
bf_testing_main
|
bf_testing_main
|
||||||
bf_intern_eigen
|
|
||||||
bf_intern_guardedalloc
|
bf_intern_guardedalloc
|
||||||
extern_gtest
|
extern_gtest
|
||||||
extern_gmock
|
extern_gmock
|
||||||
|
@@ -1,7 +0,0 @@
|
|||||||
include("${CMAKE_CURRENT_LIST_DIR}/blender_lite.cmake")
|
|
||||||
|
|
||||||
set(WITH_PYTHON_INSTALL_NUMPY OFF CACHE BOOL "" FORCE)
|
|
||||||
set(WITH_SYSTEM_GLEW OFF CACHE BOOL "" FORCE)
|
|
||||||
# Brecht says: KEEP THIS ENABLED. *SOMETHING* breaks otherwise.
|
|
||||||
# Something == DPI. Go figure.
|
|
||||||
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
|
|
@@ -23,6 +23,7 @@ set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
|||||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_IMAGE_FRAMESERVER ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
||||||
|
@@ -28,6 +28,7 @@ set(WITH_IK_SOLVER OFF CACHE BOOL "" FORCE)
|
|||||||
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
|
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_DDS OFF CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_DDS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_IMAGE_FRAMESERVER OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_HDR OFF CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_HDR OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_OPENEXR OFF CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_OPENEXR OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_OPENJPEG OFF CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_OPENJPEG OFF CACHE BOOL "" FORCE)
|
||||||
|
@@ -23,6 +23,7 @@ set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
|||||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_IMAGE_FRAMESERVER ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
||||||
|
@@ -352,11 +352,6 @@ function(SETUP_LIBDIRS)
|
|||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
macro(setup_platform_linker_flags)
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
function(setup_liblinks
|
function(setup_liblinks
|
||||||
target
|
target
|
||||||
)
|
)
|
||||||
@@ -430,7 +425,7 @@ function(setup_liblinks
|
|||||||
target_link_libraries(${target} ${OPENSUBDIV_LIBRARIES})
|
target_link_libraries(${target} ${OPENSUBDIV_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
if(WITH_OPENVDB)
|
if(WITH_OPENVDB)
|
||||||
target_link_libraries(${target} ${OPENVDB_LIBRARIES} ${TBB_LIBRARIES} ${BLOSC_LIBRARIES})
|
target_link_libraries(${target} ${OPENVDB_LIBRARIES} ${TBB_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
if(WITH_CYCLES_OSL)
|
if(WITH_CYCLES_OSL)
|
||||||
target_link_libraries(${target} ${OSL_LIBRARIES})
|
target_link_libraries(${target} ${OSL_LIBRARIES})
|
||||||
@@ -574,7 +569,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
|||||||
|
|
||||||
bf_editor_space_api
|
bf_editor_space_api
|
||||||
bf_editor_space_action
|
bf_editor_space_action
|
||||||
bf_editor_space_benchmark
|
|
||||||
bf_editor_space_buttons
|
bf_editor_space_buttons
|
||||||
bf_editor_space_console
|
bf_editor_space_console
|
||||||
bf_editor_space_file
|
bf_editor_space_file
|
||||||
@@ -587,7 +581,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
|||||||
bf_editor_space_outliner
|
bf_editor_space_outliner
|
||||||
bf_editor_space_script
|
bf_editor_space_script
|
||||||
bf_editor_space_sequencer
|
bf_editor_space_sequencer
|
||||||
bf_editor_space_statusbar
|
|
||||||
bf_editor_space_text
|
bf_editor_space_text
|
||||||
bf_editor_space_time
|
bf_editor_space_time
|
||||||
bf_editor_space_topbar
|
bf_editor_space_topbar
|
||||||
@@ -599,12 +592,12 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
|||||||
bf_editor_util
|
bf_editor_util
|
||||||
bf_editor_uvedit
|
bf_editor_uvedit
|
||||||
bf_editor_curve
|
bf_editor_curve
|
||||||
|
bf_editor_gpencil
|
||||||
bf_editor_interface
|
bf_editor_interface
|
||||||
bf_editor_gizmo_library
|
bf_editor_manipulator_library
|
||||||
bf_editor_mesh
|
bf_editor_mesh
|
||||||
bf_editor_metaball
|
bf_editor_metaball
|
||||||
bf_editor_object
|
bf_editor_object
|
||||||
bf_editor_gpencil
|
|
||||||
bf_editor_lattice
|
bf_editor_lattice
|
||||||
bf_editor_armature
|
bf_editor_armature
|
||||||
bf_editor_physics
|
bf_editor_physics
|
||||||
@@ -622,24 +615,21 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
|||||||
bf_python
|
bf_python
|
||||||
bf_python_ext
|
bf_python_ext
|
||||||
bf_python_mathutils
|
bf_python_mathutils
|
||||||
bf_python_gpu
|
bf_python_gawain
|
||||||
bf_python_bmesh
|
bf_python_bmesh
|
||||||
bf_freestyle
|
bf_freestyle
|
||||||
bf_ikplugin
|
bf_ikplugin
|
||||||
bf_modifiers
|
bf_modifiers
|
||||||
bf_gpencil_modifiers
|
|
||||||
bf_alembic
|
bf_alembic
|
||||||
bf_bmesh
|
bf_bmesh
|
||||||
bf_gpu
|
bf_gpu
|
||||||
bf_draw
|
bf_draw
|
||||||
bf_blenloader
|
bf_blenloader
|
||||||
bf_blenkernel
|
bf_blenkernel
|
||||||
bf_shader_fx
|
|
||||||
bf_gpencil_modifiers
|
|
||||||
bf_physics
|
bf_physics
|
||||||
bf_nodes
|
bf_nodes
|
||||||
bf_rna
|
bf_rna
|
||||||
bf_editor_gizmo_library # rna -> gizmo bad-level calls
|
bf_editor_manipulator_library # rna -> manipulator bad-level calls
|
||||||
bf_python
|
bf_python
|
||||||
bf_imbuf
|
bf_imbuf
|
||||||
bf_blenlib
|
bf_blenlib
|
||||||
@@ -678,9 +668,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
|||||||
extern_openjpeg
|
extern_openjpeg
|
||||||
ge_videotex
|
ge_videotex
|
||||||
bf_dna
|
bf_dna
|
||||||
|
|
||||||
bf_blenfont
|
bf_blenfont
|
||||||
bf_gpu # duplicate for blenfont
|
|
||||||
bf_blentranslation
|
bf_blentranslation
|
||||||
bf_intern_audaspace
|
bf_intern_audaspace
|
||||||
audaspace
|
audaspace
|
||||||
@@ -878,6 +866,164 @@ macro(message_first_run)
|
|||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro(TEST_UNORDERED_MAP_SUPPORT)
|
||||||
|
# - Detect unordered_map availability
|
||||||
|
# Test if a valid implementation of unordered_map exists
|
||||||
|
# and define the include path
|
||||||
|
# This module defines
|
||||||
|
# HAVE_UNORDERED_MAP, whether unordered_map implementation was found
|
||||||
|
#
|
||||||
|
# HAVE_STD_UNORDERED_MAP_HEADER, <unordered_map.h> was found
|
||||||
|
# HAVE_UNORDERED_MAP_IN_STD_NAMESPACE, unordered_map is in namespace std
|
||||||
|
# HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE, unordered_map is in namespace std::tr1
|
||||||
|
#
|
||||||
|
# UNORDERED_MAP_INCLUDE_PREFIX, include path prefix for unordered_map, if found
|
||||||
|
# UNORDERED_MAP_NAMESPACE, namespace for unordered_map, if found
|
||||||
|
|
||||||
|
include(CheckIncludeFileCXX)
|
||||||
|
|
||||||
|
# Workaround for newer GCC (6.x+) where C++11 was enabled by default, which lead us
|
||||||
|
# to a situation when there is <unordered_map> include but which can't be used uless
|
||||||
|
# C++11 is enabled.
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
|
||||||
|
set(HAVE_STD_UNORDERED_MAP_HEADER False)
|
||||||
|
else()
|
||||||
|
CHECK_INCLUDE_FILE_CXX("unordered_map" HAVE_STD_UNORDERED_MAP_HEADER)
|
||||||
|
endif()
|
||||||
|
if(HAVE_STD_UNORDERED_MAP_HEADER)
|
||||||
|
# Even so we've found unordered_map header file it doesn't
|
||||||
|
# mean unordered_map and unordered_set will be declared in
|
||||||
|
# std namespace.
|
||||||
|
#
|
||||||
|
# Namely, MSVC 2008 have unordered_map header which declares
|
||||||
|
# unordered_map class in std::tr1 namespace. In order to support
|
||||||
|
# this, we do extra check to see which exactly namespace is
|
||||||
|
# to be used.
|
||||||
|
|
||||||
|
include(CheckCXXSourceCompiles)
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("#include <unordered_map>
|
||||||
|
int main() {
|
||||||
|
std::unordered_map<int, int> map;
|
||||||
|
return 0;
|
||||||
|
}"
|
||||||
|
HAVE_UNORDERED_MAP_IN_STD_NAMESPACE)
|
||||||
|
if(HAVE_UNORDERED_MAP_IN_STD_NAMESPACE)
|
||||||
|
message_first_run(STATUS "Found unordered_map/set in std namespace.")
|
||||||
|
|
||||||
|
set(HAVE_UNORDERED_MAP "TRUE")
|
||||||
|
set(UNORDERED_MAP_INCLUDE_PREFIX "")
|
||||||
|
set(UNORDERED_MAP_NAMESPACE "std")
|
||||||
|
else()
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("#include <unordered_map>
|
||||||
|
int main() {
|
||||||
|
std::tr1::unordered_map<int, int> map;
|
||||||
|
return 0;
|
||||||
|
}"
|
||||||
|
HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
|
||||||
|
if(HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
|
||||||
|
message_first_run(STATUS "Found unordered_map/set in std::tr1 namespace.")
|
||||||
|
|
||||||
|
set(HAVE_UNORDERED_MAP "TRUE")
|
||||||
|
set(UNORDERED_MAP_INCLUDE_PREFIX "")
|
||||||
|
set(UNORDERED_MAP_NAMESPACE "std::tr1")
|
||||||
|
else()
|
||||||
|
message_first_run(STATUS "Found <unordered_map> but cannot find either std::unordered_map "
|
||||||
|
"or std::tr1::unordered_map.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
CHECK_INCLUDE_FILE_CXX("tr1/unordered_map" HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
|
||||||
|
if(HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
|
||||||
|
message_first_run(STATUS "Found unordered_map/set in std::tr1 namespace.")
|
||||||
|
|
||||||
|
set(HAVE_UNORDERED_MAP "TRUE")
|
||||||
|
set(UNORDERED_MAP_INCLUDE_PREFIX "tr1")
|
||||||
|
set(UNORDERED_MAP_NAMESPACE "std::tr1")
|
||||||
|
else()
|
||||||
|
message_first_run(STATUS "Unable to find <unordered_map> or <tr1/unordered_map>. ")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(TEST_SHARED_PTR_SUPPORT)
|
||||||
|
# This check are coming from Ceres library.
|
||||||
|
#
|
||||||
|
# Find shared pointer header and namespace.
|
||||||
|
#
|
||||||
|
# This module defines the following variables:
|
||||||
|
#
|
||||||
|
# SHARED_PTR_FOUND: TRUE if shared_ptr found.
|
||||||
|
# SHARED_PTR_TR1_MEMORY_HEADER: True if <tr1/memory> header is to be used
|
||||||
|
# for the shared_ptr object, otherwise use <memory>.
|
||||||
|
# SHARED_PTR_TR1_NAMESPACE: TRUE if shared_ptr is defined in std::tr1 namespace,
|
||||||
|
# otherwise it's assumed to be defined in std namespace.
|
||||||
|
|
||||||
|
include(CheckIncludeFileCXX)
|
||||||
|
include(CheckCXXSourceCompiles)
|
||||||
|
set(SHARED_PTR_FOUND FALSE)
|
||||||
|
# Workaround for newer GCC (6.x+) where C++11 was enabled by default, which lead us
|
||||||
|
# to a situation when there is <unordered_map> include but which can't be used uless
|
||||||
|
# C++11 is enabled.
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
|
||||||
|
set(HAVE_STD_MEMORY_HEADER False)
|
||||||
|
else()
|
||||||
|
CHECK_INCLUDE_FILE_CXX(memory HAVE_STD_MEMORY_HEADER)
|
||||||
|
endif()
|
||||||
|
if(HAVE_STD_MEMORY_HEADER)
|
||||||
|
# Finding the memory header doesn't mean that shared_ptr is in std
|
||||||
|
# namespace.
|
||||||
|
#
|
||||||
|
# In particular, MSVC 2008 has shared_ptr declared in std::tr1. In
|
||||||
|
# order to support this, we do an extra check to see which namespace
|
||||||
|
# should be used.
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("#include <memory>
|
||||||
|
int main() {
|
||||||
|
std::shared_ptr<int> int_ptr;
|
||||||
|
return 0;
|
||||||
|
}"
|
||||||
|
HAVE_SHARED_PTR_IN_STD_NAMESPACE)
|
||||||
|
|
||||||
|
if(HAVE_SHARED_PTR_IN_STD_NAMESPACE)
|
||||||
|
message_first_run("-- Found shared_ptr in std namespace using <memory> header.")
|
||||||
|
set(SHARED_PTR_FOUND TRUE)
|
||||||
|
else()
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("#include <memory>
|
||||||
|
int main() {
|
||||||
|
std::tr1::shared_ptr<int> int_ptr;
|
||||||
|
return 0;
|
||||||
|
}"
|
||||||
|
HAVE_SHARED_PTR_IN_TR1_NAMESPACE)
|
||||||
|
if(HAVE_SHARED_PTR_IN_TR1_NAMESPACE)
|
||||||
|
message_first_run("-- Found shared_ptr in std::tr1 namespace using <memory> header.")
|
||||||
|
set(SHARED_PTR_TR1_NAMESPACE TRUE)
|
||||||
|
set(SHARED_PTR_FOUND TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT SHARED_PTR_FOUND)
|
||||||
|
# Further, gcc defines shared_ptr in std::tr1 namespace and
|
||||||
|
# <tr1/memory> is to be included for this. And what makes things
|
||||||
|
# even more tricky is that gcc does have <memory> header, so
|
||||||
|
# all the checks above wouldn't find shared_ptr.
|
||||||
|
CHECK_INCLUDE_FILE_CXX("tr1/memory" HAVE_TR1_MEMORY_HEADER)
|
||||||
|
if(HAVE_TR1_MEMORY_HEADER)
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("#include <tr1/memory>
|
||||||
|
int main() {
|
||||||
|
std::tr1::shared_ptr<int> int_ptr;
|
||||||
|
return 0;
|
||||||
|
}"
|
||||||
|
HAVE_SHARED_PTR_IN_TR1_NAMESPACE_FROM_TR1_MEMORY_HEADER)
|
||||||
|
if(HAVE_SHARED_PTR_IN_TR1_NAMESPACE_FROM_TR1_MEMORY_HEADER)
|
||||||
|
message_first_run("-- Found shared_ptr in std::tr1 namespace using <tr1/memory> header.")
|
||||||
|
set(SHARED_PTR_TR1_MEMORY_HEADER TRUE)
|
||||||
|
set(SHARED_PTR_TR1_NAMESPACE TRUE)
|
||||||
|
set(SHARED_PTR_FOUND TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
# when we have warnings as errors applied globally this
|
# when we have warnings as errors applied globally this
|
||||||
# needs to be removed for some external libs which we dont maintain.
|
# needs to be removed for some external libs which we dont maintain.
|
||||||
|
|
||||||
@@ -902,19 +1048,13 @@ macro(remove_cc_flag
|
|||||||
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(add_c_flag
|
macro(add_cc_flag
|
||||||
flag)
|
flag)
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(add_cxx_flag
|
|
||||||
flag)
|
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(remove_strict_flags)
|
macro(remove_strict_flags)
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCC)
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
@@ -937,8 +1077,7 @@ macro(remove_strict_flags)
|
|||||||
)
|
)
|
||||||
|
|
||||||
# negate flags implied by '-Wall'
|
# negate flags implied by '-Wall'
|
||||||
add_c_flag("${C_REMOVE_STRICT_FLAGS}")
|
add_cc_flag("${CC_REMOVE_STRICT_FLAGS}")
|
||||||
add_cxx_flag("${CXX_REMOVE_STRICT_FLAGS}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
@@ -950,8 +1089,7 @@ macro(remove_strict_flags)
|
|||||||
)
|
)
|
||||||
|
|
||||||
# negate flags implied by '-Wall'
|
# negate flags implied by '-Wall'
|
||||||
add_c_flag("${C_REMOVE_STRICT_FLAGS}")
|
add_cc_flag("${CC_REMOVE_STRICT_FLAGS}")
|
||||||
add_cxx_flag("${CXX_REMOVE_STRICT_FLAGS}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
@@ -981,39 +1119,28 @@ endmacro()
|
|||||||
# note, we can only append flags on a single file so we need to negate the options.
|
# note, we can only append flags on a single file so we need to negate the options.
|
||||||
# at the moment we cant shut up ffmpeg deprecations, so use this, but will
|
# at the moment we cant shut up ffmpeg deprecations, so use this, but will
|
||||||
# probably add more removals here.
|
# probably add more removals here.
|
||||||
macro(remove_strict_c_flags_file
|
macro(remove_strict_flags_file
|
||||||
filenames)
|
filenames)
|
||||||
foreach(_SOURCE ${ARGV})
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCC OR
|
|
||||||
(CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
|
||||||
set_source_files_properties(${_SOURCE}
|
|
||||||
PROPERTIES
|
|
||||||
COMPILE_FLAGS "${C_REMOVE_STRICT_FLAGS}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(MSVC)
|
|
||||||
# TODO
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
unset(_SOURCE)
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(remove_strict_cxx_flags_file
|
|
||||||
filenames)
|
|
||||||
remove_strict_c_flags_file(${filenames} ${ARHV})
|
|
||||||
foreach(_SOURCE ${ARGV})
|
foreach(_SOURCE ${ARGV})
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCC OR
|
if(CMAKE_COMPILER_IS_GNUCC OR
|
||||||
(CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
(CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
||||||
|
|
||||||
set_source_files_properties(${_SOURCE}
|
set_source_files_properties(${_SOURCE}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
COMPILE_FLAGS "${CXX_REMOVE_STRICT_FLAGS}"
|
COMPILE_FLAGS "${CC_REMOVE_STRICT_FLAGS}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# TODO
|
# TODO
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
unset(_SOURCE)
|
unset(_SOURCE)
|
||||||
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# External libs may need 'signed char' to be default.
|
# External libs may need 'signed char' to be default.
|
||||||
|
@@ -358,7 +358,7 @@ if(WITH_LLVM)
|
|||||||
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
|
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
|
||||||
OUTPUT_VARIABLE LLVM_LIBRARY
|
OUTPUT_VARIABLE LLVM_LIBRARY
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
string(REPLACE ".a /" ".a;/" LLVM_LIBRARY ${LLVM_LIBRARY})
|
string(REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})
|
||||||
else()
|
else()
|
||||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
|
||||||
endif()
|
endif()
|
||||||
@@ -418,7 +418,7 @@ if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
|
|||||||
endif()
|
endif()
|
||||||
# Get rid of eventually clashes, we export some symbols explicite as local
|
# Get rid of eventually clashes, we export some symbols explicite as local
|
||||||
set(PLATFORM_LINKFLAGS
|
set(PLATFORM_LINKFLAGS
|
||||||
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker '${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
|
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker ${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||||
|
@@ -104,7 +104,7 @@ endif()
|
|||||||
# 10.9 is our min. target, if you use higher sdk, weak linking happens
|
# 10.9 is our min. target, if you use higher sdk, weak linking happens
|
||||||
if(CMAKE_OSX_DEPLOYMENT_TARGET)
|
if(CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||||
if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.9)
|
if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.9)
|
||||||
message(STATUS "Setting deployment target to 10.9, lower versions are not supported")
|
message(STATUS "Setting deployment target to 10.9, lower versions are incompatible with WITH_CXX11")
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
|
@@ -237,14 +237,10 @@ endif()
|
|||||||
if(WITH_OPENVDB)
|
if(WITH_OPENVDB)
|
||||||
find_package_wrapper(OpenVDB)
|
find_package_wrapper(OpenVDB)
|
||||||
find_package_wrapper(TBB)
|
find_package_wrapper(TBB)
|
||||||
find_package_wrapper(Blosc)
|
|
||||||
if(NOT OPENVDB_FOUND OR NOT TBB_FOUND)
|
if(NOT OPENVDB_FOUND OR NOT TBB_FOUND)
|
||||||
set(WITH_OPENVDB OFF)
|
set(WITH_OPENVDB OFF)
|
||||||
set(WITH_OPENVDB_BLOSC OFF)
|
set(WITH_OPENVDB_BLOSC OFF)
|
||||||
message(STATUS "OpenVDB not found, disabling it")
|
message(STATUS "OpenVDB not found, disabling it")
|
||||||
elseif(NOT BLOSC_FOUND)
|
|
||||||
set(WITH_OPENVDB_BLOSC OFF)
|
|
||||||
message(STATUS "Blosc not found, disabling it")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -29,16 +29,7 @@ if(NOT MSVC)
|
|||||||
message(FATAL_ERROR "Compiler is unsupported")
|
message(FATAL_ERROR "Compiler is unsupported")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
# Libraries configuration for Windows when compiling with MSVC.
|
||||||
set(MSVC_CLANG On)
|
|
||||||
set(VC_TOOLS_DIR $ENV{VCToolsRedistDir} CACHE STRING "Location of the msvc redistributables")
|
|
||||||
set(MSVC_REDIST_DIR ${VC_TOOLS_DIR})
|
|
||||||
if (DEFINED MSVC_REDIST_DIR)
|
|
||||||
file(TO_CMAKE_PATH ${MSVC_REDIST_DIR} MSVC_REDIST_DIR)
|
|
||||||
else()
|
|
||||||
message("Unable to detect the Visual Studio redist directory, copying of the runtime dlls will not work, try running from the visual studio developer prompt.")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_FOLDERS})
|
set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_FOLDERS})
|
||||||
|
|
||||||
@@ -128,15 +119,8 @@ set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
|
|||||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
|
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
|
||||||
include(InstallRequiredSystemLibraries)
|
include(InstallRequiredSystemLibraries)
|
||||||
|
|
||||||
remove_cc_flag("/MDd" "/MD")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
|
||||||
if(MSVC_CLANG) # Clangs version of cl doesn't support all flags
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ")
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference")
|
|
||||||
else()
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
|
||||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
|
||||||
@@ -147,7 +131,7 @@ set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT")
|
|||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT")
|
||||||
|
|
||||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
|
set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
|
||||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib ")
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib ")
|
||||||
|
|
||||||
# Ignore meaningless for us linker warnings.
|
# Ignore meaningless for us linker warnings.
|
||||||
@@ -160,7 +144,7 @@ else()
|
|||||||
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
|
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
|
set(PLATFORM_LINKFLAGS_DEBUG "/IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
|
||||||
|
|
||||||
if(NOT DEFINED LIBDIR)
|
if(NOT DEFINED LIBDIR)
|
||||||
|
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
echo No explicit msvc version requested, autodetecting version.
|
|
||||||
|
|
||||||
call "%~dp0\detect_msvc2017.cmd"
|
|
||||||
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
|
||||||
|
|
||||||
call "%~dp0\detect_msvc2015.cmd"
|
|
||||||
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
|
||||||
|
|
||||||
echo Compiler Detection failed. Use verbose switch for more information.
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:DetectionComplete
|
|
||||||
echo Compiler Detection successful, detected VS%BUILD_VS_YEAR%
|
|
||||||
exit /b 0
|
|
@@ -1,26 +0,0 @@
|
|||||||
if "%NOBUILD%"=="1" goto EOF
|
|
||||||
echo %TIME% > %BUILD_DIR%\buildtime.txt
|
|
||||||
msbuild ^
|
|
||||||
%BUILD_DIR%\Blender.sln ^
|
|
||||||
/target:build ^
|
|
||||||
/property:Configuration=%BUILD_TYPE% ^
|
|
||||||
/maxcpucount:2 ^
|
|
||||||
/verbosity:minimal ^
|
|
||||||
/p:platform=%MSBUILD_PLATFORM% ^
|
|
||||||
/flp:Summary;Verbosity=minimal;LogFile=%BUILD_DIR%\Build.log
|
|
||||||
if errorlevel 1 (
|
|
||||||
echo Error during build, see %BUILD_DIR%\Build.log for details
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
msbuild ^
|
|
||||||
%BUILD_DIR%\INSTALL.vcxproj ^
|
|
||||||
/property:Configuration=%BUILD_TYPE% ^
|
|
||||||
/verbosity:minimal ^
|
|
||||||
/p:platform=%MSBUILD_PLATFORM%
|
|
||||||
if errorlevel 1 (
|
|
||||||
echo Error during install phase
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
echo %TIME% >> %BUILD_DIR%\buildtime.txt
|
|
||||||
:EOF
|
|
@@ -1,16 +0,0 @@
|
|||||||
if "%NOBUILD%"=="1" goto EOF
|
|
||||||
set HAS_ERROR=
|
|
||||||
cd %BUILD_DIR%
|
|
||||||
echo %TIME% > buildtime.txt
|
|
||||||
ninja install
|
|
||||||
if errorlevel 1 (
|
|
||||||
set HAS_ERROR=1
|
|
||||||
)
|
|
||||||
echo %TIME% >>buildtime.txt
|
|
||||||
cd %BLENDER_DIR%
|
|
||||||
|
|
||||||
if "%HAS_ERROR%" == "1" (
|
|
||||||
echo Error during build
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
:EOF
|
|
@@ -1,53 +0,0 @@
|
|||||||
if "%BUILD_VS_YEAR%"=="2015" set BUILD_VS_LIBDIRPOST=vc14
|
|
||||||
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc14
|
|
||||||
|
|
||||||
if "%BUILD_ARCH%"=="x64" (
|
|
||||||
set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%
|
|
||||||
) else if "%BUILD_ARCH%"=="x86" (
|
|
||||||
set BUILD_VS_SVNDIR=windows_%BUILD_VS_LIBDIRPOST%
|
|
||||||
)
|
|
||||||
set BUILD_VS_LIBDIR="%BLENDER_DIR%..\lib\%BUILD_VS_SVNDIR%"
|
|
||||||
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Library Directory = "%BUILD_VS_LIBDIR%"
|
|
||||||
)
|
|
||||||
if NOT EXIST %BUILD_VS_LIBDIR% (
|
|
||||||
rem libs not found, but svn is on the system
|
|
||||||
echo
|
|
||||||
if not "%SVN%"=="" (
|
|
||||||
echo.
|
|
||||||
echo The required external libraries in %BUILD_VS_LIBDIR% are missing
|
|
||||||
echo.
|
|
||||||
set /p GetLibs= "Would you like to download them? (y/n)"
|
|
||||||
if /I "!GetLibs!"=="Y" (
|
|
||||||
echo.
|
|
||||||
echo Downloading %BUILD_VS_SVNDIR% libraries, please wait.
|
|
||||||
echo.
|
|
||||||
:RETRY
|
|
||||||
"%SVN%" checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/%BUILD_VS_SVNDIR% %BUILD_VS_LIBDIR%
|
|
||||||
if errorlevel 1 (
|
|
||||||
set /p LibRetry= "Error during donwload, retry? y/n"
|
|
||||||
if /I "!LibRetry!"=="Y" (
|
|
||||||
cd %BUILD_VS_LIBDIR%
|
|
||||||
"%SVN%" cleanup
|
|
||||||
cd %BLENDER_DIR%
|
|
||||||
goto RETRY
|
|
||||||
)
|
|
||||||
echo.
|
|
||||||
echo Error: Download of external libraries failed.
|
|
||||||
echo This is needed for building, please manually run 'svn cleanup' and 'svn update' in
|
|
||||||
echo %BUILD_VS_LIBDIR% , until this is resolved you CANNOT make a successful blender build
|
|
||||||
echo.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
if NOT EXIST %BUILD_VS_LIBDIR% (
|
|
||||||
echo.
|
|
||||||
echo Error: Required libraries not found at "%BUILD_VS_LIBDIR%"
|
|
||||||
echo This is needed for building, aborting!
|
|
||||||
echo.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
@@ -1,6 +0,0 @@
|
|||||||
set BLENDER_DIR_NOSPACES=%BLENDER_DIR: =%
|
|
||||||
|
|
||||||
if not "%BLENDER_DIR%"=="%BLENDER_DIR_NOSPACES%" (
|
|
||||||
echo There are spaces detected in the build path "%BLENDER_DIR%", this is currently not supported, exiting....
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
@@ -1,20 +0,0 @@
|
|||||||
if NOT exist "%BLENDER_DIR%/source/tools" (
|
|
||||||
echo Checking out sub-modules
|
|
||||||
if not "%GIT%" == "" (
|
|
||||||
"%GIT%" submodule update --init --recursive --progress
|
|
||||||
if errorlevel 1 goto FAIL
|
|
||||||
"%GIT%" submodule foreach git checkout master
|
|
||||||
if errorlevel 1 goto FAIL
|
|
||||||
"%GIT%" submodule foreach git pull --rebase origin master
|
|
||||||
if errorlevel 1 goto FAIL
|
|
||||||
goto EOF
|
|
||||||
) else (
|
|
||||||
echo Blender submodules not found, and git not found in path to retrieve them.
|
|
||||||
goto FAIL
|
|
||||||
)
|
|
||||||
)
|
|
||||||
goto EOF
|
|
||||||
|
|
||||||
:FAIL
|
|
||||||
exit /b 1
|
|
||||||
:EOF
|
|
@@ -1,74 +0,0 @@
|
|||||||
if "%BUILD_ARCH%"=="x64" (
|
|
||||||
set MSBUILD_PLATFORM=x64
|
|
||||||
) else if "%BUILD_ARCH%"=="x86" (
|
|
||||||
set MSBUILD_PLATFORM=win32
|
|
||||||
if "%WITH_CLANG%"=="1" (
|
|
||||||
echo Clang not supported for X86
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
if "%WITH_CLANG%"=="1" (
|
|
||||||
set CLANG_CMAKE_ARGS=-T"LLVM-vs2017"
|
|
||||||
if "%WITH_ASAN%"=="1" (
|
|
||||||
set ASAN_CMAKE_ARGS=-DWITH_COMPILER_ASAN=On
|
|
||||||
)
|
|
||||||
) else (
|
|
||||||
if "%WITH_ASAN%"=="1" (
|
|
||||||
echo ASAN is only supported with clang.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS%
|
|
||||||
|
|
||||||
if NOT EXIST %BUILD_DIR%\nul (
|
|
||||||
mkdir %BUILD_DIR%
|
|
||||||
)
|
|
||||||
|
|
||||||
if "%MUST_CLEAN%"=="1" (
|
|
||||||
echo Cleaning %BUILD_DIR%
|
|
||||||
msbuild ^
|
|
||||||
%BUILD_DIR%\Blender.sln ^
|
|
||||||
/target:clean ^
|
|
||||||
/property:Configuration=%BUILD_TYPE% ^
|
|
||||||
/verbosity:minimal ^
|
|
||||||
/p:platform=%MSBUILD_PLATFORM%
|
|
||||||
)
|
|
||||||
|
|
||||||
if NOT EXIST %BUILD_DIR%\Blender.sln set MUST_CONFIGURE=1
|
|
||||||
if "%NOBUILD%"=="1" set MUST_CONFIGURE=1
|
|
||||||
|
|
||||||
if "%MUST_CONFIGURE%"=="1" (
|
|
||||||
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo %CMAKE% %BUILD_CMAKE_ARGS% -H%BLENDER_DIR% -B%BUILD_DIR%
|
|
||||||
)
|
|
||||||
|
|
||||||
cmake ^
|
|
||||||
%BUILD_CMAKE_ARGS% ^
|
|
||||||
-H%BLENDER_DIR% ^
|
|
||||||
-B%BUILD_DIR%
|
|
||||||
|
|
||||||
if %ERRORLEVEL% NEQ 0 (
|
|
||||||
echo "Configuration Failed"
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd
|
|
||||||
echo "%CMAKE%" . >> %BUILD_DIR%\rebuild.cmd
|
|
||||||
echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
|
|
||||||
echo msbuild ^
|
|
||||||
%BUILD_DIR%\Blender.sln ^
|
|
||||||
/target:build ^
|
|
||||||
/property:Configuration=%BUILD_TYPE% ^
|
|
||||||
/maxcpucount:2 ^
|
|
||||||
/verbosity:minimal ^
|
|
||||||
/p:platform=%MSBUILD_PLATFORM% ^
|
|
||||||
/flp:Summary;Verbosity=minimal;LogFile=%BUILD_DIR%\Build.log >> %BUILD_DIR%\rebuild.cmd
|
|
||||||
echo msbuild ^
|
|
||||||
%BUILD_DIR%\INSTALL.vcxproj ^
|
|
||||||
/property:Configuration=%BUILD_TYPE% ^
|
|
||||||
/verbosity:minimal ^
|
|
||||||
/p:platform=%MSBUILD_PLATFORM% >> %BUILD_DIR%\rebuild.cmd
|
|
||||||
echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
|
|
@@ -1,80 +0,0 @@
|
|||||||
ninja --version 1>NUL 2>&1
|
|
||||||
if %ERRORLEVEL% NEQ 0 (
|
|
||||||
echo "Ninja not detected in the path"
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Ninja" %TESTS_CMAKE_ARGS% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
|
|
||||||
|
|
||||||
if "%WITH_CLANG%" == "1" (
|
|
||||||
set LLVM_DIR=
|
|
||||||
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM" /ve 2^>nul`) DO set LLVM_DIR=%%C
|
|
||||||
if DEFINED LLVM_DIR (
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo LLVM Detected at "%LLVM_DIR%"
|
|
||||||
)
|
|
||||||
goto DetectionComplete
|
|
||||||
)
|
|
||||||
|
|
||||||
REM Check 32 bits
|
|
||||||
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM" /ve 2^>nul`) DO set LLVM_DIR=%%C
|
|
||||||
if DEFINED LLVM_DIR (
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo LLVM Detected at "%LLVM_DIR%"
|
|
||||||
)
|
|
||||||
goto DetectionComplete
|
|
||||||
)
|
|
||||||
echo LLVM not found
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:DetectionComplete
|
|
||||||
set CC=%LLVM_DIR%\bin\clang-cl
|
|
||||||
set CXX=%LLVM_DIR%\bin\clang-cl
|
|
||||||
rem build and tested against 2017 15.7
|
|
||||||
set CFLAGS=-m64 -fmsc-version=1914
|
|
||||||
set CXXFLAGS=-m64 -fmsc-version=1914
|
|
||||||
if "%WITH_ASAN%"=="1" (
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_COMPILER_ASAN=On
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
if "%WITH_ASAN%"=="1" (
|
|
||||||
if "%WITH_CLANG%" == "" (
|
|
||||||
echo ASAN is only supported with clang.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS%
|
|
||||||
)
|
|
||||||
|
|
||||||
if NOT EXIST %BUILD_DIR%\nul (
|
|
||||||
mkdir %BUILD_DIR%
|
|
||||||
)
|
|
||||||
|
|
||||||
if "%MUST_CLEAN%"=="1" (
|
|
||||||
echo Cleaning %BUILD_DIR%
|
|
||||||
cd %BUILD_DIR%
|
|
||||||
%CMAKE% cmake --build . --config Clean
|
|
||||||
)
|
|
||||||
|
|
||||||
if NOT EXIST %BUILD_DIR%\Blender.sln set MUST_CONFIGURE=1
|
|
||||||
if "%NOBUILD%"=="1" set MUST_CONFIGURE=1
|
|
||||||
|
|
||||||
if "%MUST_CONFIGURE%"=="1" (
|
|
||||||
cmake ^
|
|
||||||
%BUILD_CMAKE_ARGS% ^
|
|
||||||
-H%BLENDER_DIR% ^
|
|
||||||
-B%BUILD_DIR%
|
|
||||||
|
|
||||||
if %ERRORLEVEL% NEQ 0 (
|
|
||||||
echo "Configuration Failed"
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd
|
|
||||||
echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
|
|
||||||
echo ninja install >> %BUILD_DIR%\rebuild.cmd
|
|
||||||
echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
|
|
@@ -1,16 +0,0 @@
|
|||||||
if "%BUILD_ARCH%"=="" (
|
|
||||||
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
|
|
||||||
set WINDOWS_ARCH= Win64
|
|
||||||
set BUILD_ARCH=x64
|
|
||||||
) else if "%PROCESSOR_ARCHITEW6432%" == "AMD64" (
|
|
||||||
set WINDOWS_ARCH= Win64
|
|
||||||
set BUILD_ARCH=x64
|
|
||||||
) else (
|
|
||||||
set WINDOWS_ARCH=
|
|
||||||
set BUILD_ARCH=x86
|
|
||||||
)
|
|
||||||
) else if "%BUILD_ARCH%"=="x64" (
|
|
||||||
set WINDOWS_ARCH= Win64
|
|
||||||
) else if "%BUILD_ARCH%"=="x86" (
|
|
||||||
set WINDOWS_ARCH=
|
|
||||||
)
|
|
@@ -1,3 +0,0 @@
|
|||||||
set BUILD_VS_VER=14
|
|
||||||
set BUILD_VS_YEAR=2015
|
|
||||||
call "%~dp0\detect_msvc_classic.cmd"
|
|
@@ -1,76 +0,0 @@
|
|||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Detecting msvc 2017
|
|
||||||
)
|
|
||||||
set BUILD_VS_VER=15
|
|
||||||
set BUILD_VS_YEAR=2017
|
|
||||||
set ProgramFilesX86=%ProgramFiles(x86)%
|
|
||||||
if not exist "%ProgramFilesX86%" set ProgramFilesX86=%ProgramFiles%
|
|
||||||
|
|
||||||
set vs_where=%ProgramFilesX86%\Microsoft Visual Studio\Installer\vswhere.exe
|
|
||||||
if not exist "%vs_where%" (
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio 2017 ^(15.2 or newer^) is not detected
|
|
||||||
)
|
|
||||||
goto FAIL
|
|
||||||
)
|
|
||||||
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo "%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`
|
|
||||||
)
|
|
||||||
|
|
||||||
for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do (
|
|
||||||
if /i "%%i"=="installationPath" set VS_InstallDir=%%j
|
|
||||||
)
|
|
||||||
|
|
||||||
if "%VS_InstallDir%"=="" (
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio is detected but the "Desktop development with C++" workload has not been instlled
|
|
||||||
goto FAIL
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
set VCVARS=%VS_InstallDir%\VC\Auxiliary\Build\vcvarsall.bat
|
|
||||||
if exist "%VCVARS%" (
|
|
||||||
call "%VCVARS%" %BUILD_ARCH%
|
|
||||||
) else (
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo "%VCVARS%" not found
|
|
||||||
)
|
|
||||||
goto FAIL
|
|
||||||
)
|
|
||||||
|
|
||||||
rem try msbuild
|
|
||||||
msbuild /version > NUL
|
|
||||||
if errorlevel 1 (
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio %BUILD_VS_YEAR% msbuild not found
|
|
||||||
)
|
|
||||||
goto FAIL
|
|
||||||
)
|
|
||||||
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio %BUILD_VS_YEAR% msbuild found
|
|
||||||
)
|
|
||||||
|
|
||||||
REM try the c++ compiler
|
|
||||||
cl 2> NUL 1>&2
|
|
||||||
if errorlevel 1 (
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found
|
|
||||||
)
|
|
||||||
goto FAIL
|
|
||||||
)
|
|
||||||
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found
|
|
||||||
)
|
|
||||||
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio 2017 is detected successfully
|
|
||||||
)
|
|
||||||
goto EOF
|
|
||||||
|
|
||||||
:FAIL
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:EOF
|
|
@@ -1,69 +0,0 @@
|
|||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Detecting msvc %BUILD_VS_YEAR%
|
|
||||||
)
|
|
||||||
set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%BUILD_VS_VER%.0\Setup\VC"
|
|
||||||
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v ProductDir 2^>nul`) DO set MSVC_VC_DIR=%%C
|
|
||||||
if DEFINED MSVC_VC_DIR (
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio %BUILD_VS_YEAR% on Win64 detected at "%MSVC_VC_DIR%"
|
|
||||||
)
|
|
||||||
goto msvc_detect_finally
|
|
||||||
)
|
|
||||||
|
|
||||||
REM Check 32 bits
|
|
||||||
set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\%BUILD_VS_VER%.0\Setup\VC"
|
|
||||||
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v ProductDir 2^>nul`) DO set MSVC_VC_DIR=%%C
|
|
||||||
if DEFINED MSVC_VC_DIR (
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio %BUILD_VS_YEAR% on Win32 detected at "%MSVC_VC_DIR%"
|
|
||||||
)
|
|
||||||
goto msvc_detect_finally
|
|
||||||
)
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio %BUILD_VS_YEAR% not found.
|
|
||||||
)
|
|
||||||
goto FAIL
|
|
||||||
:msvc_detect_finally
|
|
||||||
set VCVARS=%MSVC_VC_DIR%\vcvarsall.bat
|
|
||||||
if not exist "%VCVARS%" (
|
|
||||||
echo "%VCVARS%" not found.
|
|
||||||
goto FAIL
|
|
||||||
)
|
|
||||||
|
|
||||||
call "%vcvars%" %BUILD_ARCH%
|
|
||||||
|
|
||||||
rem try msbuild
|
|
||||||
msbuild /version > NUL
|
|
||||||
if errorlevel 1 (
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio %BUILD_VS_YEAR% msbuild not found
|
|
||||||
)
|
|
||||||
goto FAIL
|
|
||||||
)
|
|
||||||
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio %BUILD_VS_YEAR% msbuild found
|
|
||||||
)
|
|
||||||
|
|
||||||
REM try the c++ compiler
|
|
||||||
cl 2> NUL 1>&2
|
|
||||||
if errorlevel 1 (
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found
|
|
||||||
)
|
|
||||||
goto FAIL
|
|
||||||
)
|
|
||||||
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found
|
|
||||||
)
|
|
||||||
goto DetectionComplete
|
|
||||||
|
|
||||||
:FAIL
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:DetectionComplete
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo Visual Studio %BUILD_VS_YEAR% Detected successfuly
|
|
||||||
)
|
|
||||||
exit /b 0
|
|
@@ -1,13 +0,0 @@
|
|||||||
REM find all dependencies and set the corresponding environement variables.
|
|
||||||
for %%X in (svn.exe) do (set SVN=%%~$PATH:X)
|
|
||||||
for %%X in (cmake.exe) do (set CMAKE=%%~$PATH:X)
|
|
||||||
for %%X in (git.exe) do (set GIT=%%~$PATH:X)
|
|
||||||
if NOT "%verbose%" == "" (
|
|
||||||
echo svn : %SVN%
|
|
||||||
echo cmake : %CMAKE%
|
|
||||||
echo git : %GIT%
|
|
||||||
)
|
|
||||||
if "%CMAKE%" == "" (
|
|
||||||
echo Cmake not found in path, required for building, exiting...
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
@@ -1,86 +0,0 @@
|
|||||||
set BUILD_DIR=%BLENDER_DIR%..\build_windows
|
|
||||||
set BUILD_TYPE=Release
|
|
||||||
:argv_loop
|
|
||||||
if NOT "%1" == "" (
|
|
||||||
|
|
||||||
REM Help Message
|
|
||||||
if "%1" == "help" (
|
|
||||||
set SHOW_HELP=1
|
|
||||||
goto EOF
|
|
||||||
)
|
|
||||||
REM Build Types
|
|
||||||
if "%1" == "debug" (
|
|
||||||
set BUILD_TYPE=Debug
|
|
||||||
REM Build Configurations
|
|
||||||
) else if "%1" == "noge" (
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_GAMEENGINE=OFF -DWITH_PLAYER=OFF
|
|
||||||
set BUILD_NGE=_noge
|
|
||||||
) else if "%1" == "builddir" (
|
|
||||||
set BUILD_DIR_OVERRRIDE="%BLENDER_DIR%..\%2"
|
|
||||||
shift /1
|
|
||||||
) else if "%1" == "with_tests" (
|
|
||||||
set TESTS_CMAKE_ARGS=-DWITH_GTESTS=On
|
|
||||||
) else if "%1" == "full" (
|
|
||||||
set TARGET=Full
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^
|
|
||||||
-C"%BLENDER_DIR%\build_files\cmake\config\blender_full.cmake"
|
|
||||||
) else if "%1" == "lite" (
|
|
||||||
set TARGET=Lite
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_lite.cmake"
|
|
||||||
) else if "%1" == "cycles" (
|
|
||||||
set TARGET=Cycles
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\cycles_standalone.cmake"
|
|
||||||
) else if "%1" == "headless" (
|
|
||||||
set TARGET=Headless
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_headless.cmake"
|
|
||||||
) else if "%1" == "bpy" (
|
|
||||||
set TARGET=Bpy
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\bpy_module.cmake"
|
|
||||||
) else if "%1" == "clang" (
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS%
|
|
||||||
set WITH_CLANG=1
|
|
||||||
) else if "%1" == "release" (
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_release.cmake"
|
|
||||||
set TARGET=Release
|
|
||||||
) else if "%1" == "asan" (
|
|
||||||
set WITH_ASAN=1
|
|
||||||
) else if "%1" == "x86" (
|
|
||||||
set BUILD_ARCH=x86
|
|
||||||
) else if "%1" == "x64" (
|
|
||||||
set BUILD_ARCH=x64
|
|
||||||
) else if "%1" == "2017" (
|
|
||||||
set BUILD_VS_YEAR=2017
|
|
||||||
) else if "%1" == "2017pre" (
|
|
||||||
set BUILD_VS_YEAR=2017
|
|
||||||
set VSWHERE_ARGS=-prerelease
|
|
||||||
set BUILD_VS_YEAR=2017
|
|
||||||
) else if "%1" == "2017b" (
|
|
||||||
set BUILD_VS_YEAR=2017
|
|
||||||
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
|
|
||||||
) else if "%1" == "2015" (
|
|
||||||
set BUILD_VS_YEAR=2015
|
|
||||||
) else if "%1" == "packagename" (
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DCPACK_OVERRIDE_PACKAGENAME="%2"
|
|
||||||
shift /1
|
|
||||||
) else if "%1" == "nobuild" (
|
|
||||||
set NOBUILD=1
|
|
||||||
) else if "%1" == "showhash" (
|
|
||||||
SET BUILD_SHOW_HASHES=1
|
|
||||||
REM Non-Build Commands
|
|
||||||
) else if "%1" == "update" (
|
|
||||||
SET BUILD_UPDATE=1
|
|
||||||
) else if "%1" == "ninja" (
|
|
||||||
SET BUILD_WITH_NINJA=1
|
|
||||||
) else if "%1" == "clean" (
|
|
||||||
set MUST_CLEAN=1
|
|
||||||
) else if "%1" == "verbose" (
|
|
||||||
set VERBOSE=1
|
|
||||||
) else (
|
|
||||||
echo Command "%1" unknown, aborting!
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
shift /1
|
|
||||||
goto argv_loop
|
|
||||||
)
|
|
||||||
:EOF
|
|
||||||
exit /b 0
|
|
@@ -1,27 +0,0 @@
|
|||||||
rem reset all variables so they do not get accidentally get carried over from previous builds
|
|
||||||
set BUILD_DIR_OVERRRIDE=
|
|
||||||
set BUILD_CMAKE_ARGS=
|
|
||||||
set BUILD_ARCH=
|
|
||||||
set BUILD_VS_VER=
|
|
||||||
set BUILD_VS_YEAR=
|
|
||||||
set BUILD_VS_LIBDIRPOST=
|
|
||||||
set BUILD_VS_LIBDIR=
|
|
||||||
set BUILD_VS_SVNDIR=
|
|
||||||
set BUILD_NGE=
|
|
||||||
set KEY_NAME=
|
|
||||||
set MSBUILD_PLATFORM=
|
|
||||||
set MUST_CLEAN=
|
|
||||||
set NOBUILD=
|
|
||||||
set TARGET=
|
|
||||||
set VERBOSE=
|
|
||||||
set WINDOWS_ARCH=
|
|
||||||
set TESTS_CMAKE_ARGS=
|
|
||||||
set VSWHERE_ARGS=
|
|
||||||
set BUILD_UPDATE=
|
|
||||||
set BUILD_SHOW_HASHES=
|
|
||||||
set SHOW_HELP=
|
|
||||||
set BUILD_WITH_NINJA=
|
|
||||||
set WITH_CLANG=
|
|
||||||
set WITH_ASAN=
|
|
||||||
set CLANG_CMAKE_ARGS=
|
|
||||||
set ASAN_CMAKE_ARGS=
|
|
@@ -1,4 +0,0 @@
|
|||||||
set BUILD_DIR=%BUILD_DIR%_%TARGET%%BUILD_NGE%_%BUILD_ARCH%_vc%BUILD_VS_VER%_%BUILD_TYPE%
|
|
||||||
if NOT "%BUILD_DIR_OVERRRIDE%"=="" (
|
|
||||||
set BUILD_DIR=%BUILD_DIR_OVERRRIDE%
|
|
||||||
)
|
|
@@ -1,12 +0,0 @@
|
|||||||
if "%GIT%" == "" (
|
|
||||||
echo Git not found, cannot show hashes.
|
|
||||||
goto EOF
|
|
||||||
)
|
|
||||||
cd "%BLENDER_DIR%"
|
|
||||||
for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Branch_hash=%%i
|
|
||||||
cd "%BLENDER_DIR%/release/datafiles/locale"
|
|
||||||
for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Locale_hash=%%i
|
|
||||||
cd "%BLENDER_DIR%/release/scripts/addons"
|
|
||||||
for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Addons_Hash=%%i
|
|
||||||
cd "%BLENDER_DIR%"
|
|
||||||
:EOF
|
|
@@ -1,35 +0,0 @@
|
|||||||
echo.
|
|
||||||
echo Convenience targets
|
|
||||||
echo - release ^(identical to the official blender.org builds^)
|
|
||||||
echo - full ^(same as release minus the cuda kernels^)
|
|
||||||
echo - lite
|
|
||||||
echo - headless
|
|
||||||
echo - cycles
|
|
||||||
echo - bpy
|
|
||||||
echo.
|
|
||||||
echo Utilities ^(not associated with building^)
|
|
||||||
echo - clean ^(Target must be set^)
|
|
||||||
echo - update
|
|
||||||
echo - nobuild ^(only generate project files^)
|
|
||||||
echo - showhash ^(Show git hashes of source tree^)
|
|
||||||
echo.
|
|
||||||
echo Configuration options
|
|
||||||
echo - verbose ^(enable diagnostic output during configuration^)
|
|
||||||
echo - with_tests ^(enable building unit tests^)
|
|
||||||
echo - noge ^(disable building game enginge and player^)
|
|
||||||
echo - debug ^(Build an unoptimized debuggable build^)
|
|
||||||
echo - packagename [newname] ^(override default cpack package name^)
|
|
||||||
echo - buildir [newdir] ^(override default build folder^)
|
|
||||||
echo - x86 ^(override host auto-detect and build 32 bit code^)
|
|
||||||
echo - x64 ^(override host auto-detect and build 64 bit code^)
|
|
||||||
echo - 2017 ^(build with visual studio 2017^)
|
|
||||||
echo - 2017pre ^(build with visual studio 2017 pre-release^)
|
|
||||||
echo - 2017b ^(build with visual studio 2017 Build Tools^)
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Experimental options
|
|
||||||
echo - 2015 ^(build with visual studio 2015^)
|
|
||||||
echo - clang ^(enable building with clang^)
|
|
||||||
echo - asan ^(enable asan when building with clang^)
|
|
||||||
echo - ninja ^(enable building with ninja instead of msbuild^)
|
|
||||||
echo.
|
|
@@ -1,16 +0,0 @@
|
|||||||
if "%SVN%" == "" (
|
|
||||||
echo svn not found, cannot update libraries
|
|
||||||
goto UPDATE_GIT
|
|
||||||
)
|
|
||||||
"%SVN%" up "%BLENDER_DIR%/../lib/*"
|
|
||||||
|
|
||||||
:UPDATE_GIT
|
|
||||||
|
|
||||||
if "%GIT%" == "" (
|
|
||||||
echo Git not found, cannot update code
|
|
||||||
goto EOF
|
|
||||||
)
|
|
||||||
"%GIT%" pull --rebase
|
|
||||||
"%GIT%" submodule foreach git pull --rebase origin master
|
|
||||||
|
|
||||||
:EOF
|
|
@@ -76,7 +76,7 @@ class DNACatalogHTML:
|
|||||||
DNACatalog is a catalog of all information in the DNA1 file-block
|
DNACatalog is a catalog of all information in the DNA1 file-block
|
||||||
'''
|
'''
|
||||||
|
|
||||||
def __init__(self, catalog, bpy_module=None):
|
def __init__(self, catalog, bpy_module = None):
|
||||||
self.Catalog = catalog
|
self.Catalog = catalog
|
||||||
self.bpy = bpy_module
|
self.bpy = bpy_module
|
||||||
|
|
||||||
@@ -125,9 +125,9 @@ class DNACatalogHTML:
|
|||||||
|
|
||||||
# ${endianness}
|
# ${endianness}
|
||||||
if header.LittleEndianness:
|
if header.LittleEndianness:
|
||||||
endianess = 'Little endianness'
|
endianess= 'Little endianness'
|
||||||
else:
|
else:
|
||||||
endianess = 'Big endianness'
|
endianess= 'Big endianness'
|
||||||
|
|
||||||
# ${structs_list}
|
# ${structs_list}
|
||||||
log.debug("Creating structs index")
|
log.debug("Creating structs index")
|
||||||
@@ -136,7 +136,7 @@ class DNACatalogHTML:
|
|||||||
structureIndex = 0
|
structureIndex = 0
|
||||||
for structure in self.Catalog.Structs:
|
for structure in self.Catalog.Structs:
|
||||||
structs_list += list_item.format(structureIndex, structure.Type.Name)
|
structs_list += list_item.format(structureIndex, structure.Type.Name)
|
||||||
structureIndex += 1
|
structureIndex+=1
|
||||||
|
|
||||||
# ${structs_content}
|
# ${structs_content}
|
||||||
log.debug("Creating structs content")
|
log.debug("Creating structs content")
|
||||||
@@ -146,12 +146,12 @@ class DNACatalogHTML:
|
|||||||
structs_content += self.Structure(structure)
|
structs_content += self.Structure(structure)
|
||||||
|
|
||||||
d = dict(
|
d = dict(
|
||||||
version=version,
|
version = version,
|
||||||
revision=revision,
|
revision = revision,
|
||||||
bitness=bitness,
|
bitness = bitness,
|
||||||
endianness=endianess,
|
endianness = endianess,
|
||||||
structs_list=structs_list,
|
structs_list = structs_list,
|
||||||
structs_content=structs_content
|
structs_content = structs_content
|
||||||
)
|
)
|
||||||
|
|
||||||
dna_html = Template(dna_html_template).substitute(d)
|
dna_html = Template(dna_html_template).substitute(d)
|
||||||
@@ -180,9 +180,9 @@ class DNACatalogHTML:
|
|||||||
<label>(<a href="#top">top</a>)</label><br/>"""
|
<label>(<a href="#top">top</a>)</label><br/>"""
|
||||||
|
|
||||||
d = dict(
|
d = dict(
|
||||||
struct_name=structure.Type.Name,
|
struct_name = structure.Type.Name,
|
||||||
fields=self.StructureFields(structure, None, 0),
|
fields = self.StructureFields(structure, None, 0),
|
||||||
size=str(structure.Type.Size)
|
size = str(structure.Type.Size)
|
||||||
)
|
)
|
||||||
|
|
||||||
struct_table = Template(struct_table_template).substitute(d)
|
struct_table = Template(struct_table_template).substitute(d)
|
||||||
@@ -230,12 +230,12 @@ class DNACatalogHTML:
|
|||||||
size = field.Size(self.Catalog.Header)
|
size = field.Size(self.Catalog.Header)
|
||||||
|
|
||||||
d = dict(
|
d = dict(
|
||||||
reference=reference,
|
reference = reference,
|
||||||
struct=struct,
|
struct = struct,
|
||||||
type=type,
|
type = type,
|
||||||
name=name,
|
name = name,
|
||||||
offset=offset,
|
offset = offset,
|
||||||
size=size
|
size = size
|
||||||
)
|
)
|
||||||
|
|
||||||
structure_field = Template(structure_field_template).substitute(d)
|
structure_field = Template(structure_field_template).substitute(d)
|
||||||
@@ -246,7 +246,7 @@ class DNACatalogHTML:
|
|||||||
|
|
||||||
return structure_field
|
return structure_field
|
||||||
|
|
||||||
def indent(self, input, dent, startswith=''):
|
def indent(self, input, dent, startswith = ''):
|
||||||
output = ''
|
output = ''
|
||||||
if dent < 0:
|
if dent < 0:
|
||||||
for line in input.split('\n'):
|
for line in input.split('\n'):
|
||||||
@@ -257,19 +257,19 @@ class DNACatalogHTML:
|
|||||||
output += line.lstrip() + '\n' # remove indentation completely
|
output += line.lstrip() + '\n' # remove indentation completely
|
||||||
elif dent > 0:
|
elif dent > 0:
|
||||||
for line in input.split('\n'):
|
for line in input.split('\n'):
|
||||||
output += ' ' * dent + line + '\n'
|
output += ' '* dent + line + '\n'
|
||||||
return output
|
return output
|
||||||
|
|
||||||
def format(self, input):
|
def format(self, input):
|
||||||
diff = {
|
diff = {
|
||||||
'\n<!DOCTYPE': '<!DOCTYPE',
|
'\n<!DOCTYPE':'<!DOCTYPE',
|
||||||
'\n</ul>': '</ul>',
|
'\n</ul>' :'</ul>',
|
||||||
'<a name': '\n<a name',
|
'<a name' :'\n<a name',
|
||||||
'<tr>\n': '<tr>',
|
'<tr>\n' :'<tr>',
|
||||||
'<tr>': ' <tr>',
|
'<tr>' :' <tr>',
|
||||||
'</th>\n': '</th>',
|
'</th>\n' :'</th>',
|
||||||
'</td>\n': '</td>',
|
'</td>\n' :'</td>',
|
||||||
'<tbody>\n': '<tbody>'
|
'<tbody>\n' :'<tbody>'
|
||||||
}
|
}
|
||||||
output = self.indent(input, 0)
|
output = self.indent(input, 0)
|
||||||
for key, value in diff.items():
|
for key, value in diff.items():
|
||||||
@@ -408,16 +408,16 @@ def main():
|
|||||||
else:
|
else:
|
||||||
filename = 'dna'
|
filename = 'dna'
|
||||||
dir = os.path.dirname(__file__)
|
dir = os.path.dirname(__file__)
|
||||||
Path_Blend = os.path.join(dir, filename + '.blend') # temporary blend file
|
Path_Blend = os.path.join(dir, filename + '.blend') # temporary blend file
|
||||||
Path_HTML = os.path.join(dir, filename + '.html') # output html file
|
Path_HTML = os.path.join(dir, filename + '.html') # output html file
|
||||||
Path_CSS = os.path.join(dir, 'dna.css') # output css file
|
Path_CSS = os.path.join(dir, 'dna.css') # output css file
|
||||||
|
|
||||||
# create a blend file for dna parsing
|
# create a blend file for dna parsing
|
||||||
if not os.path.exists(Path_Blend):
|
if not os.path.exists(Path_Blend):
|
||||||
log.info("1: write temp blend file with SDNA info")
|
log.info("1: write temp blend file with SDNA info")
|
||||||
log.info(" saving to: " + Path_Blend)
|
log.info(" saving to: " + Path_Blend)
|
||||||
try:
|
try:
|
||||||
bpy.ops.wm.save_as_mainfile(filepath=Path_Blend, copy=True, compress=False)
|
bpy.ops.wm.save_as_mainfile(filepath = Path_Blend, copy = True, compress = False)
|
||||||
except:
|
except:
|
||||||
log.error("Filename {0} does not exist and can't be created... quitting".format(Path_Blend))
|
log.error("Filename {0} does not exist and can't be created... quitting".format(Path_Blend))
|
||||||
return
|
return
|
||||||
|
@@ -34,7 +34,6 @@ log = logging.getLogger("BlendFileReader")
|
|||||||
# module global routines
|
# module global routines
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
|
|
||||||
def ReadString(handle, length):
|
def ReadString(handle, length):
|
||||||
'''
|
'''
|
||||||
ReadString reads a String of given length or a zero terminating String
|
ReadString reads a String of given length or a zero terminating String
|
||||||
@@ -46,7 +45,7 @@ def ReadString(handle, length):
|
|||||||
# length == 0 means we want a zero terminating string
|
# length == 0 means we want a zero terminating string
|
||||||
result = ""
|
result = ""
|
||||||
s = ReadString(handle, 1)
|
s = ReadString(handle, 1)
|
||||||
while s != "\0":
|
while s!="\0":
|
||||||
result += s
|
result += s
|
||||||
s = ReadString(handle, 1)
|
s = ReadString(handle, 1)
|
||||||
return result
|
return result
|
||||||
@@ -95,10 +94,10 @@ def openBlendFile(filename):
|
|||||||
log.debug("decompressing started")
|
log.debug("decompressing started")
|
||||||
fs = gzip.open(filename, "rb")
|
fs = gzip.open(filename, "rb")
|
||||||
handle = tempfile.TemporaryFile()
|
handle = tempfile.TemporaryFile()
|
||||||
data = fs.read(1024 * 1024)
|
data = fs.read(1024*1024)
|
||||||
while data:
|
while data:
|
||||||
handle.write(data)
|
handle.write(data)
|
||||||
data = fs.read(1024 * 1024)
|
data = fs.read(1024*1024)
|
||||||
log.debug("decompressing finished")
|
log.debug("decompressing finished")
|
||||||
fs.close()
|
fs.close()
|
||||||
log.debug("resetting decompressed file")
|
log.debug("resetting decompressed file")
|
||||||
@@ -113,7 +112,7 @@ def Align(handle):
|
|||||||
offset = handle.tell()
|
offset = handle.tell()
|
||||||
trim = offset % 4
|
trim = offset % 4
|
||||||
if trim != 0:
|
if trim != 0:
|
||||||
handle.seek(4 - trim, os.SEEK_CUR)
|
handle.seek(4-trim, os.SEEK_CUR)
|
||||||
|
|
||||||
|
|
||||||
######################################################
|
######################################################
|
||||||
@@ -267,9 +266,9 @@ class DNACatalog:
|
|||||||
|
|
||||||
def __init__(self, fileheader, handle):
|
def __init__(self, fileheader, handle):
|
||||||
log.debug("building DNA catalog")
|
log.debug("building DNA catalog")
|
||||||
self.Names = []
|
self.Names=[]
|
||||||
self.Types = []
|
self.Types=[]
|
||||||
self.Structs = []
|
self.Structs=[]
|
||||||
self.Header = fileheader
|
self.Header = fileheader
|
||||||
|
|
||||||
SDNA = ReadString(handle, 4)
|
SDNA = ReadString(handle, 4)
|
||||||
@@ -279,7 +278,7 @@ class DNACatalog:
|
|||||||
numberOfNames = Read('uint', handle, fileheader)
|
numberOfNames = Read('uint', handle, fileheader)
|
||||||
log.debug("building #{0} names".format(numberOfNames))
|
log.debug("building #{0} names".format(numberOfNames))
|
||||||
for i in range(numberOfNames):
|
for i in range(numberOfNames):
|
||||||
name = ReadString(handle, 0)
|
name = ReadString(handle,0)
|
||||||
self.Names.append(DNAName(name))
|
self.Names.append(DNAName(name))
|
||||||
Align(handle)
|
Align(handle)
|
||||||
|
|
||||||
@@ -288,7 +287,7 @@ class DNACatalog:
|
|||||||
numberOfTypes = Read('uint', handle, fileheader)
|
numberOfTypes = Read('uint', handle, fileheader)
|
||||||
log.debug("building #{0} types".format(numberOfTypes))
|
log.debug("building #{0} types".format(numberOfTypes))
|
||||||
for i in range(numberOfTypes):
|
for i in range(numberOfTypes):
|
||||||
type = ReadString(handle, 0)
|
type = ReadString(handle,0)
|
||||||
self.Types.append(DNAType(type))
|
self.Types.append(DNAType(type))
|
||||||
Align(handle)
|
Align(handle)
|
||||||
|
|
||||||
@@ -333,13 +332,13 @@ class DNAName:
|
|||||||
if parent is None:
|
if parent is None:
|
||||||
result = ""
|
result = ""
|
||||||
else:
|
else:
|
||||||
result = parent + "."
|
result = parent+"."
|
||||||
|
|
||||||
result = result + self.ShortName()
|
result = result + self.ShortName()
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def ShortName(self):
|
def ShortName(self):
|
||||||
result = self.Name
|
result = self.Name;
|
||||||
result = result.replace("*", "")
|
result = result.replace("*", "")
|
||||||
result = result.replace("(", "")
|
result = result.replace("(", "")
|
||||||
result = result.replace(")", "")
|
result = result.replace(")", "")
|
||||||
@@ -349,10 +348,10 @@ class DNAName:
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def IsPointer(self):
|
def IsPointer(self):
|
||||||
return self.Name.find("*") > -1
|
return self.Name.find("*")>-1
|
||||||
|
|
||||||
def IsMethodPointer(self):
|
def IsMethodPointer(self):
|
||||||
return self.Name.find("(*") > -1
|
return self.Name.find("(*")>-1
|
||||||
|
|
||||||
def ArraySize(self):
|
def ArraySize(self):
|
||||||
result = 1
|
result = 1
|
||||||
@@ -361,8 +360,8 @@ class DNAName:
|
|||||||
|
|
||||||
while Index != -1:
|
while Index != -1:
|
||||||
Index2 = Temp.find("]")
|
Index2 = Temp.find("]")
|
||||||
result *= int(Temp[Index + 1:Index2])
|
result*=int(Temp[Index+1:Index2])
|
||||||
Temp = Temp[Index2 + 1:]
|
Temp = Temp[Index2+1:]
|
||||||
Index = Temp.find("[")
|
Index = Temp.find("[")
|
||||||
|
|
||||||
return result
|
return result
|
||||||
@@ -379,7 +378,7 @@ class DNAType:
|
|||||||
|
|
||||||
def __init__(self, aName):
|
def __init__(self, aName):
|
||||||
self.Name = aName
|
self.Name = aName
|
||||||
self.Structure = None
|
self.Structure=None
|
||||||
|
|
||||||
|
|
||||||
class DNAStructure:
|
class DNAStructure:
|
||||||
@@ -393,22 +392,22 @@ class DNAStructure:
|
|||||||
def __init__(self, aType):
|
def __init__(self, aType):
|
||||||
self.Type = aType
|
self.Type = aType
|
||||||
self.Type.Structure = self
|
self.Type.Structure = self
|
||||||
self.Fields = []
|
self.Fields=[]
|
||||||
|
|
||||||
def GetField(self, header, handle, path):
|
def GetField(self, header, handle, path):
|
||||||
splitted = path.partition(".")
|
splitted = path.partition(".")
|
||||||
name = splitted[0]
|
name = splitted[0]
|
||||||
rest = splitted[2]
|
rest = splitted[2]
|
||||||
offset = 0
|
offset = 0;
|
||||||
for field in self.Fields:
|
for field in self.Fields:
|
||||||
if field.Name.ShortName() == name:
|
if field.Name.ShortName() == name:
|
||||||
log.debug("found " + name + "@" + str(offset))
|
log.debug("found "+name+"@"+str(offset))
|
||||||
handle.seek(offset, os.SEEK_CUR)
|
handle.seek(offset, os.SEEK_CUR)
|
||||||
return field.DecodeField(header, handle, rest)
|
return field.DecodeField(header, handle, rest)
|
||||||
else:
|
else:
|
||||||
offset += field.Size(header)
|
offset += field.Size(header)
|
||||||
|
|
||||||
log.debug("error did not find " + path)
|
log.debug("error did not find "+path)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
@@ -426,21 +425,22 @@ class DNAField:
|
|||||||
|
|
||||||
def Size(self, header):
|
def Size(self, header):
|
||||||
if self.Name.IsPointer() or self.Name.IsMethodPointer():
|
if self.Name.IsPointer() or self.Name.IsMethodPointer():
|
||||||
return header.PointerSize * self.Name.ArraySize()
|
return header.PointerSize*self.Name.ArraySize()
|
||||||
else:
|
else:
|
||||||
return self.Type.Size * self.Name.ArraySize()
|
return self.Type.Size*self.Name.ArraySize()
|
||||||
|
|
||||||
def DecodeField(self, header, handle, path):
|
def DecodeField(self, header, handle, path):
|
||||||
if path == "":
|
if path == "":
|
||||||
if self.Name.IsPointer():
|
if self.Name.IsPointer():
|
||||||
return Read('pointer', handle, header)
|
return Read('pointer', handle, header)
|
||||||
if self.Type.Name == "int":
|
if self.Type.Name=="int":
|
||||||
return Read('int', handle, header)
|
return Read('int', handle, header)
|
||||||
if self.Type.Name == "short":
|
if self.Type.Name=="short":
|
||||||
return Read('short', handle, header)
|
return Read('short', handle, header)
|
||||||
if self.Type.Name == "float":
|
if self.Type.Name=="float":
|
||||||
return Read('float', handle, header)
|
return Read('float', handle, header)
|
||||||
if self.Type.Name == "char":
|
if self.Type.Name=="char":
|
||||||
return ReadString(handle, self.Name.ArraySize())
|
return ReadString(handle, self.Name.ArraySize())
|
||||||
else:
|
else:
|
||||||
return self.Type.Structure.GetField(header, handle, path)
|
return self.Type.Structure.GetField(header, handle, path)
|
||||||
|
|
||||||
|
@@ -42,7 +42,6 @@ def man_format(data):
|
|||||||
data = data.replace("\t", " ")
|
data = data.replace("\t", " ")
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
if len(sys.argv) != 3:
|
if len(sys.argv) != 3:
|
||||||
import getopt
|
import getopt
|
||||||
raise getopt.GetoptError("Usage: %s <path-to-blender> <output-filename>" % sys.argv[0])
|
raise getopt.GetoptError("Usage: %s <path-to-blender> <output-filename>" % sys.argv[0])
|
||||||
|
@@ -15,7 +15,6 @@ font_info = {
|
|||||||
"handler": None,
|
"handler": None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
"""init function - runs once"""
|
"""init function - runs once"""
|
||||||
import os
|
import os
|
||||||
|
@@ -10,22 +10,22 @@ bm = bmesh.new()
|
|||||||
|
|
||||||
# Add a circle XXX, should return all geometry created, not just verts.
|
# Add a circle XXX, should return all geometry created, not just verts.
|
||||||
bmesh.ops.create_circle(
|
bmesh.ops.create_circle(
|
||||||
bm,
|
bm,
|
||||||
cap_ends=False,
|
cap_ends=False,
|
||||||
radius=0.2,
|
radius=0.2,
|
||||||
segments=8)
|
segments=8)
|
||||||
|
|
||||||
|
|
||||||
# Spin and deal with geometry on side 'a'
|
# Spin and deal with geometry on side 'a'
|
||||||
edges_start_a = bm.edges[:]
|
edges_start_a = bm.edges[:]
|
||||||
geom_start_a = bm.verts[:] + edges_start_a
|
geom_start_a = bm.verts[:] + edges_start_a
|
||||||
ret = bmesh.ops.spin(
|
ret = bmesh.ops.spin(
|
||||||
bm,
|
bm,
|
||||||
geom=geom_start_a,
|
geom=geom_start_a,
|
||||||
angle=math.radians(180.0),
|
angle=math.radians(180.0),
|
||||||
steps=8,
|
steps=8,
|
||||||
axis=(1.0, 0.0, 0.0),
|
axis=(1.0, 0.0, 0.0),
|
||||||
cent=(0.0, 1.0, 0.0))
|
cent=(0.0, 1.0, 0.0))
|
||||||
edges_end_a = [ele for ele in ret["geom_last"]
|
edges_end_a = [ele for ele in ret["geom_last"]
|
||||||
if isinstance(ele, bmesh.types.BMEdge)]
|
if isinstance(ele, bmesh.types.BMEdge)]
|
||||||
del ret
|
del ret
|
||||||
@@ -33,8 +33,8 @@ del ret
|
|||||||
|
|
||||||
# Extrude and create geometry on side 'b'
|
# Extrude and create geometry on side 'b'
|
||||||
ret = bmesh.ops.extrude_edge_only(
|
ret = bmesh.ops.extrude_edge_only(
|
||||||
bm,
|
bm,
|
||||||
edges=edges_start_a)
|
edges=edges_start_a)
|
||||||
geom_extrude_mid = ret["geom"]
|
geom_extrude_mid = ret["geom"]
|
||||||
del ret
|
del ret
|
||||||
|
|
||||||
@@ -45,19 +45,19 @@ verts_extrude_b = [ele for ele in geom_extrude_mid
|
|||||||
edges_extrude_b = [ele for ele in geom_extrude_mid
|
edges_extrude_b = [ele for ele in geom_extrude_mid
|
||||||
if isinstance(ele, bmesh.types.BMEdge) and ele.is_boundary]
|
if isinstance(ele, bmesh.types.BMEdge) and ele.is_boundary]
|
||||||
bmesh.ops.translate(
|
bmesh.ops.translate(
|
||||||
bm,
|
bm,
|
||||||
verts=verts_extrude_b,
|
verts=verts_extrude_b,
|
||||||
vec=(0.0, 0.0, 1.0))
|
vec=(0.0, 0.0, 1.0))
|
||||||
|
|
||||||
|
|
||||||
# Create the circle on side 'b'
|
# Create the circle on side 'b'
|
||||||
ret = bmesh.ops.spin(
|
ret = bmesh.ops.spin(
|
||||||
bm,
|
bm,
|
||||||
geom=verts_extrude_b + edges_extrude_b,
|
geom=verts_extrude_b + edges_extrude_b,
|
||||||
angle=-math.radians(180.0),
|
angle=-math.radians(180.0),
|
||||||
steps=8,
|
steps=8,
|
||||||
axis=(1.0, 0.0, 0.0),
|
axis=(1.0, 0.0, 0.0),
|
||||||
cent=(0.0, 1.0, 1.0))
|
cent=(0.0, 1.0, 1.0))
|
||||||
edges_end_b = [ele for ele in ret["geom_last"]
|
edges_end_b = [ele for ele in ret["geom_last"]
|
||||||
if isinstance(ele, bmesh.types.BMEdge)]
|
if isinstance(ele, bmesh.types.BMEdge)]
|
||||||
del ret
|
del ret
|
||||||
@@ -65,30 +65,30 @@ del ret
|
|||||||
|
|
||||||
# Bridge the resulting edge loops of both spins 'a & b'
|
# Bridge the resulting edge loops of both spins 'a & b'
|
||||||
bmesh.ops.bridge_loops(
|
bmesh.ops.bridge_loops(
|
||||||
bm,
|
bm,
|
||||||
edges=edges_end_a + edges_end_b)
|
edges=edges_end_a + edges_end_b)
|
||||||
|
|
||||||
|
|
||||||
# Now we have made a links of the chain, make a copy and rotate it
|
# Now we have made a links of the chain, make a copy and rotate it
|
||||||
# (so this looks something like a chain)
|
# (so this looks something like a chain)
|
||||||
|
|
||||||
ret = bmesh.ops.duplicate(
|
ret = bmesh.ops.duplicate(
|
||||||
bm,
|
bm,
|
||||||
geom=bm.verts[:] + bm.edges[:] + bm.faces[:])
|
geom=bm.verts[:] + bm.edges[:] + bm.faces[:])
|
||||||
geom_dupe = ret["geom"]
|
geom_dupe = ret["geom"]
|
||||||
verts_dupe = [ele for ele in geom_dupe if isinstance(ele, bmesh.types.BMVert)]
|
verts_dupe = [ele for ele in geom_dupe if isinstance(ele, bmesh.types.BMVert)]
|
||||||
del ret
|
del ret
|
||||||
|
|
||||||
# position the new link
|
# position the new link
|
||||||
bmesh.ops.translate(
|
bmesh.ops.translate(
|
||||||
bm,
|
bm,
|
||||||
verts=verts_dupe,
|
verts=verts_dupe,
|
||||||
vec=(0.0, 0.0, 2.0))
|
vec=(0.0, 0.0, 2.0))
|
||||||
bmesh.ops.rotate(
|
bmesh.ops.rotate(
|
||||||
bm,
|
bm,
|
||||||
verts=verts_dupe,
|
verts=verts_dupe,
|
||||||
cent=(0.0, 1.0, 0.0),
|
cent=(0.0, 1.0, 0.0),
|
||||||
matrix=mathutils.Matrix.Rotation(math.radians(90.0), 3, 'Z'))
|
matrix=mathutils.Matrix.Rotation(math.radians(90.0), 3, 'Z'))
|
||||||
|
|
||||||
# Done with creating the mesh, simply link it into the scene so we can see it
|
# Done with creating the mesh, simply link it into the scene so we can see it
|
||||||
|
|
||||||
|
@@ -17,5 +17,4 @@ from bpy.app.handlers import persistent
|
|||||||
def load_handler(dummy):
|
def load_handler(dummy):
|
||||||
print("Load Handler:", bpy.data.filepath)
|
print("Load Handler:", bpy.data.filepath)
|
||||||
|
|
||||||
|
|
||||||
bpy.app.handlers.load_post.append(load_handler)
|
bpy.app.handlers.load_post.append(load_handler)
|
||||||
|
@@ -11,5 +11,4 @@ import bpy
|
|||||||
def my_handler(scene):
|
def my_handler(scene):
|
||||||
print("Frame Change", scene.frame_current)
|
print("Frame Change", scene.frame_current)
|
||||||
|
|
||||||
|
|
||||||
bpy.app.handlers.frame_change_pre.append(my_handler)
|
bpy.app.handlers.frame_change_pre.append(my_handler)
|
||||||
|
@@ -54,19 +54,19 @@ translations_tuple = (
|
|||||||
"Copyright (C) 2013 The Blender Foundation.",
|
"Copyright (C) 2013 The Blender Foundation.",
|
||||||
"This file is distributed under the same license as the Blender package.",
|
"This file is distributed under the same license as the Blender package.",
|
||||||
"FIRST AUTHOR <EMAIL@ADDRESS>, YEAR."))),
|
"FIRST AUTHOR <EMAIL@ADDRESS>, YEAR."))),
|
||||||
),
|
),
|
||||||
(("Operator", "Render: Copy Settings"),
|
(("Operator", "Render: Copy Settings"),
|
||||||
(("bpy.types.SCENE_OT_render_copy_settings",),
|
(("bpy.types.SCENE_OT_render_copy_settings",),
|
||||||
()),
|
()),
|
||||||
("fr_FR", "Rendu : copier réglages",
|
("fr_FR", "Rendu : copier réglages",
|
||||||
(False, ())),
|
(False, ())),
|
||||||
),
|
),
|
||||||
(("*", "Copy render settings from current scene to others"),
|
(("*", "Copy render settings from current scene to others"),
|
||||||
(("bpy.types.SCENE_OT_render_copy_settings",),
|
(("bpy.types.SCENE_OT_render_copy_settings",),
|
||||||
()),
|
()),
|
||||||
("fr_FR", "Copier les réglages de rendu depuis la scène courante vers d’autres",
|
("fr_FR", "Copier les réglages de rendu depuis la scène courante vers d’autres",
|
||||||
(False, ())),
|
(False, ())),
|
||||||
),
|
),
|
||||||
# ... etc, all messages from your addon.
|
# ... etc, all messages from your addon.
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -81,7 +81,6 @@ for msg in translations_tuple:
|
|||||||
|
|
||||||
# Define remaining addon (operators, UI...) here.
|
# Define remaining addon (operators, UI...) here.
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
# Usual operator/UI/etc. registration...
|
# Usual operator/UI/etc. registration...
|
||||||
|
|
||||||
|
@@ -20,6 +20,6 @@ The execution context is one of:
|
|||||||
'EXEC_SCREEN')
|
'EXEC_SCREEN')
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# collection add popup
|
# group add popup
|
||||||
import bpy
|
import bpy
|
||||||
bpy.ops.object.collection_instance_add('INVOKE_DEFAULT')
|
bpy.ops.object.group_instance_add('INVOKE_DEFAULT')
|
||||||
|
@@ -14,7 +14,6 @@ class MaterialSettings(bpy.types.PropertyGroup):
|
|||||||
my_float = bpy.props.FloatProperty()
|
my_float = bpy.props.FloatProperty()
|
||||||
my_string = bpy.props.StringProperty()
|
my_string = bpy.props.StringProperty()
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(MaterialSettings)
|
bpy.utils.register_class(MaterialSettings)
|
||||||
|
|
||||||
bpy.types.Material.my_settings = \
|
bpy.types.Material.my_settings = \
|
||||||
|
@@ -14,7 +14,6 @@ class SceneSettingItem(bpy.types.PropertyGroup):
|
|||||||
name = bpy.props.StringProperty(name="Test Prop", default="Unknown")
|
name = bpy.props.StringProperty(name="Test Prop", default="Unknown")
|
||||||
value = bpy.props.IntProperty(name="Test Prop", default=22)
|
value = bpy.props.IntProperty(name="Test Prop", default=22)
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(SceneSettingItem)
|
bpy.utils.register_class(SceneSettingItem)
|
||||||
|
|
||||||
bpy.types.Scene.my_settings = \
|
bpy.types.Scene.my_settings = \
|
||||||
|
@@ -14,7 +14,6 @@ import bpy
|
|||||||
def update_func(self, context):
|
def update_func(self, context):
|
||||||
print("my test function", self)
|
print("my test function", self)
|
||||||
|
|
||||||
|
|
||||||
bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func)
|
bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func)
|
||||||
|
|
||||||
bpy.context.scene.testprop = 11.0
|
bpy.context.scene.testprop = 11.0
|
||||||
|
@@ -19,7 +19,6 @@ def get_float(self):
|
|||||||
def set_float(self, value):
|
def set_float(self, value):
|
||||||
self["testprop"] = value
|
self["testprop"] = value
|
||||||
|
|
||||||
|
|
||||||
bpy.types.Scene.test_float = bpy.props.FloatProperty(get=get_float, set=set_float)
|
bpy.types.Scene.test_float = bpy.props.FloatProperty(get=get_float, set=set_float)
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +27,6 @@ def get_date(self):
|
|||||||
import datetime
|
import datetime
|
||||||
return str(datetime.datetime.now())
|
return str(datetime.datetime.now())
|
||||||
|
|
||||||
|
|
||||||
bpy.types.Scene.test_date = bpy.props.StringProperty(get=get_date)
|
bpy.types.Scene.test_date = bpy.props.StringProperty(get=get_date)
|
||||||
|
|
||||||
|
|
||||||
@@ -42,7 +40,6 @@ def get_array(self):
|
|||||||
def set_array(self, values):
|
def set_array(self, values):
|
||||||
self["somebool"] = values[0] and values[1]
|
self["somebool"] = values[0] and values[1]
|
||||||
|
|
||||||
|
|
||||||
bpy.types.Scene.test_array = bpy.props.BoolVectorProperty(size=2, get=get_array, set=set_array)
|
bpy.types.Scene.test_array = bpy.props.BoolVectorProperty(size=2, get=get_array, set=set_array)
|
||||||
|
|
||||||
|
|
||||||
@@ -53,7 +50,7 @@ test_items = [
|
|||||||
("GREEN", "Green", "", 2),
|
("GREEN", "Green", "", 2),
|
||||||
("BLUE", "Blue", "", 3),
|
("BLUE", "Blue", "", 3),
|
||||||
("YELLOW", "Yellow", "", 4),
|
("YELLOW", "Yellow", "", 4),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def get_enum(self):
|
def get_enum(self):
|
||||||
@@ -64,7 +61,6 @@ def get_enum(self):
|
|||||||
def set_enum(self, value):
|
def set_enum(self, value):
|
||||||
print("setting value", value)
|
print("setting value", value)
|
||||||
|
|
||||||
|
|
||||||
bpy.types.Scene.test_enum = bpy.props.EnumProperty(items=test_items, get=get_enum, set=set_enum)
|
bpy.types.Scene.test_enum = bpy.props.EnumProperty(items=test_items, get=get_enum, set=set_enum)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@ bl_info = {
|
|||||||
"wiki_url": "",
|
"wiki_url": "",
|
||||||
"tracker_url": "",
|
"tracker_url": "",
|
||||||
"category": "Object",
|
"category": "Object",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
@@ -23,17 +23,17 @@ class ExampleAddonPreferences(AddonPreferences):
|
|||||||
bl_idname = __name__
|
bl_idname = __name__
|
||||||
|
|
||||||
filepath = StringProperty(
|
filepath = StringProperty(
|
||||||
name="Example File Path",
|
name="Example File Path",
|
||||||
subtype='FILE_PATH',
|
subtype='FILE_PATH',
|
||||||
)
|
)
|
||||||
number = IntProperty(
|
number = IntProperty(
|
||||||
name="Example Number",
|
name="Example Number",
|
||||||
default=4,
|
default=4,
|
||||||
)
|
)
|
||||||
boolean = BoolProperty(
|
boolean = BoolProperty(
|
||||||
name="Example Boolean",
|
name="Example Boolean",
|
||||||
default=False,
|
default=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
@@ -14,5 +14,4 @@ import bpy
|
|||||||
def menu_draw(self, context):
|
def menu_draw(self, context):
|
||||||
self.layout.operator("wm.save_homefile")
|
self.layout.operator("wm.save_homefile")
|
||||||
|
|
||||||
|
|
||||||
bpy.types.INFO_MT_file.append(menu_draw)
|
bpy.types.INFO_MT_file.append(menu_draw)
|
||||||
|
@@ -32,7 +32,7 @@ class AddPresetObjectDraw(AddPresetBase, Operator):
|
|||||||
# variable used for all preset values
|
# variable used for all preset values
|
||||||
preset_defines = [
|
preset_defines = [
|
||||||
"obj = bpy.context.object"
|
"obj = bpy.context.object"
|
||||||
]
|
]
|
||||||
|
|
||||||
# properties to store in the preset
|
# properties to store in the preset
|
||||||
preset_values = [
|
preset_values = [
|
||||||
@@ -42,7 +42,7 @@ class AddPresetObjectDraw(AddPresetBase, Operator):
|
|||||||
"obj.show_name",
|
"obj.show_name",
|
||||||
"obj.show_axis",
|
"obj.show_axis",
|
||||||
"obj.show_wire",
|
"obj.show_wire",
|
||||||
]
|
]
|
||||||
|
|
||||||
# where to store the preset
|
# where to store the preset
|
||||||
preset_subdir = "object/draw"
|
preset_subdir = "object/draw"
|
||||||
@@ -61,7 +61,7 @@ def panel_func(self, context):
|
|||||||
classes = (
|
classes = (
|
||||||
OBJECT_MT_draw_presets,
|
OBJECT_MT_draw_presets,
|
||||||
AddPresetObjectDraw,
|
AddPresetObjectDraw,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
|
@@ -60,7 +60,6 @@ def menu_func(self, context):
|
|||||||
layout.separator()
|
layout.separator()
|
||||||
layout.operator(WM_OT_button_context_test.bl_idname)
|
layout.operator(WM_OT_button_context_test.bl_idname)
|
||||||
|
|
||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
WM_OT_button_context_test,
|
WM_OT_button_context_test,
|
||||||
WM_MT_button_context,
|
WM_MT_button_context,
|
||||||
@@ -78,6 +77,5 @@ def unregister():
|
|||||||
bpy.utils.unregister_class(cls)
|
bpy.utils.unregister_class(cls)
|
||||||
bpy.types.WM_MT_button_context.remove(menu_func)
|
bpy.types.WM_MT_button_context.remove(menu_func)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
register()
|
register()
|
||||||
|
@@ -21,5 +21,4 @@ class CyclesNodeTree(bpy.types.NodeTree):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return context.scene.render.engine == 'CYCLES'
|
return context.scene.render.engine == 'CYCLES'
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(CyclesNodeTree)
|
bpy.utils.register_class(CyclesNodeTree)
|
||||||
|
@@ -42,7 +42,6 @@ class SimpleMouseOperator(bpy.types.Operator):
|
|||||||
self.y = event.mouse_y
|
self.y = event.mouse_y
|
||||||
return self.execute(context)
|
return self.execute(context)
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(SimpleMouseOperator)
|
bpy.utils.register_class(SimpleMouseOperator)
|
||||||
|
|
||||||
# Test call to the newly defined operator.
|
# Test call to the newly defined operator.
|
||||||
|
@@ -42,7 +42,6 @@ def menu_func(self, context):
|
|||||||
self.layout.operator_context = 'INVOKE_DEFAULT'
|
self.layout.operator_context = 'INVOKE_DEFAULT'
|
||||||
self.layout.operator(ExportSomeData.bl_idname, text="Text Export Operator")
|
self.layout.operator(ExportSomeData.bl_idname, text="Text Export Operator")
|
||||||
|
|
||||||
|
|
||||||
# Register and add to the file selector
|
# Register and add to the file selector
|
||||||
bpy.utils.register_class(ExportSomeData)
|
bpy.utils.register_class(ExportSomeData)
|
||||||
bpy.types.INFO_MT_file_export.append(menu_func)
|
bpy.types.INFO_MT_file_export.append(menu_func)
|
||||||
|
@@ -41,7 +41,6 @@ class CustomDrawOperator(bpy.types.Operator):
|
|||||||
|
|
||||||
col.prop(self, "my_string")
|
col.prop(self, "my_string")
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(CustomDrawOperator)
|
bpy.utils.register_class(CustomDrawOperator)
|
||||||
|
|
||||||
# test call
|
# test call
|
||||||
|
@@ -22,7 +22,6 @@ class HelloWorldOperator(bpy.types.Operator):
|
|||||||
print("Hello World")
|
print("Hello World")
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(HelloWorldOperator)
|
bpy.utils.register_class(HelloWorldOperator)
|
||||||
|
|
||||||
# test call to the newly defined operator
|
# test call to the newly defined operator
|
||||||
|
@@ -31,7 +31,6 @@ class MyPropertyGroup(bpy.types.PropertyGroup):
|
|||||||
custom_1 = bpy.props.FloatProperty(name="My Float")
|
custom_1 = bpy.props.FloatProperty(name="My Float")
|
||||||
custom_2 = bpy.props.IntProperty(name="My Int")
|
custom_2 = bpy.props.IntProperty(name="My Int")
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(MyPropertyGroup)
|
bpy.utils.register_class(MyPropertyGroup)
|
||||||
|
|
||||||
bpy.types.Object.my_prop_grp = bpy.props.PointerProperty(type=MyPropertyGroup)
|
bpy.types.Object.my_prop_grp = bpy.props.PointerProperty(type=MyPropertyGroup)
|
||||||
|
@@ -10,5 +10,4 @@ import bpy
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
self.layout.label("Hello World")
|
self.layout.label("Hello World")
|
||||||
|
|
||||||
|
|
||||||
bpy.context.window_manager.popup_menu(draw, title="Greeting", icon='INFO')
|
bpy.context.window_manager.popup_menu(draw, title="Greeting", icon='INFO')
|
||||||
|
@@ -12,7 +12,6 @@ from bpy.props import PointerProperty
|
|||||||
class MyPropGroup(bpy.types.PropertyGroup):
|
class MyPropGroup(bpy.types.PropertyGroup):
|
||||||
nested = bpy.props.FloatProperty(name="Nested", default=0.0)
|
nested = bpy.props.FloatProperty(name="Nested", default=0.0)
|
||||||
|
|
||||||
|
|
||||||
# register it so its available for all bones
|
# register it so its available for all bones
|
||||||
bpy.utils.register_class(MyPropGroup)
|
bpy.utils.register_class(MyPropGroup)
|
||||||
bpy.types.Bone.my_prop = PointerProperty(type=MyPropGroup,
|
bpy.types.Bone.my_prop = PointerProperty(type=MyPropGroup,
|
||||||
|
@@ -23,9 +23,9 @@ class OffScreenDraw(bpy.types.Operator):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def handle_add(self, context):
|
def handle_add(self, context):
|
||||||
OffScreenDraw._handle_draw = bpy.types.SpaceView3D.draw_handler_add(
|
OffScreenDraw._handle_draw = bpy.types.SpaceView3D.draw_handler_add(
|
||||||
self.draw_callback_px, (self, context),
|
self.draw_callback_px, (self, context),
|
||||||
'WINDOW', 'POST_PIXEL',
|
'WINDOW', 'POST_PIXEL',
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def handle_remove():
|
def handle_remove():
|
||||||
@@ -58,20 +58,20 @@ class OffScreenDraw(bpy.types.Operator):
|
|||||||
|
|
||||||
modelview_matrix = camera.matrix_world.inverted()
|
modelview_matrix = camera.matrix_world.inverted()
|
||||||
projection_matrix = camera.calc_matrix_camera(
|
projection_matrix = camera.calc_matrix_camera(
|
||||||
render.resolution_x,
|
render.resolution_x,
|
||||||
render.resolution_y,
|
render.resolution_y,
|
||||||
render.pixel_aspect_x,
|
render.pixel_aspect_x,
|
||||||
render.pixel_aspect_y,
|
render.pixel_aspect_y,
|
||||||
)
|
)
|
||||||
|
|
||||||
offscreen.draw_view3d(
|
offscreen.draw_view3d(
|
||||||
scene,
|
scene,
|
||||||
render_layer,
|
render_layer,
|
||||||
context.space_data,
|
context.space_data,
|
||||||
context.region,
|
context.region,
|
||||||
projection_matrix,
|
projection_matrix,
|
||||||
modelview_matrix,
|
modelview_matrix,
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _opengl_draw(context, texture, aspect_ratio, scale):
|
def _opengl_draw(context, texture, aspect_ratio, scale):
|
||||||
|
@@ -73,8 +73,6 @@ def rna_info_BuildRNAInfo_cache():
|
|||||||
if rna_info_BuildRNAInfo_cache.ret is None:
|
if rna_info_BuildRNAInfo_cache.ret is None:
|
||||||
rna_info_BuildRNAInfo_cache.ret = rna_info.BuildRNAInfo()
|
rna_info_BuildRNAInfo_cache.ret = rna_info.BuildRNAInfo()
|
||||||
return rna_info_BuildRNAInfo_cache.ret
|
return rna_info_BuildRNAInfo_cache.ret
|
||||||
|
|
||||||
|
|
||||||
rna_info_BuildRNAInfo_cache.ret = None
|
rna_info_BuildRNAInfo_cache.ret = None
|
||||||
# --- end rna_info cache
|
# --- end rna_info cache
|
||||||
|
|
||||||
@@ -334,9 +332,9 @@ except ImportError:
|
|||||||
# to avoid having to match Blender's source tree.
|
# to avoid having to match Blender's source tree.
|
||||||
EXTRA_SOURCE_FILES = (
|
EXTRA_SOURCE_FILES = (
|
||||||
"../../../release/scripts/templates_py/bmesh_simple.py",
|
"../../../release/scripts/templates_py/bmesh_simple.py",
|
||||||
"../../../release/scripts/templates_py/gizmo_operator.py",
|
"../../../release/scripts/templates_py/manipulator_operator.py",
|
||||||
"../../../release/scripts/templates_py/gizmo_operator_target.py",
|
"../../../release/scripts/templates_py/manipulator_operator_target.py",
|
||||||
"../../../release/scripts/templates_py/gizmo_simple.py",
|
"../../../release/scripts/templates_py/manipulator_simple.py",
|
||||||
"../../../release/scripts/templates_py/operator_simple.py",
|
"../../../release/scripts/templates_py/operator_simple.py",
|
||||||
"../../../release/scripts/templates_py/ui_panel_simple.py",
|
"../../../release/scripts/templates_py/ui_panel_simple.py",
|
||||||
"../../../release/scripts/templates_py/ui_previews_custom_icon.py",
|
"../../../release/scripts/templates_py/ui_previews_custom_icon.py",
|
||||||
@@ -518,8 +516,6 @@ def escape_rst(text):
|
|||||||
""" Escape plain text which may contain characters used by RST.
|
""" Escape plain text which may contain characters used by RST.
|
||||||
"""
|
"""
|
||||||
return text.translate(escape_rst.trans)
|
return text.translate(escape_rst.trans)
|
||||||
|
|
||||||
|
|
||||||
escape_rst.trans = str.maketrans({
|
escape_rst.trans = str.maketrans({
|
||||||
"`": "\\`",
|
"`": "\\`",
|
||||||
"|": "\\|",
|
"|": "\\|",
|
||||||
@@ -1022,7 +1018,6 @@ def pymodule2sphinx(basepath, module_name, module, title):
|
|||||||
|
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
|
|
||||||
# Changes in Blender will force errors here
|
# Changes in Blender will force errors here
|
||||||
context_type_map = {
|
context_type_map = {
|
||||||
"active_base": ("ObjectBase", False),
|
"active_base": ("ObjectBase", False),
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
# <pep8 compliant>
|
# <pep8 compliant>
|
||||||
|
|
||||||
bpy_types_Operator_bl_property__doc__ = (
|
bpy_types_Operator_bl_property__doc__ = (
|
||||||
"""
|
"""
|
||||||
The name of a property to use as this operators primary property.
|
The name of a property to use as this operators primary property.
|
||||||
Currently this is only used to select the default property when
|
Currently this is only used to select the default property when
|
||||||
expanding an operator into a menu.
|
expanding an operator into a menu.
|
||||||
|
@@ -107,16 +107,14 @@ def main():
|
|||||||
|
|
||||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||||
# II) Generate doc source in temp dir.
|
# II) Generate doc source in temp dir.
|
||||||
doc_gen_cmd = (
|
doc_gen_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
|
||||||
args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
|
"--python", "%s/doc/python_api/sphinx_doc_gen.py" % args.source_dir, "--",
|
||||||
"--python", "%s/doc/python_api/sphinx_doc_gen.py" % args.source_dir, "--",
|
"--output", tmp_dir)
|
||||||
"--output", tmp_dir
|
|
||||||
)
|
|
||||||
subprocess.run(doc_gen_cmd)
|
subprocess.run(doc_gen_cmd)
|
||||||
|
|
||||||
# III) Get Blender version info.
|
# III) Get Blender version info.
|
||||||
getver_file = os.path.join(tmp_dir, "blendver.txt")
|
getver_file = os.path.join(tmp_dir, "blendver.txt")
|
||||||
getver_script = (
|
getver_script = (""
|
||||||
"import sys, bpy\n"
|
"import sys, bpy\n"
|
||||||
"with open(sys.argv[-1], 'w') as f:\n"
|
"with open(sys.argv[-1], 'w') as f:\n"
|
||||||
" is_release = bpy.app.version_cycle in {'rc', 'release'}\n"
|
" is_release = bpy.app.version_cycle in {'rc', 'release'}\n"
|
||||||
@@ -126,8 +124,7 @@ def main():
|
|||||||
" f.write('%d.%d%s\\n' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
|
" f.write('%d.%d%s\\n' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
|
||||||
" if is_release else '%s\\n' % branch)\n"
|
" if is_release else '%s\\n' % branch)\n"
|
||||||
" f.write('%d_%d%s_release' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
|
" f.write('%d_%d%s_release' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
|
||||||
" if is_release else '%d_%d_%d' % bpy.app.version)\n"
|
" if is_release else '%d_%d_%d' % bpy.app.version)\n")
|
||||||
)
|
|
||||||
get_ver_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
|
get_ver_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
|
||||||
"--python-expr", getver_script, "--", getver_file)
|
"--python-expr", getver_script, "--", getver_file)
|
||||||
subprocess.run(get_ver_cmd)
|
subprocess.run(get_ver_cmd)
|
||||||
|
4
extern/CMakeLists.txt
vendored
4
extern/CMakeLists.txt
vendored
@@ -75,9 +75,9 @@ if(WITH_LZMA)
|
|||||||
add_subdirectory(lzma)
|
add_subdirectory(lzma)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV OR TRUE)
|
if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
|
||||||
add_subdirectory(clew)
|
add_subdirectory(clew)
|
||||||
if(WITH_CUDA_DYNLOAD AND FALSE)
|
if(WITH_CUDA_DYNLOAD)
|
||||||
add_subdirectory(cuew)
|
add_subdirectory(cuew)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@@ -335,7 +335,7 @@ template<> EIGEN_STRONG_INLINE void prefetch<float>(const float* addr) { _mm_p
|
|||||||
template<> EIGEN_STRONG_INLINE void prefetch<double>(const double* addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); }
|
template<> EIGEN_STRONG_INLINE void prefetch<double>(const double* addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); }
|
||||||
template<> EIGEN_STRONG_INLINE void prefetch<int>(const int* addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); }
|
template<> EIGEN_STRONG_INLINE void prefetch<int>(const int* addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); }
|
||||||
|
|
||||||
#if defined(_MSC_VER) && defined(_WIN64) && !defined(__INTEL_COMPILER) && !defined(__clang__)
|
#if defined(_MSC_VER) && defined(_WIN64) && !defined(__INTEL_COMPILER)
|
||||||
// The temporary variable fixes an internal compilation error in vs <= 2008 and a wrong-result bug in vs 2010
|
// The temporary variable fixes an internal compilation error in vs <= 2008 and a wrong-result bug in vs 2010
|
||||||
// Direct of the struct members fixed bug #62.
|
// Direct of the struct members fixed bug #62.
|
||||||
template<> EIGEN_STRONG_INLINE float pfirst<Packet4f>(const Packet4f& a) { return a.m128_f32[0]; }
|
template<> EIGEN_STRONG_INLINE float pfirst<Packet4f>(const Packet4f& a) { return a.m128_f32[0]; }
|
||||||
|
12
extern/Eigen3/patches/blender.diff
vendored
12
extern/Eigen3/patches/blender.diff
vendored
@@ -1,12 +0,0 @@
|
|||||||
diff -Naur c:\blender-git\blender\extern\Eigen3/Eigen/src/Core/arch/SSE/PacketMath.h k:\BlenderGit\blender\extern\Eigen3/Eigen/src/Core/arch/SSE/PacketMath.h
|
|
||||||
--- c:\blender-git\blender\extern\Eigen3/Eigen/src/Core/arch/SSE/PacketMath.h 2018-05-25 13:29:14 -0600
|
|
||||||
+++ k:\BlenderGit\blender\extern\Eigen3/Eigen/src/Core/arch/SSE/PacketMath.h 2018-05-26 19:56:36 -0600
|
|
||||||
@@ -335,7 +335,7 @@
|
|
||||||
template<> EIGEN_STRONG_INLINE void prefetch<double>(const double* addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); }
|
|
||||||
template<> EIGEN_STRONG_INLINE void prefetch<int>(const int* addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); }
|
|
||||||
|
|
||||||
-#if defined(_MSC_VER) && defined(_WIN64) && !defined(__INTEL_COMPILER)
|
|
||||||
+#if defined(_MSC_VER) && defined(_WIN64) && !defined(__INTEL_COMPILER) && !defined(__clang__)
|
|
||||||
// The temporary variable fixes an internal compilation error in vs <= 2008 and a wrong-result bug in vs 2010
|
|
||||||
// Direct of the struct members fixed bug #62.
|
|
||||||
template<> EIGEN_STRONG_INLINE float pfirst<Packet4f>(const Packet4f& a) { return a.m128_f32[0]; }
|
|
2
extern/audaspace/plugins/ffmpeg/FFMPEG.cpp
vendored
2
extern/audaspace/plugins/ffmpeg/FFMPEG.cpp
vendored
@@ -23,9 +23,7 @@ AUD_NAMESPACE_BEGIN
|
|||||||
|
|
||||||
FFMPEG::FFMPEG()
|
FFMPEG::FFMPEG()
|
||||||
{
|
{
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 58
|
|
||||||
av_register_all();
|
av_register_all();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FFMPEG::registerPlugin()
|
void FFMPEG::registerPlugin()
|
||||||
|
124
extern/audaspace/plugins/ffmpeg/FFMPEGReader.cpp
vendored
124
extern/audaspace/plugins/ffmpeg/FFMPEGReader.cpp
vendored
@@ -22,37 +22,37 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
#include <libavformat/avio.h>
|
#include <libavformat/avio.h>
|
||||||
#include <libavutil/avutil.h>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AUD_NAMESPACE_BEGIN
|
AUD_NAMESPACE_BEGIN
|
||||||
|
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 58
|
|
||||||
#define FFMPEG_OLD_CODE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int FFMPEGReader::decode(AVPacket& packet, Buffer& buffer)
|
int FFMPEGReader::decode(AVPacket& packet, Buffer& buffer)
|
||||||
{
|
{
|
||||||
int buf_size = buffer.getSize();
|
AVFrame* frame = nullptr;
|
||||||
int buf_pos = 0;
|
|
||||||
|
|
||||||
#ifdef FFMPEG_OLD_CODE
|
|
||||||
int got_frame;
|
int got_frame;
|
||||||
int read_length;
|
int read_length;
|
||||||
uint8_t* orig_data = packet.data;
|
uint8_t* orig_data = packet.data;
|
||||||
int orig_size = packet.size;
|
int orig_size = packet.size;
|
||||||
|
|
||||||
|
int buf_size = buffer.getSize();
|
||||||
|
int buf_pos = 0;
|
||||||
|
|
||||||
while(packet.size > 0)
|
while(packet.size > 0)
|
||||||
{
|
{
|
||||||
got_frame = 0;
|
got_frame = 0;
|
||||||
|
|
||||||
read_length = avcodec_decode_audio4(m_codecCtx, m_frame, &got_frame, &packet);
|
if(!frame)
|
||||||
|
frame = av_frame_alloc();
|
||||||
|
else
|
||||||
|
av_frame_unref(frame);
|
||||||
|
|
||||||
|
read_length = avcodec_decode_audio4(m_codecCtx, frame, &got_frame, &packet);
|
||||||
if(read_length < 0)
|
if(read_length < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if(got_frame)
|
if(got_frame)
|
||||||
{
|
{
|
||||||
int data_size = av_samples_get_buffer_size(nullptr, m_codecCtx->channels, m_frame->nb_samples, m_codecCtx->sample_fmt, 1);
|
int data_size = av_samples_get_buffer_size(nullptr, m_codecCtx->channels, frame->nb_samples, m_codecCtx->sample_fmt, 1);
|
||||||
|
|
||||||
if(buf_size - buf_pos < data_size)
|
if(buf_size - buf_pos < data_size)
|
||||||
{
|
{
|
||||||
@@ -62,18 +62,18 @@ int FFMPEGReader::decode(AVPacket& packet, Buffer& buffer)
|
|||||||
|
|
||||||
if(m_tointerleave)
|
if(m_tointerleave)
|
||||||
{
|
{
|
||||||
int single_size = data_size / m_codecCtx->channels / m_frame->nb_samples;
|
int single_size = data_size / m_codecCtx->channels / frame->nb_samples;
|
||||||
for(int channel = 0; channel < m_codecCtx->channels; channel++)
|
for(int channel = 0; channel < m_codecCtx->channels; channel++)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < m_frame->nb_samples; i++)
|
for(int i = 0; i < frame->nb_samples; i++)
|
||||||
{
|
{
|
||||||
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos + ((m_codecCtx->channels * i) + channel) * single_size,
|
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos + ((m_codecCtx->channels * i) + channel) * single_size,
|
||||||
m_frame->data[channel] + i * single_size, single_size);
|
frame->data[channel] + i * single_size, single_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos, m_frame->data[0], data_size);
|
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos, frame->data[0], data_size);
|
||||||
|
|
||||||
buf_pos += data_size;
|
buf_pos += data_size;
|
||||||
}
|
}
|
||||||
@@ -83,42 +83,7 @@ int FFMPEGReader::decode(AVPacket& packet, Buffer& buffer)
|
|||||||
|
|
||||||
packet.data = orig_data;
|
packet.data = orig_data;
|
||||||
packet.size = orig_size;
|
packet.size = orig_size;
|
||||||
#else
|
av_free(frame);
|
||||||
avcodec_send_packet(m_codecCtx, &packet);
|
|
||||||
|
|
||||||
while(true)
|
|
||||||
{
|
|
||||||
auto ret = avcodec_receive_frame(m_codecCtx, m_frame);
|
|
||||||
|
|
||||||
if(ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
int data_size = av_samples_get_buffer_size(nullptr, m_codecCtx->channels, m_frame->nb_samples, m_codecCtx->sample_fmt, 1);
|
|
||||||
|
|
||||||
if(buf_size - buf_pos < data_size)
|
|
||||||
{
|
|
||||||
buffer.resize(buf_size + data_size, true);
|
|
||||||
buf_size += data_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(m_tointerleave)
|
|
||||||
{
|
|
||||||
int single_size = data_size / m_codecCtx->channels / m_frame->nb_samples;
|
|
||||||
for(int channel = 0; channel < m_codecCtx->channels; channel++)
|
|
||||||
{
|
|
||||||
for(int i = 0; i < m_frame->nb_samples; i++)
|
|
||||||
{
|
|
||||||
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos + ((m_codecCtx->channels * i) + channel) * single_size,
|
|
||||||
m_frame->data[channel] + i * single_size, single_size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos, m_frame->data[0], data_size);
|
|
||||||
|
|
||||||
buf_pos += data_size;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return buf_pos;
|
return buf_pos;
|
||||||
}
|
}
|
||||||
@@ -136,11 +101,7 @@ void FFMPEGReader::init()
|
|||||||
|
|
||||||
for(unsigned int i = 0; i < m_formatCtx->nb_streams; i++)
|
for(unsigned int i = 0; i < m_formatCtx->nb_streams; i++)
|
||||||
{
|
{
|
||||||
#ifdef FFMPEG_OLD_CODE
|
|
||||||
if((m_formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
|
if((m_formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||||
#else
|
|
||||||
if((m_formatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
|
|
||||||
#endif
|
|
||||||
&& (m_stream < 0))
|
&& (m_stream < 0))
|
||||||
{
|
{
|
||||||
m_stream=i;
|
m_stream=i;
|
||||||
@@ -151,34 +112,12 @@ void FFMPEGReader::init()
|
|||||||
if(m_stream == -1)
|
if(m_stream == -1)
|
||||||
AUD_THROW(FileException, "File couldn't be read, no audio stream found by ffmpeg.");
|
AUD_THROW(FileException, "File couldn't be read, no audio stream found by ffmpeg.");
|
||||||
|
|
||||||
// get a decoder and open it
|
|
||||||
#ifndef FFMPEG_OLD_CODE
|
|
||||||
AVCodec* aCodec = avcodec_find_decoder(m_formatCtx->streams[m_stream]->codecpar->codec_id);
|
|
||||||
|
|
||||||
if(!aCodec)
|
|
||||||
AUD_THROW(FileException, "File couldn't be read, no decoder found with ffmpeg.");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_frame = av_frame_alloc();
|
|
||||||
|
|
||||||
if(!m_frame)
|
|
||||||
AUD_THROW(FileException, "File couldn't be read, ffmpeg frame couldn't be allocated.");
|
|
||||||
|
|
||||||
#ifdef FFMPEG_OLD_CODE
|
|
||||||
m_codecCtx = m_formatCtx->streams[m_stream]->codec;
|
m_codecCtx = m_formatCtx->streams[m_stream]->codec;
|
||||||
|
|
||||||
|
// get a decoder and open it
|
||||||
AVCodec* aCodec = avcodec_find_decoder(m_codecCtx->codec_id);
|
AVCodec* aCodec = avcodec_find_decoder(m_codecCtx->codec_id);
|
||||||
#else
|
if(!aCodec)
|
||||||
m_codecCtx = avcodec_alloc_context3(aCodec);
|
AUD_THROW(FileException, "File couldn't be read, no decoder found with ffmpeg.");
|
||||||
#endif
|
|
||||||
|
|
||||||
if(!m_codecCtx)
|
|
||||||
AUD_THROW(FileException, "File couldn't be read, ffmpeg context couldn't be allocated.");
|
|
||||||
|
|
||||||
#ifndef FFMPEG_OLD_CODE
|
|
||||||
if(avcodec_parameters_to_context(m_codecCtx, m_formatCtx->streams[m_stream]->codecpar) < 0)
|
|
||||||
AUD_THROW(FileException, "File couldn't be read, ffmpeg decoder parameters couldn't be copied to decoder context.");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(avcodec_open2(m_codecCtx, aCodec, nullptr) < 0)
|
if(avcodec_open2(m_codecCtx, aCodec, nullptr) < 0)
|
||||||
AUD_THROW(FileException, "File couldn't be read, ffmpeg codec couldn't be opened.");
|
AUD_THROW(FileException, "File couldn't be read, ffmpeg codec couldn't be opened.");
|
||||||
@@ -218,8 +157,6 @@ void FFMPEGReader::init()
|
|||||||
FFMPEGReader::FFMPEGReader(std::string filename) :
|
FFMPEGReader::FFMPEGReader(std::string filename) :
|
||||||
m_pkgbuf(),
|
m_pkgbuf(),
|
||||||
m_formatCtx(nullptr),
|
m_formatCtx(nullptr),
|
||||||
m_codecCtx(nullptr),
|
|
||||||
m_frame(nullptr),
|
|
||||||
m_aviocontext(nullptr),
|
m_aviocontext(nullptr),
|
||||||
m_membuf(nullptr)
|
m_membuf(nullptr)
|
||||||
{
|
{
|
||||||
@@ -240,14 +177,12 @@ FFMPEGReader::FFMPEGReader(std::string filename) :
|
|||||||
|
|
||||||
FFMPEGReader::FFMPEGReader(std::shared_ptr<Buffer> buffer) :
|
FFMPEGReader::FFMPEGReader(std::shared_ptr<Buffer> buffer) :
|
||||||
m_pkgbuf(),
|
m_pkgbuf(),
|
||||||
m_codecCtx(nullptr),
|
|
||||||
m_frame(nullptr),
|
|
||||||
m_membuffer(buffer),
|
m_membuffer(buffer),
|
||||||
m_membufferpos(0)
|
m_membufferpos(0)
|
||||||
{
|
{
|
||||||
m_membuf = reinterpret_cast<data_t*>(av_malloc(AV_INPUT_BUFFER_MIN_SIZE + AV_INPUT_BUFFER_PADDING_SIZE));
|
m_membuf = reinterpret_cast<data_t*>(av_malloc(FF_MIN_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE));
|
||||||
|
|
||||||
m_aviocontext = avio_alloc_context(m_membuf, AV_INPUT_BUFFER_MIN_SIZE, 0, this, read_packet, nullptr, seek_packet);
|
m_aviocontext = avio_alloc_context(m_membuf, FF_MIN_BUFFER_SIZE, 0, this, read_packet, nullptr, seek_packet);
|
||||||
|
|
||||||
if(!m_aviocontext)
|
if(!m_aviocontext)
|
||||||
{
|
{
|
||||||
@@ -277,14 +212,7 @@ FFMPEGReader::FFMPEGReader(std::shared_ptr<Buffer> buffer) :
|
|||||||
|
|
||||||
FFMPEGReader::~FFMPEGReader()
|
FFMPEGReader::~FFMPEGReader()
|
||||||
{
|
{
|
||||||
if(m_frame)
|
|
||||||
av_frame_free(&m_frame);
|
|
||||||
#ifdef FFMPEG_OLD_CODE
|
|
||||||
avcodec_close(m_codecCtx);
|
avcodec_close(m_codecCtx);
|
||||||
#else
|
|
||||||
if(m_codecCtx)
|
|
||||||
avcodec_free_context(&m_codecCtx);
|
|
||||||
#endif
|
|
||||||
avformat_close_input(&m_formatCtx);
|
avformat_close_input(&m_formatCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,7 +312,7 @@ void FFMPEGReader::seek(int position)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
av_packet_unref(&packet);
|
av_free_packet(&packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -415,7 +343,7 @@ Specs FFMPEGReader::getSpecs() const
|
|||||||
void FFMPEGReader::read(int& length, bool& eos, sample_t* buffer)
|
void FFMPEGReader::read(int& length, bool& eos, sample_t* buffer)
|
||||||
{
|
{
|
||||||
// read packages and decode them
|
// read packages and decode them
|
||||||
AVPacket packet = {};
|
AVPacket packet;
|
||||||
int data_size = 0;
|
int data_size = 0;
|
||||||
int pkgbuf_pos;
|
int pkgbuf_pos;
|
||||||
int left = length;
|
int left = length;
|
||||||
@@ -431,7 +359,7 @@ void FFMPEGReader::read(int& length, bool& eos, sample_t* buffer)
|
|||||||
data_size = std::min(pkgbuf_pos, left * sample_size);
|
data_size = std::min(pkgbuf_pos, left * sample_size);
|
||||||
m_convert((data_t*) buf, (data_t*) m_pkgbuf.getBuffer(), data_size / AUD_FORMAT_SIZE(m_specs.format));
|
m_convert((data_t*) buf, (data_t*) m_pkgbuf.getBuffer(), data_size / AUD_FORMAT_SIZE(m_specs.format));
|
||||||
buf += data_size / AUD_FORMAT_SIZE(m_specs.format);
|
buf += data_size / AUD_FORMAT_SIZE(m_specs.format);
|
||||||
left -= data_size / sample_size;
|
left -= data_size/sample_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
// for each frame read as long as there isn't enough data already
|
// for each frame read as long as there isn't enough data already
|
||||||
@@ -447,9 +375,9 @@ void FFMPEGReader::read(int& length, bool& eos, sample_t* buffer)
|
|||||||
data_size = std::min(pkgbuf_pos, left * sample_size);
|
data_size = std::min(pkgbuf_pos, left * sample_size);
|
||||||
m_convert((data_t*) buf, (data_t*) m_pkgbuf.getBuffer(), data_size / AUD_FORMAT_SIZE(m_specs.format));
|
m_convert((data_t*) buf, (data_t*) m_pkgbuf.getBuffer(), data_size / AUD_FORMAT_SIZE(m_specs.format));
|
||||||
buf += data_size / AUD_FORMAT_SIZE(m_specs.format);
|
buf += data_size / AUD_FORMAT_SIZE(m_specs.format);
|
||||||
left -= data_size / sample_size;
|
left -= data_size/sample_size;
|
||||||
}
|
}
|
||||||
av_packet_unref(&packet);
|
av_free_packet(&packet);
|
||||||
}
|
}
|
||||||
// read more data than necessary?
|
// read more data than necessary?
|
||||||
if(pkgbuf_pos > data_size)
|
if(pkgbuf_pos > data_size)
|
||||||
|
@@ -79,11 +79,6 @@ private:
|
|||||||
*/
|
*/
|
||||||
AVCodecContext* m_codecCtx;
|
AVCodecContext* m_codecCtx;
|
||||||
|
|
||||||
/**
|
|
||||||
* The AVFrame structure for using ffmpeg.
|
|
||||||
*/
|
|
||||||
AVFrame* m_frame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The AVIOContext to read the data from.
|
* The AVIOContext to read the data from.
|
||||||
*/
|
*/
|
||||||
|
216
extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp
vendored
216
extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp
vendored
@@ -27,10 +27,6 @@ extern "C" {
|
|||||||
|
|
||||||
AUD_NAMESPACE_BEGIN
|
AUD_NAMESPACE_BEGIN
|
||||||
|
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 58
|
|
||||||
#define FFMPEG_OLD_CODE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void FFMPEGWriter::encode()
|
void FFMPEGWriter::encode()
|
||||||
{
|
{
|
||||||
sample_t* data = m_input_buffer.getBuffer();
|
sample_t* data = m_input_buffer.getBuffer();
|
||||||
@@ -62,106 +58,82 @@ void FFMPEGWriter::encode()
|
|||||||
if(m_input_size)
|
if(m_input_size)
|
||||||
m_convert(reinterpret_cast<data_t*>(data), reinterpret_cast<data_t*>(data), m_input_samples * m_specs.channels);
|
m_convert(reinterpret_cast<data_t*>(data), reinterpret_cast<data_t*>(data), m_input_samples * m_specs.channels);
|
||||||
|
|
||||||
#ifdef FFMPEG_OLD_CODE
|
AVPacket packet;
|
||||||
m_packet->data = nullptr;
|
|
||||||
m_packet->size = 0;
|
|
||||||
|
|
||||||
av_init_packet(m_packet);
|
packet.data = nullptr;
|
||||||
|
packet.size = 0;
|
||||||
|
|
||||||
av_frame_unref(m_frame);
|
av_init_packet(&packet);
|
||||||
|
|
||||||
|
AVFrame* frame = av_frame_alloc();
|
||||||
|
av_frame_unref(frame);
|
||||||
int got_packet;
|
int got_packet;
|
||||||
#endif
|
|
||||||
|
|
||||||
m_frame->nb_samples = m_input_samples;
|
frame->nb_samples = m_input_samples;
|
||||||
m_frame->format = m_codecCtx->sample_fmt;
|
frame->format = m_codecCtx->sample_fmt;
|
||||||
m_frame->channel_layout = m_codecCtx->channel_layout;
|
frame->channel_layout = m_codecCtx->channel_layout;
|
||||||
|
|
||||||
if(avcodec_fill_audio_frame(m_frame, m_specs.channels, m_codecCtx->sample_fmt, reinterpret_cast<data_t*>(data), m_input_buffer.getSize(), 0) < 0)
|
if(avcodec_fill_audio_frame(frame, m_specs.channels, m_codecCtx->sample_fmt, reinterpret_cast<data_t*>(data), m_input_buffer.getSize(), 0) < 0)
|
||||||
AUD_THROW(FileException, "File couldn't be written, filling the audio frame failed with ffmpeg.");
|
AUD_THROW(FileException, "File couldn't be written, filling the audio frame failed with ffmpeg.");
|
||||||
|
|
||||||
AVRational sample_time = { 1, static_cast<int>(m_specs.rate) };
|
AVRational sample_time = { 1, static_cast<int>(m_specs.rate) };
|
||||||
m_frame->pts = av_rescale_q(m_position - m_input_samples, m_codecCtx->time_base, sample_time);
|
frame->pts = av_rescale_q(m_position - m_input_samples, m_codecCtx->time_base, sample_time);
|
||||||
|
|
||||||
#ifdef FFMPEG_OLD_CODE
|
if(avcodec_encode_audio2(m_codecCtx, &packet, frame, &got_packet))
|
||||||
if(avcodec_encode_audio2(m_codecCtx, m_packet, m_frame, &got_packet))
|
|
||||||
{
|
{
|
||||||
|
av_frame_free(&frame);
|
||||||
AUD_THROW(FileException, "File couldn't be written, audio encoding failed with ffmpeg.");
|
AUD_THROW(FileException, "File couldn't be written, audio encoding failed with ffmpeg.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(got_packet)
|
if(got_packet)
|
||||||
{
|
{
|
||||||
m_packet->flags |= AV_PKT_FLAG_KEY;
|
packet.flags |= AV_PKT_FLAG_KEY;
|
||||||
m_packet->stream_index = m_stream->index;
|
packet.stream_index = m_stream->index;
|
||||||
if(av_write_frame(m_formatCtx, m_packet) < 0)
|
if(av_write_frame(m_formatCtx, &packet) < 0)
|
||||||
{
|
{
|
||||||
av_free_packet(m_packet);
|
av_free_packet(&packet);
|
||||||
|
av_frame_free(&frame);
|
||||||
AUD_THROW(FileException, "Frame couldn't be writen to the file with ffmpeg.");
|
AUD_THROW(FileException, "Frame couldn't be writen to the file with ffmpeg.");
|
||||||
}
|
}
|
||||||
av_free_packet(m_packet);
|
av_free_packet(&packet);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if(avcodec_send_frame(m_codecCtx, m_frame) < 0)
|
|
||||||
AUD_THROW(FileException, "File couldn't be written, audio encoding failed with ffmpeg.");
|
|
||||||
|
|
||||||
while(avcodec_receive_packet(m_codecCtx, m_packet) == 0)
|
av_frame_free(&frame);
|
||||||
{
|
|
||||||
m_packet->stream_index = m_stream->index;
|
|
||||||
|
|
||||||
if(av_write_frame(m_formatCtx, m_packet) < 0)
|
|
||||||
AUD_THROW(FileException, "Frame couldn't be writen to the file with ffmpeg.");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FFMPEGWriter::close()
|
void FFMPEGWriter::close()
|
||||||
{
|
{
|
||||||
#ifdef FFMPEG_OLD_CODE
|
|
||||||
int got_packet = true;
|
int got_packet = true;
|
||||||
|
|
||||||
while(got_packet)
|
while(got_packet)
|
||||||
{
|
{
|
||||||
m_packet->data = nullptr;
|
AVPacket packet;
|
||||||
m_packet->size = 0;
|
|
||||||
|
|
||||||
av_init_packet(m_packet);
|
packet.data = nullptr;
|
||||||
|
packet.size = 0;
|
||||||
|
|
||||||
if(avcodec_encode_audio2(m_codecCtx, m_packet, nullptr, &got_packet))
|
av_init_packet(&packet);
|
||||||
|
|
||||||
|
if(avcodec_encode_audio2(m_codecCtx, &packet, nullptr, &got_packet))
|
||||||
AUD_THROW(FileException, "File end couldn't be written, audio encoding failed with ffmpeg.");
|
AUD_THROW(FileException, "File end couldn't be written, audio encoding failed with ffmpeg.");
|
||||||
|
|
||||||
if(got_packet)
|
if(got_packet)
|
||||||
{
|
{
|
||||||
m_packet->flags |= AV_PKT_FLAG_KEY;
|
packet.flags |= AV_PKT_FLAG_KEY;
|
||||||
m_packet->stream_index = m_stream->index;
|
packet.stream_index = m_stream->index;
|
||||||
if(av_write_frame(m_formatCtx, m_packet))
|
if(av_write_frame(m_formatCtx, &packet))
|
||||||
{
|
{
|
||||||
av_free_packet(m_packet);
|
av_free_packet(&packet);
|
||||||
AUD_THROW(FileException, "Final frames couldn't be writen to the file with ffmpeg.");
|
AUD_THROW(FileException, "Final frames couldn't be writen to the file with ffmpeg.");
|
||||||
}
|
}
|
||||||
av_free_packet(m_packet);
|
av_free_packet(&packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if(avcodec_send_frame(m_codecCtx, nullptr) < 0)
|
|
||||||
AUD_THROW(FileException, "File couldn't be written, audio encoding failed with ffmpeg.");
|
|
||||||
|
|
||||||
while(avcodec_receive_packet(m_codecCtx, m_packet) == 0)
|
|
||||||
{
|
|
||||||
m_packet->stream_index = m_stream->index;
|
|
||||||
|
|
||||||
if(av_write_frame(m_formatCtx, m_packet) < 0)
|
|
||||||
AUD_THROW(FileException, "Frame couldn't be writen to the file with ffmpeg.");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container format, Codec codec, unsigned int bitrate) :
|
FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container format, Codec codec, unsigned int bitrate) :
|
||||||
m_position(0),
|
m_position(0),
|
||||||
m_specs(specs),
|
m_specs(specs),
|
||||||
m_formatCtx(nullptr),
|
|
||||||
m_codecCtx(nullptr),
|
|
||||||
m_stream(nullptr),
|
|
||||||
m_packet(nullptr),
|
|
||||||
m_frame(nullptr),
|
|
||||||
m_input_samples(0),
|
m_input_samples(0),
|
||||||
m_deinterleave(false)
|
m_deinterleave(false)
|
||||||
{
|
{
|
||||||
@@ -170,105 +142,75 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
|
|||||||
if(avformat_alloc_output_context2(&m_formatCtx, nullptr, formats[format], filename.c_str()) < 0)
|
if(avformat_alloc_output_context2(&m_formatCtx, nullptr, formats[format], filename.c_str()) < 0)
|
||||||
AUD_THROW(FileException, "File couldn't be written, format couldn't be found with ffmpeg.");
|
AUD_THROW(FileException, "File couldn't be written, format couldn't be found with ffmpeg.");
|
||||||
|
|
||||||
AVOutputFormat* outputFmt = m_formatCtx->oformat;
|
m_outputFmt = m_formatCtx->oformat;
|
||||||
|
|
||||||
if(!outputFmt) {
|
if(!m_outputFmt) {
|
||||||
avformat_free_context(m_formatCtx);
|
avformat_free_context(m_formatCtx);
|
||||||
AUD_THROW(FileException, "File couldn't be written, output format couldn't be found with ffmpeg.");
|
AUD_THROW(FileException, "File couldn't be written, output format couldn't be found with ffmpeg.");
|
||||||
}
|
}
|
||||||
|
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_NONE;
|
m_outputFmt->audio_codec = AV_CODEC_ID_NONE;
|
||||||
|
|
||||||
switch(codec)
|
switch(codec)
|
||||||
{
|
{
|
||||||
case CODEC_AAC:
|
case CODEC_AAC:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_AAC;
|
m_outputFmt->audio_codec = AV_CODEC_ID_AAC;
|
||||||
break;
|
break;
|
||||||
case CODEC_AC3:
|
case CODEC_AC3:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_AC3;
|
m_outputFmt->audio_codec = AV_CODEC_ID_AC3;
|
||||||
break;
|
break;
|
||||||
case CODEC_FLAC:
|
case CODEC_FLAC:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_FLAC;
|
m_outputFmt->audio_codec = AV_CODEC_ID_FLAC;
|
||||||
break;
|
break;
|
||||||
case CODEC_MP2:
|
case CODEC_MP2:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_MP2;
|
m_outputFmt->audio_codec = AV_CODEC_ID_MP2;
|
||||||
break;
|
break;
|
||||||
case CODEC_MP3:
|
case CODEC_MP3:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_MP3;
|
m_outputFmt->audio_codec = AV_CODEC_ID_MP3;
|
||||||
break;
|
break;
|
||||||
case CODEC_OPUS:
|
case CODEC_OPUS:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_OPUS;
|
m_outputFmt->audio_codec = AV_CODEC_ID_OPUS;
|
||||||
break;
|
break;
|
||||||
case CODEC_PCM:
|
case CODEC_PCM:
|
||||||
switch(specs.format)
|
switch(specs.format)
|
||||||
{
|
{
|
||||||
case FORMAT_U8:
|
case FORMAT_U8:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_PCM_U8;
|
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_U8;
|
||||||
break;
|
break;
|
||||||
case FORMAT_S16:
|
case FORMAT_S16:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_PCM_S16LE;
|
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_S16LE;
|
||||||
break;
|
break;
|
||||||
case FORMAT_S24:
|
case FORMAT_S24:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_PCM_S24LE;
|
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_S24LE;
|
||||||
break;
|
break;
|
||||||
case FORMAT_S32:
|
case FORMAT_S32:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_PCM_S32LE;
|
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_S32LE;
|
||||||
break;
|
break;
|
||||||
case FORMAT_FLOAT32:
|
case FORMAT_FLOAT32:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_PCM_F32LE;
|
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_F32LE;
|
||||||
break;
|
break;
|
||||||
case FORMAT_FLOAT64:
|
case FORMAT_FLOAT64:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_PCM_F64LE;
|
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_F64LE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_NONE;
|
m_outputFmt->audio_codec = AV_CODEC_ID_NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CODEC_VORBIS:
|
case CODEC_VORBIS:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_VORBIS;
|
m_outputFmt->audio_codec = AV_CODEC_ID_VORBIS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
outputFmt->audio_codec = AV_CODEC_ID_NONE;
|
m_outputFmt->audio_codec = AV_CODEC_ID_NONE;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t channel_layout = 0;
|
|
||||||
|
|
||||||
switch(m_specs.channels)
|
|
||||||
{
|
|
||||||
case CHANNELS_MONO:
|
|
||||||
channel_layout = AV_CH_LAYOUT_MONO;
|
|
||||||
break;
|
|
||||||
case CHANNELS_STEREO:
|
|
||||||
channel_layout = AV_CH_LAYOUT_STEREO;
|
|
||||||
break;
|
|
||||||
case CHANNELS_STEREO_LFE:
|
|
||||||
channel_layout = AV_CH_LAYOUT_2POINT1;
|
|
||||||
break;
|
|
||||||
case CHANNELS_SURROUND4:
|
|
||||||
channel_layout = AV_CH_LAYOUT_QUAD;
|
|
||||||
break;
|
|
||||||
case CHANNELS_SURROUND5:
|
|
||||||
channel_layout = AV_CH_LAYOUT_5POINT0_BACK;
|
|
||||||
break;
|
|
||||||
case CHANNELS_SURROUND51:
|
|
||||||
channel_layout = AV_CH_LAYOUT_5POINT1_BACK;
|
|
||||||
break;
|
|
||||||
case CHANNELS_SURROUND61:
|
|
||||||
channel_layout = AV_CH_LAYOUT_6POINT1_BACK;
|
|
||||||
break;
|
|
||||||
case CHANNELS_SURROUND71:
|
|
||||||
channel_layout = AV_CH_LAYOUT_7POINT1;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(outputFmt->audio_codec == AV_CODEC_ID_NONE)
|
if(m_outputFmt->audio_codec == AV_CODEC_ID_NONE)
|
||||||
AUD_THROW(FileException, "File couldn't be written, audio codec not found with ffmpeg.");
|
AUD_THROW(FileException, "File couldn't be written, audio codec not found with ffmpeg.");
|
||||||
|
|
||||||
AVCodec* codec = avcodec_find_encoder(outputFmt->audio_codec);
|
AVCodec* codec = avcodec_find_encoder(m_outputFmt->audio_codec);
|
||||||
if(!codec)
|
if(!codec)
|
||||||
AUD_THROW(FileException, "File couldn't be written, audio encoder couldn't be found with ffmpeg.");
|
AUD_THROW(FileException, "File couldn't be written, audio encoder couldn't be found with ffmpeg.");
|
||||||
|
|
||||||
@@ -278,14 +220,7 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
|
|||||||
|
|
||||||
m_stream->id = m_formatCtx->nb_streams - 1;
|
m_stream->id = m_formatCtx->nb_streams - 1;
|
||||||
|
|
||||||
#ifdef FFMPEG_OLD_CODE
|
|
||||||
m_codecCtx = m_stream->codec;
|
m_codecCtx = m_stream->codec;
|
||||||
#else
|
|
||||||
m_codecCtx = avcodec_alloc_context3(codec);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(!m_codecCtx)
|
|
||||||
AUD_THROW(FileException, "File couldn't be written, context creation failed with ffmpeg.");
|
|
||||||
|
|
||||||
switch(m_specs.format)
|
switch(m_specs.format)
|
||||||
{
|
{
|
||||||
@@ -312,7 +247,7 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(m_formatCtx->oformat->flags & AVFMT_GLOBALHEADER)
|
if(m_formatCtx->oformat->flags & AVFMT_GLOBALHEADER)
|
||||||
m_codecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
|
m_codecCtx->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||||
|
|
||||||
bool format_supported = false;
|
bool format_supported = false;
|
||||||
|
|
||||||
@@ -393,13 +328,9 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
|
|||||||
|
|
||||||
m_specs.rate = m_codecCtx->sample_rate;
|
m_specs.rate = m_codecCtx->sample_rate;
|
||||||
|
|
||||||
#ifdef FFMPEG_OLD_CODE
|
m_codecCtx->codec_id = m_outputFmt->audio_codec;
|
||||||
m_codecCtx->codec_id = outputFmt->audio_codec;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_codecCtx->codec_type = AVMEDIA_TYPE_AUDIO;
|
m_codecCtx->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||||
m_codecCtx->bit_rate = bitrate;
|
m_codecCtx->bit_rate = bitrate;
|
||||||
m_codecCtx->channel_layout = channel_layout;
|
|
||||||
m_codecCtx->channels = m_specs.channels;
|
m_codecCtx->channels = m_specs.channels;
|
||||||
m_stream->time_base.num = m_codecCtx->time_base.num = 1;
|
m_stream->time_base.num = m_codecCtx->time_base.num = 1;
|
||||||
m_stream->time_base.den = m_codecCtx->time_base.den = m_codecCtx->sample_rate;
|
m_stream->time_base.den = m_codecCtx->time_base.den = m_codecCtx->sample_rate;
|
||||||
@@ -407,11 +338,6 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
|
|||||||
if(avcodec_open2(m_codecCtx, codec, nullptr) < 0)
|
if(avcodec_open2(m_codecCtx, codec, nullptr) < 0)
|
||||||
AUD_THROW(FileException, "File couldn't be written, encoder couldn't be opened with ffmpeg.");
|
AUD_THROW(FileException, "File couldn't be written, encoder couldn't be opened with ffmpeg.");
|
||||||
|
|
||||||
#ifndef FFMPEG_OLD_CODE
|
|
||||||
if(avcodec_parameters_from_context(m_stream->codecpar, m_codecCtx) < 0)
|
|
||||||
AUD_THROW(FileException, "File couldn't be written, codec parameters couldn't be copied to the context.");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int samplesize = std::max(int(AUD_SAMPLE_SIZE(m_specs)), AUD_DEVICE_SAMPLE_SIZE(m_specs));
|
int samplesize = std::max(int(AUD_SAMPLE_SIZE(m_specs)), AUD_DEVICE_SAMPLE_SIZE(m_specs));
|
||||||
|
|
||||||
if((m_input_size = m_codecCtx->frame_size))
|
if((m_input_size = m_codecCtx->frame_size))
|
||||||
@@ -420,26 +346,13 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
|
|||||||
if(avio_open(&m_formatCtx->pb, filename.c_str(), AVIO_FLAG_WRITE))
|
if(avio_open(&m_formatCtx->pb, filename.c_str(), AVIO_FLAG_WRITE))
|
||||||
AUD_THROW(FileException, "File couldn't be written, file opening failed with ffmpeg.");
|
AUD_THROW(FileException, "File couldn't be written, file opening failed with ffmpeg.");
|
||||||
|
|
||||||
if(avformat_write_header(m_formatCtx, nullptr) < 0)
|
avformat_write_header(m_formatCtx, nullptr);
|
||||||
AUD_THROW(FileException, "File couldn't be written, writing the header failed.");
|
|
||||||
}
|
}
|
||||||
catch(Exception&)
|
catch(Exception&)
|
||||||
{
|
{
|
||||||
#ifndef FFMPEG_OLD_CODE
|
|
||||||
if(m_codecCtx)
|
|
||||||
avcodec_free_context(&m_codecCtx);
|
|
||||||
#endif
|
|
||||||
avformat_free_context(m_formatCtx);
|
avformat_free_context(m_formatCtx);
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FFMPEG_OLD_CODE
|
|
||||||
m_packet = new AVPacket({});
|
|
||||||
#else
|
|
||||||
m_packet = av_packet_alloc();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_frame = av_frame_alloc();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FFMPEGWriter::~FFMPEGWriter()
|
FFMPEGWriter::~FFMPEGWriter()
|
||||||
@@ -452,26 +365,9 @@ FFMPEGWriter::~FFMPEGWriter()
|
|||||||
|
|
||||||
av_write_trailer(m_formatCtx);
|
av_write_trailer(m_formatCtx);
|
||||||
|
|
||||||
if(m_frame)
|
|
||||||
av_frame_free(&m_frame);
|
|
||||||
|
|
||||||
if(m_packet)
|
|
||||||
{
|
|
||||||
#ifdef FFMPEG_OLD_CODE
|
|
||||||
delete m_packet;
|
|
||||||
#else
|
|
||||||
av_packet_free(&m_packet);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef FFMPEG_OLD_CODE
|
|
||||||
avcodec_close(m_codecCtx);
|
avcodec_close(m_codecCtx);
|
||||||
#else
|
|
||||||
if(m_codecCtx)
|
|
||||||
avcodec_free_context(&m_codecCtx);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
avio_closep(&m_formatCtx->pb);
|
avio_close(m_formatCtx->pb);
|
||||||
avformat_free_context(m_formatCtx);
|
avformat_free_context(m_formatCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
15
extern/audaspace/plugins/ffmpeg/FFMPEGWriter.h
vendored
15
extern/audaspace/plugins/ffmpeg/FFMPEGWriter.h
vendored
@@ -65,21 +65,16 @@ private:
|
|||||||
*/
|
*/
|
||||||
AVCodecContext* m_codecCtx;
|
AVCodecContext* m_codecCtx;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The AVOutputFormat structure for using ffmpeg.
|
||||||
|
*/
|
||||||
|
AVOutputFormat* m_outputFmt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The AVStream structure for using ffmpeg.
|
* The AVStream structure for using ffmpeg.
|
||||||
*/
|
*/
|
||||||
AVStream* m_stream;
|
AVStream* m_stream;
|
||||||
|
|
||||||
/**
|
|
||||||
* The AVPacket structure for using ffmpeg.
|
|
||||||
*/
|
|
||||||
AVPacket* m_packet;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The AVFrame structure for using ffmpeg.
|
|
||||||
*/
|
|
||||||
AVFrame* m_frame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The input buffer for the format converted data before encoding.
|
* The input buffer for the format converted data before encoding.
|
||||||
*/
|
*/
|
||||||
|
31
extern/bullet2/patches/blender.patch
vendored
31
extern/bullet2/patches/blender.patch
vendored
@@ -1,34 +1,3 @@
|
|||||||
diff --git a/extern/bullet2/src/LinearMath/btScalar.h b/extern/bullet2/src/LinearMath/btScalar.h
|
|
||||||
--- a/extern/bullet2/src/LinearMath/btScalar.h
|
|
||||||
+++ b/extern/bullet2/src/LinearMath/btScalar.h
|
|
||||||
@@ -16,6 +16,9 @@
|
|
||||||
|
|
||||||
#ifndef BT_SCALAR_H
|
|
||||||
#define BT_SCALAR_H
|
|
||||||
+#if defined(_MSC_VER) && defined(__clang__) /* clang supplies it's own overloads already */
|
|
||||||
+#define BT_NO_SIMD_OPERATOR_OVERLOADS
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
#ifdef BT_MANAGED_CODE
|
|
||||||
//Aligned data types not supported in managed code
|
|
||||||
@@ -83,7 +86,7 @@
|
|
||||||
#ifdef BT_USE_SSE
|
|
||||||
|
|
||||||
#if (_MSC_FULL_VER >= 170050727)//Visual Studio 2012 can compile SSE4/FMA3 (but SSE4/FMA3 is not enabled by default)
|
|
||||||
- #define BT_ALLOW_SSE4
|
|
||||||
+ //#define BT_ALLOW_SSE4 //disable this cause blender targets sse2
|
|
||||||
#endif //(_MSC_FULL_VER >= 160040219)
|
|
||||||
|
|
||||||
//BT_USE_SSE_IN_API is disabled under Windows by default, because
|
|
||||||
@@ -102,7 +105,7 @@
|
|
||||||
#endif //__MINGW32__
|
|
||||||
|
|
||||||
#ifdef BT_DEBUG
|
|
||||||
- #ifdef _MSC_VER
|
|
||||||
+ #if defined(_MSC_VER) && !defined(__clang__)
|
|
||||||
#include <stdio.h>
|
|
||||||
#define btAssert(x) { if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);__debugbreak(); }}
|
|
||||||
#else//_MSC_VER
|
|
||||||
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
|
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
|
||||||
index be9eca6..ec40c96 100644
|
index be9eca6..ec40c96 100644
|
||||||
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
|
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
|
||||||
|
7
extern/bullet2/src/LinearMath/btScalar.h
vendored
7
extern/bullet2/src/LinearMath/btScalar.h
vendored
@@ -16,9 +16,6 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
#ifndef BT_SCALAR_H
|
#ifndef BT_SCALAR_H
|
||||||
#define BT_SCALAR_H
|
#define BT_SCALAR_H
|
||||||
#if defined(_MSC_VER) && defined(__clang__) /* clang supplies it's own overloads already */
|
|
||||||
#define BT_NO_SIMD_OPERATOR_OVERLOADS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BT_MANAGED_CODE
|
#ifdef BT_MANAGED_CODE
|
||||||
//Aligned data types not supported in managed code
|
//Aligned data types not supported in managed code
|
||||||
@@ -86,7 +83,7 @@ inline int btGetVersion()
|
|||||||
#ifdef BT_USE_SSE
|
#ifdef BT_USE_SSE
|
||||||
|
|
||||||
#if (_MSC_FULL_VER >= 170050727)//Visual Studio 2012 can compile SSE4/FMA3 (but SSE4/FMA3 is not enabled by default)
|
#if (_MSC_FULL_VER >= 170050727)//Visual Studio 2012 can compile SSE4/FMA3 (but SSE4/FMA3 is not enabled by default)
|
||||||
//#define BT_ALLOW_SSE4 //disable this cause blender targets sse2
|
#define BT_ALLOW_SSE4
|
||||||
#endif //(_MSC_FULL_VER >= 160040219)
|
#endif //(_MSC_FULL_VER >= 160040219)
|
||||||
|
|
||||||
//BT_USE_SSE_IN_API is disabled under Windows by default, because
|
//BT_USE_SSE_IN_API is disabled under Windows by default, because
|
||||||
@@ -105,7 +102,7 @@ inline int btGetVersion()
|
|||||||
#endif //__MINGW32__
|
#endif //__MINGW32__
|
||||||
|
|
||||||
#ifdef BT_DEBUG
|
#ifdef BT_DEBUG
|
||||||
#if defined(_MSC_VER) && !defined(__clang__)
|
#ifdef _MSC_VER
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define btAssert(x) { if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);__debugbreak(); }}
|
#define btAssert(x) { if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);__debugbreak(); }}
|
||||||
#else//_MSC_VER
|
#else//_MSC_VER
|
||||||
|
9
extern/clew/CMakeLists.txt
vendored
9
extern/clew/CMakeLists.txt
vendored
@@ -40,12 +40,3 @@ set(SRC
|
|||||||
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_1_APIS)
|
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_1_APIS)
|
||||||
|
|
||||||
blender_add_lib(extern_clew "${SRC}" "${INC}" "${INC_SYS}")
|
blender_add_lib(extern_clew "${SRC}" "${INC}" "${INC_SYS}")
|
||||||
|
|
||||||
add_executable(cl_query src/cl_query.cc)
|
|
||||||
target_link_libraries(cl_query extern_clew ${CMAKE_DL_LIBS})
|
|
||||||
|
|
||||||
if(APPLE)
|
|
||||||
install(TARGETS cl_query DESTINATION "blender-benchmark.app/Contents/Resources/bin")
|
|
||||||
else()
|
|
||||||
install(TARGETS cl_query DESTINATION "bin")
|
|
||||||
endif()
|
|
||||||
|
119
extern/clew/src/cl_query.cc
vendored
119
extern/clew/src/cl_query.cc
vendored
@@ -1,119 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2011-2015 Blender Foundation
|
|
||||||
*
|
|
||||||
* 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 <cstdlib>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include "clew.h"
|
|
||||||
|
|
||||||
using std::string;
|
|
||||||
using std::vector;
|
|
||||||
#define foreach(x, y) for(x : y)
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
// Get all platform IDs.
|
|
||||||
bool getPlatformIDs(vector<cl_platform_id>* platform_ids) {
|
|
||||||
cl_uint num_platforms = 0;
|
|
||||||
if (clGetPlatformIDs(0, NULL, &num_platforms) != CL_SUCCESS) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
platform_ids->resize(num_platforms);
|
|
||||||
if (clGetPlatformIDs(
|
|
||||||
num_platforms, &(*platform_ids)[0], NULL) != CL_SUCCESS) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get device IDs for the given platform.
|
|
||||||
bool getPlatformDeviceIDs(cl_platform_id platform_id,
|
|
||||||
vector<cl_device_id>* device_ids) {
|
|
||||||
cl_uint num_devices = 0;
|
|
||||||
if (clGetDeviceIDs(
|
|
||||||
platform_id, CL_DEVICE_TYPE_GPU, 0, NULL, &num_devices) != CL_SUCCESS) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
device_ids->resize(num_devices);
|
|
||||||
if (num_devices == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (clGetDeviceIDs(platform_id,
|
|
||||||
CL_DEVICE_TYPE_ALL,
|
|
||||||
num_devices,
|
|
||||||
&(*device_ids)[0],
|
|
||||||
NULL) != CL_SUCCESS) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
int result = clewInit();
|
|
||||||
if (result != CLEW_SUCCESS) {
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
// Get all platform IDs.
|
|
||||||
vector<cl_platform_id> platform_ids;
|
|
||||||
if (!getPlatformIDs(&platform_ids)) {
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
foreach (cl_platform_id platform_id, platform_ids) {
|
|
||||||
vector<cl_device_id> device_ids;
|
|
||||||
if (!getPlatformDeviceIDs(platform_id, &device_ids)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
foreach (cl_device_id device_id, device_ids) {
|
|
||||||
string name;
|
|
||||||
char board_name[1024] = "\0";
|
|
||||||
size_t board_length = 0;
|
|
||||||
if (clGetDeviceInfo(device_id,
|
|
||||||
CL_DEVICE_BOARD_NAME_AMD,
|
|
||||||
sizeof(board_name), board_name,
|
|
||||||
&board_length) == CL_SUCCESS) {
|
|
||||||
if (board_length != 0 && board_name[0] != '\0') {
|
|
||||||
name = board_name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (name.empty()) {
|
|
||||||
char device_name[1024] = "\0";
|
|
||||||
if (clGetDeviceInfo(device_id,
|
|
||||||
CL_DEVICE_NAME,
|
|
||||||
sizeof(device_name), device_name,
|
|
||||||
NULL) == CL_SUCCESS) {
|
|
||||||
name = device_name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (name.empty()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
cl_int max_compute_units = 0;
|
|
||||||
if (clGetDeviceInfo(device_id,
|
|
||||||
CL_DEVICE_MAX_COMPUTE_UNITS,
|
|
||||||
sizeof(max_compute_units),
|
|
||||||
&max_compute_units,
|
|
||||||
NULL) != CL_SUCCESS) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
printf("%s:%d\n", name.c_str(), max_compute_units);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
1
extern/rangetree/CMakeLists.txt
vendored
1
extern/rangetree/CMakeLists.txt
vendored
@@ -28,3 +28,4 @@ set(SRC
|
|||||||
)
|
)
|
||||||
|
|
||||||
blender_add_lib(extern_rangetree "${SRC}" "${INC}" "")
|
blender_add_lib(extern_rangetree "${SRC}" "${INC}" "")
|
||||||
|
|
||||||
|
8
extern/xdnd/xdnd.c
vendored
8
extern/xdnd/xdnd.c
vendored
@@ -121,10 +121,10 @@ char *xdnd_debug_milliseconds (void)
|
|||||||
#define dnd_debug3(a,b,c) printf("%s: %d: %s: " a "\n", __FILE__, __LINE__, xdnd_debug_milliseconds (), b, c)
|
#define dnd_debug3(a,b,c) printf("%s: %d: %s: " a "\n", __FILE__, __LINE__, xdnd_debug_milliseconds (), b, c)
|
||||||
#define dnd_debug4(a,b,c,d) printf("%s: %d: %s: " a "\n", __FILE__, __LINE__, xdnd_debug_milliseconds (), b, c, d)
|
#define dnd_debug4(a,b,c,d) printf("%s: %d: %s: " a "\n", __FILE__, __LINE__, xdnd_debug_milliseconds (), b, c, d)
|
||||||
#else
|
#else
|
||||||
#define dnd_debug1(a) do {} while (0)
|
#define dnd_debug1(a)
|
||||||
#define dnd_debug2(a,b) do {} while (0)
|
#define dnd_debug2(a,b)
|
||||||
#define dnd_debug3(a,b,c) do {} while (0)
|
#define dnd_debug3(a,b,c)
|
||||||
#define dnd_debug4(a,b,c,d) do {} while (0)
|
#define dnd_debug4(a,b,c,d)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define dnd_warning(a) fprintf (stderr, a)
|
#define dnd_warning(a) fprintf (stderr, a)
|
||||||
|
@@ -34,6 +34,7 @@ add_subdirectory(opencolorio)
|
|||||||
add_subdirectory(mikktspace)
|
add_subdirectory(mikktspace)
|
||||||
add_subdirectory(glew-mx)
|
add_subdirectory(glew-mx)
|
||||||
add_subdirectory(eigen)
|
add_subdirectory(eigen)
|
||||||
|
add_subdirectory(gawain)
|
||||||
|
|
||||||
if(WITH_AUDASPACE)
|
if(WITH_AUDASPACE)
|
||||||
add_subdirectory(audaspace)
|
add_subdirectory(audaspace)
|
||||||
|
@@ -40,11 +40,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
|
|
||||||
#if defined (__clang__)
|
/******************************************************************************/
|
||||||
# pragma GCC diagnostic push
|
|
||||||
# pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* 64-bit operations. */
|
/* 64-bit operations. */
|
||||||
#if (LG_SIZEOF_PTR == 8 || LG_SIZEOF_INT == 8)
|
#if (LG_SIZEOF_PTR == 8 || LG_SIZEOF_INT == 8)
|
||||||
/* Unsigned */
|
/* Unsigned */
|
||||||
@@ -209,9 +205,4 @@ ATOMIC_INLINE int8_t atomic_fetch_and_or_int8(int8_t *p, int8_t b)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined (__clang__)
|
|
||||||
# pragma GCC diagnostic pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __ATOMIC_OPS_MSVC_H__ */
|
#endif /* __ATOMIC_OPS_MSVC_H__ */
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user