Merge branch 'master' into blender2.8
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 11 Sep 2018 06:03:31 +0000 (08:03 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 11 Sep 2018 06:03:31 +0000 (08:03 +0200)
12 files changed:
build_files/build_environment/CMakeLists.txt
build_files/build_environment/cmake/harvest.cmake
build_files/build_environment/cmake/opencollada.cmake
build_files/build_environment/cmake/openvdb.cmake
build_files/build_environment/cmake/osl.cmake
build_files/build_environment/cmake/python.cmake
build_files/build_environment/cmake/ssl.cmake
build_files/build_environment/cmake/ssl.conf
build_files/build_environment/cmake/zlib.cmake
build_files/build_environment/patches/opencolorio.diff
build_files/build_environment/patches/sdl.diff
build_files/cmake/platform/platform_apple.cmake

index 5270a2e2b3daee0a458f4036e683462ed49a965e..00e486bbb407acc613123916e37dfe76c87ed105 100644 (file)
 ####################################################################################################
 #
 # This is a build system used by platform maintainers to build library dependencies on
-# Windows and macOS. There is some support for Linux as well, but not ready for releases.
+# Windows, macOS and Linux.
 #
-# Windows and macOS users should download the precompiled libraries in lib/, Linux users
-# should run install_deps.sh for building dependencies.
+# For users building Blender, we recommend using the precompiled libraries from lib/ on
+# Windows and macOS, and install_deps.sh on Linux.
 #
 # WINDOWS USAGE:
 #   Don't call this cmake file your self, use build_deps.cmd
@@ -30,7 +30,7 @@
 #   build_deps 2015 x64 / build_deps 2015 x86
 #
 # MAC OS X USAGE:
-#      Install with homebrew: brew install autoconf automake libtool yasm openssl xz
+#      Install with homebrew: brew install autoconf automake libtool yasm nasm
 #   Run "make deps" from main Blender directory
 #
 # LINUX USAGE:
@@ -96,14 +96,16 @@ include(cmake/pugixml.cmake)
 if(WITH_WEBP)
        include(cmake/webp.cmake)
 endif()
+
 if(WIN32)
-       #hmd_branch_deps
+       # HMD branch deps
        include(cmake/hidapi.cmake)
-       #ocio deps
+       # OCIO deps
        include(cmake/tinyxml.cmake)
        include(cmake/yamlcpp.cmake)
-       #lcms is an ocio dep, but only if you build the apps, leaving it here for convenience
+       # LCMS is an OCIO dep, but only if you build the apps, leaving it here for convenience
        #include(cmake/lcms.cmake)
+
 endif()
 
 if(NOT WIN32 OR ENABLE_MINGW64)
@@ -128,16 +130,16 @@ if(NOT WIN32 OR ENABLE_MINGW64)
                endif()
                if(UNIX)
                        include(cmake/flac.cmake)
+                       include(cmake/xml2.cmake)
                        if(NOT APPLE)
                                include(cmake/spnav.cmake)
                                include(cmake/jemalloc.cmake)
-                               include(cmake/xml2.cmake)
                        endif()
                endif()
        endif()
 endif()
 
-if(UNIX AND NOT APPLE)
+if(UNIX)
        include(cmake/bzip2.cmake)
        include(cmake/ffi.cmake)
        include(cmake/lzma.cmake)
index d47a5e65d3c9a7e4ad849a5ed9bf7c70a4c39232..4ec71bf2ed28f1b4cd8d5878d4d6a24606f9a4de 100644 (file)
@@ -110,6 +110,7 @@ endfunction()
 
 harvest(alembic/include alembic/include "*.h")
 harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
+harvest(alembic/bin alembic/bin "*")
 harvest(boost/include boost/include "*")
 harvest(boost/lib boost/lib "*.a")
 harvest(ffmpeg/include ffmpeg/include "*.h")
index 2f5360ba958ff1ba2e09ad4bd5aa12d645d0911a..c9aee2bfe64fae0a8a14655a67143af3954d4b2e 100644 (file)
@@ -16,7 +16,7 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
-if(UNIX AND NOT APPLE)
+if(UNIX)
        set(OPENCOLLADA_EXTRA_ARGS
                -DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
                -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2.a)
@@ -32,7 +32,7 @@ ExternalProject_Add(external_opencollada
        INSTALL_DIR ${LIBDIR}/opencollada
 )
 
-if(UNIX AND NOT APPLE)
+if(UNIX)
        add_dependencies(
                external_opencollada
                external_xml2
@@ -62,4 +62,4 @@ if(WIN32)
                        DEPENDEES install
                )
        endif()
-endif()
\ No newline at end of file
+endif()
index a550ed5decbc92178ff9481246c91ea2dd4c073e..125c1b2df85004155afe1ef0d31d3b725bf52bfd 100644 (file)
@@ -29,9 +29,7 @@ set(OPENVDB_EXTRA_ARGS
        -DBoost_NO_SYSTEM_PATHS=ON
        -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
        -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-       -DWITH_BLOSC=ON
        -DBLOSC_INCLUDE_DIR=${LIBDIR}/blosc/include/
-       -DBLOSC_LIBRARY=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT}
        -DBLOSC_blosc_LIBRARY=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT}
        -DOPENVDB_ENABLE_3_ABI_COMPATIBLE=OFF
        -DOPENVDB_BUILD_UNITTESTS=Off
@@ -48,7 +46,6 @@ set(OPENVDB_EXTRA_ARGS
        -DOpenexr_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
        -DTBB_LIBRARYDIR=${LIBDIR}/tbb/lib
        -DTbb_TBB_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
-       -DTBB_LIBRARY_DIR=${LIBDIR}/tbb/lib
        -DTBB_LIBRARY_PATH=${LIBDIR}/tbb/lib
 )
 
index eaf6a62d18a8ae3c537655fbc5eac788a3427b90..795892f29e2d4dd5a6b91c2098bcd448ed1754e6 100644 (file)
@@ -77,10 +77,17 @@ set(OSL_EXTRA_ARGS
 )
 
 if(WIN32)
-set(OSL_EXTRA_ARGS
-       ${OSL_EXTRA_FLAGS}
-       -DPUGIXML_HOME=${LIBDIR}/pugixml
-)
+       set(OSL_EXTRA_ARGS
+               ${OSL_EXTRA_ARGS}
+               -DPUGIXML_HOME=${LIBDIR}/pugixml
+       )
+elseif(APPLE)
+       # Make symbol hiding consistent with OIIO which defaults to OFF,
+       # avoids linker warnings on macOS
+       set(OSL_EXTRA_ARGS
+               ${OSL_EXTRA_ARGS}
+               -DHIDE_SYMBOLS=OFF
+       )
 endif()
 
 ExternalProject_Add(external_osl
index 22b4052189ee193267ab9e031b914d181a8ca266..c61a0084b6f03ed9abdd5a007e39c64d594dd756 100644 (file)
@@ -67,9 +67,6 @@ if(WIN32)
        message("POutput = ${PYTHON_OUTPUTDIR}")
 else()
        if(APPLE)
-               # we need to add homebrew pkgconfig directories to get ssl, xz
-
-                set(BREW_PKG_CONFIG "/usr/local/opt/openssl/lib/pkgconfig:/usr/local/opt/xz/lib/pkgconfig")
                # disable functions that can be in 10.13 sdk but aren't available on 10.9 target
                set(PYTHON_FUNC_CONFIGS
                  export ac_cv_func_futimens=no &&
@@ -83,25 +80,22 @@ else()
                  export ac_cv_func_mkostemp=no &&
                  export ac_cv_func_mkostemps=no &&
                  export ac_cv_func_timingsafe_bcmp=no)
-
-               set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV} && export PKG_CONFIG_PATH=${BREW_PKG_CONFIG} && ${PYTHON_FUNC_CONFIGS})
+               set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV} && ${PYTHON_FUNC_CONFIGS})
                set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python.exe)
-               set(PYTHON_PATCH echo .)
-               set(PYTHON_CONFIGURE_EXTRA_ENV echo .)
-               set(PYTHON_CONFIGURE_EXTRA_ARGS)
        else()
-               set(PYTHON_CONFIGURE_EXTRA_ARGS "--with-openssl=${LIBDIR}/ssl")
                set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV})
-               set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include")
-               set(PYTHON_LDFLAGS "-L${LIBDIR}/sqlite/lib -L${LIBDIR}/bzip2/lib -L${LIBDIR}/lzma/lib -L${LIBDIR}/zlib/lib")
-               set(PYTHON_CONFIGURE_EXTRA_ENV
-                       export CFLAGS=${PYTHON_CFLAGS} &&
-                       export CPPFLAGS=${PYTHON_CFLAGS} &&
-                       export LDFLAGS=${PYTHON_LDFLAGS})
                set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python)
-               set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_linux.diff)
        endif()
 
+       set(PYTHON_CONFIGURE_EXTRA_ARGS "--with-openssl=${LIBDIR}/ssl")
+       set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include")
+       set(PYTHON_LDFLAGS "-L${LIBDIR}/sqlite/lib -L${LIBDIR}/bzip2/lib -L${LIBDIR}/lzma/lib -L${LIBDIR}/zlib/lib")
+       set(PYTHON_CONFIGURE_EXTRA_ENV
+               export CFLAGS=${PYTHON_CFLAGS} &&
+               export CPPFLAGS=${PYTHON_CFLAGS} &&
+               export LDFLAGS=${PYTHON_LDFLAGS})
+       set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_linux.diff)
+
        ExternalProject_Add(external_python
                URL ${PYTHON_URI}
                DOWNLOAD_DIR ${DOWNLOAD_DIR}
@@ -172,7 +166,7 @@ if(MSVC)
        add_custom_target(Make_Python_Environment ALL DEPENDS ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe Package_Python)
 endif()
 
-if(UNIX AND NOT APPLE)
+if(UNIX)
        add_dependencies(
                external_python
                external_bzip2
index dd1b9957cc25325a160eb156cbce9e8c8344816a..993e6f3ff6a910509f81ffde4c6083910153f8e5 100644 (file)
 set(SSL_CONFIGURE_COMMAND ./Configure)
 set(SSL_PATCH_CMD echo .)
 
-if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
-       set(SSL_EXTRA_ARGS enable-ec_nistp_64_gcc_128)
-       set(SSL_OS_COMPILER "blender-x86_64")
+if (APPLE)
+       set(SSL_OS_COMPILER "blender-darwin-x86_64")
 else()
-       set(SSL_OS_COMPILER "blender-x86")
+       if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+               set(SSL_EXTRA_ARGS enable-ec_nistp_64_gcc_128)
+               set(SSL_OS_COMPILER "blender-linux-x86_64")
+       else()
+               set(SSL_OS_COMPILER "blender-linux-x86")
+       endif()
 endif()
 
 ExternalProject_Add(external_ssl
index a9534e56291d37b3bcec68b7edb085ca8db82224..91f4357f8d8711c09dcf89198554ce0e391e93b9 100644 (file)
@@ -1,10 +1,15 @@
 %targets = (
-  "blender-x86" => {
+
+  "blender-linux-x86" => {
     inherit_from     => [ "linux-x86" ],
     cflags => add("-fPIC"),
   },
-  "blender-x86_64" => {
+  "blender-linux-x86_64" => {
     inherit_from     => [ "linux-x86_64" ],
     cflags => add("-fPIC"),
   },
+  "blender-darwin-x86_64" => {
+    inherit_from     => [ "darwin64-x86_64-cc" ],
+    cflags => add("-fPIC"),
+  },
 );
index 7bf1c45e359fa9ec507355a8d957f5039117913e..396bb3a318e03045f8a34ebf5d61021dd6113593 100644 (file)
@@ -46,7 +46,7 @@ else()
                        DEPENDEES install
                )
        endif()
-       if (UNIX AND NOT APPLE)
+       if (UNIX)
                ExternalProject_Add_Step(external_zlib after_install
                        COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/libz.a ${LIBDIR}/zlib/lib/libz_pic.a
                        DEPENDEES install
index 65901f969ca2eae608a402d3fc11f407738b67b4..c76c62c105768a966a4a686457685f715679f580 100644 (file)
@@ -11,3 +11,23 @@ index 1eb691b..cff9bd8 100644
  endif()
  
  # SHARED
+--- a/CMakeLists.txt   2018-09-10 22:15:29.000000000 +0200
++++ b/CMakeLists.txt   2018-09-10 22:17:40.000000000 +0200
+@@ -229,7 +229,7 @@
+             PATCH_COMMAND   ${GIT_EXECUTABLE} apply --ignore-whitespace ${TINYXML_PATCHFILE}
+             BINARY_DIR      ext/build/tinyxml
+             INSTALL_DIR     ext/dist
+-            CMAKE_ARGS      ${TINYXML_CMAKE_ARGS}
++            CMAKE_ARGS      ${TINYXML_CMAKE_ARGS} -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+         )
+         if(WIN32)
+             set(TINYXML_STATIC_LIBRARIES  ${PROJECT_BINARY_DIR}/ext/dist/lib/tinyxml.lib)
+@@ -343,7 +343,7 @@
+             PATCH_COMMAND   ${GIT_EXECUTABLE} apply --ignore-whitespace ${YAML_CPP_PATCHFILE}
+             BINARY_DIR      ext/build/yaml-cpp
+             INSTALL_DIR     ext/dist
+-            CMAKE_ARGS      ${YAML_CPP_CMAKE_ARGS}
++            CMAKE_ARGS      ${YAML_CPP_CMAKE_ARGS} -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+         )
+         set(YAML_CPP_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ext/dist/include)
+         set(YAML_CPP_LIBRARY_DIRS ${PROJECT_BINARY_DIR}/ext/dist/lib)
index d0a3bca863d76aa18f783f94b219616f0ab576f3..742183ecb4c8a97d13a1c04cbb8383e2e6cf34cb 100644 (file)
@@ -1,4 +1,4 @@
-diff -ru /Users/brecht/dev/lib/deps/Downloads/SDL2-2.0.4/src/video/SDL_video.c ./src/video/SDL_video.c
+diff -ru ./src/video/SDL_video.c ./src/video/SDL_video.c
 --- CMakeLists.txt.old 2016-01-02 12:56:31 -0700
 +++ CMakeLists.txt     2016-10-03 11:24:24 -0600
 @@ -609,7 +609,7 @@
@@ -10,3 +10,23 @@ diff -ru /Users/brecht/dev/lib/deps/Downloads/SDL2-2.0.4/src/video/SDL_video.c .
      if(HAVE_LIBICONV)
        list(APPEND EXTRA_LIBS iconv)
        set(HAVE_ICONV 1)
+--- src/video/SDL_video.c      2018-09-10 23:27:57.000000000 +0200
++++ src/video/SDL_video.c      2018-09-10 23:28:09.000000000 +0200
+@@ -1176,7 +1176,7 @@
+         return 0;
+     }
+-#ifdef __MACOSX__
++#if defined(__MACOSX__) && SDL_VIDEO_DRIVER_COCOA
+     /* if the window is going away and no resolution change is necessary,
+        do nothing, or else we may trigger an ugly double-transition
+      */
+@@ -2563,7 +2563,7 @@
+         return SDL_FALSE;
+     }
+-#ifdef __MACOSX__
++#if defined(__MACOSX__) && SDL_VIDEO_DRIVER_COCOA
+     if (SDL_strcmp(_this->name, "cocoa") == 0) {  /* don't do this for X11, etc */
+         if (Cocoa_IsWindowInFullscreenSpace(window)) {
+             return SDL_FALSE;
index c2c2efd0fc9ee01fabaaff602f6c2e0b3f6a286c..d3267a09affcf0b47cd5f1499f94fba814cf12c6 100644 (file)
@@ -87,8 +87,8 @@ if(WITH_CODEC_SNDFILE)
 endif()
 
 if(WITH_PYTHON)
-       # we use precompiled libraries for py 3.5 and up by default
-       set(PYTHON_VERSION 3.6)
+       # we use precompiled libraries for py 3.7 and up by default
+       set(PYTHON_VERSION 3.7)
        if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
                # normally cached but not since we include them with blender
                set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m")
@@ -144,13 +144,12 @@ if(WITH_IMAGE_OPENEXR)
        set(OPENEXR ${LIBDIR}/openexr)
        set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
        set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR}/include/OpenEXR)
-       set(OPENEXR_POSTFIX -2_2)
        set(OPENEXR_LIBRARIES
-               Iex${OPENEXR_POSTFIX}
+               Iex
                Half
-               IlmImf${OPENEXR_POSTFIX}
-               Imath${OPENEXR_POSTFIX}
-               IlmThread${OPENEXR_POSTFIX})
+               IlmImf
+               Imath
+               IlmThread)
        set(OPENEXR_LIBPATH ${OPENEXR}/lib)
 endif()
 
@@ -159,12 +158,10 @@ if(WITH_CODEC_FFMPEG)
        set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
        set(FFMPEG_LIBRARIES
                avcodec avdevice avformat avutil
-               mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg
-               )
-             # commenting out until libs are updated on svn. schroedinger and orc
-             # will be removed then
-             # set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} vpx webp swresample)
-       set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} schroedinger orc vpx webp swresample)
+               mp3lame swscale x264 xvidcore
+               theora theoradec theoraenc
+               vorbis vorbisenc vorbisfile ogg
+               vpx swresample)
        set(FFMPEG_LIBPATH ${FFMPEG}/lib)
 endif()
 
@@ -173,9 +170,7 @@ if(WITH_IMAGE_OPENJPEG OR WITH_CODEC_FFMPEG)
        set(OPENJPEG ${LIBDIR}/openjpeg)
        set(WITH_SYSTEM_OPENJPEG ON)
        set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include)
-       # same as with ffmpeg libs, update when svn are updated
-       #set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/libopenjp2.a)
-       set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/libopenjpeg.a)
+       set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/libopenjp2.a)
 endif()
 
 find_library(SYSTEMSTUBS_LIBRARY
@@ -223,17 +218,14 @@ if(WITH_OPENCOLLADA)
                -lOpenCOLLADAStreamWriter
                -lMathMLSolver
                -lGeneratedSaxParser
-               -lxml2 -lbuffer -lftoa
+               -lbuffer -lftoa -lUTF
+               ${OPENCOLLADA_LIBPATH}/libxml2.a
        )
-       # Use UTF functions from collada if LLVM is not enabled
-       if(NOT WITH_LLVM)
-               list(APPEND OPENCOLLADA_LIBRARIES -lUTF)
-       endif()
-       # pcre is bundled with openCollada
+       # PCRE is bundled with openCollada
        #set(PCRE ${LIBDIR}/pcre)
        #set(PCRE_LIBPATH ${PCRE}/lib)
        set(PCRE_LIBRARIES pcre)
-       #libxml2 is used
+       # libxml2 is used
        #set(EXPAT ${LIBDIR}/expat)
        #set(EXPAT_LIBPATH ${EXPAT}/lib)
        set(EXPAT_LIB)
@@ -303,7 +295,6 @@ if(WITH_OPENIMAGEIO)
                ${OPENJPEG_LIBRARIES}
                ${ZLIB_LIBRARIES}
        )
-       set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${LIBDIR}/ffmpeg/lib/libwebp.a)
        set(OPENIMAGEIO_LIBPATH
                ${OPENIMAGEIO}/lib
                ${JPEG_LIBPATH}