diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-06 16:28:19 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-07 10:31:46 +0300 |
commit | d212b3dc43eeda100a6b82ec083a68dffb9c02c9 (patch) | |
tree | de57bf8c67f9e542d7e1f0761c62931a6fc0f351 /build_files | |
parent | b28683b8b5f9a3c357af8fcd596000dc0e5f33ca (diff) |
Make deps: Fixes for macOS platform
Set of fixes which had to be made in order to have dependencies built
on own laptop:
- Require bison as a dependent software. It is required by ISPC.
On macOS it is required to be installed via Homebrew. This is because
Bison from Xcode toolchain is too old.
- Made sure Boost is compiled using clang.
Without this gcc was used, and some unsupported command line argument
was passed to it.
- Modify OGG in a way which does in fact pull fixed sized types.
They are defined in stdint.h.
Without this fix FFmpeg will not detect presence of OGG because the
test program fails to compile.
- Force disable zstd compression and make wepb optional for the TIFF
library. Without this TIFF might pick up development libraries from
Homebrew.
Differential Revision: https://developer.blender.org/D8221
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/build_environment/CMakeLists.txt | 2 | ||||
-rw-r--r-- | build_files/build_environment/cmake/boost.cmake | 2 | ||||
-rw-r--r-- | build_files/build_environment/cmake/check_software.cmake | 9 | ||||
-rw-r--r-- | build_files/build_environment/cmake/ispc.cmake | 7 | ||||
-rw-r--r-- | build_files/build_environment/cmake/ogg.cmake | 1 | ||||
-rw-r--r-- | build_files/build_environment/cmake/tiff.cmake | 8 | ||||
-rw-r--r-- | build_files/build_environment/patches/ogg.diff | 12 |
7 files changed, 38 insertions, 3 deletions
diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt index 3c228fd9f7d..876372ca8c4 100644 --- a/build_files/build_environment/CMakeLists.txt +++ b/build_files/build_environment/CMakeLists.txt @@ -30,7 +30,7 @@ # build_deps 2015 x64 / build_deps 2015 x86 # # MAC OS X USAGE: -# Install with homebrew: brew install cmake autoconf automake libtool yasm nasm +# Install with homebrew: brew install cmake autoconf automake libtool yasm nasm bison # Run "make deps" from main Blender directory # # LINUX USAGE: diff --git a/build_files/build_environment/cmake/boost.cmake b/build_files/build_environment/cmake/boost.cmake index 94c649e9109..6e7ee8c66b1 100644 --- a/build_files/build_environment/cmake/boost.cmake +++ b/build_files/build_environment/cmake/boost.cmake @@ -44,7 +44,7 @@ if(WIN32) elseif(APPLE) set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh) set(BOOST_BUILD_COMMAND ./b2) - set(BOOST_BUILD_OPTIONS toolset=darwin cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} visibility=global --disable-icu boost.locale.icu=off) + set(BOOST_BUILD_OPTIONS toolset=clang-darwin cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} visibility=global --disable-icu boost.locale.icu=off) set(BOOST_HARVEST_CMD echo .) set(BOOST_PATCH_COMMAND echo .) else() diff --git a/build_files/build_environment/cmake/check_software.cmake b/build_files/build_environment/cmake/check_software.cmake index f5774551879..384915aba84 100644 --- a/build_files/build_environment/cmake/check_software.cmake +++ b/build_files/build_environment/cmake/check_software.cmake @@ -30,6 +30,7 @@ if(UNIX) nasm yasm tclsh + bison ) foreach(_software ${_required_software}) @@ -40,6 +41,12 @@ if(UNIX) unset(_software_find CACHE) endforeach() + if(APPLE) + if(NOT EXISTS "/usr/local/opt/bison/bin/bison") + set(_software_missing "${_software_missing} bison") + endif() + endif() + if(_software_missing) message( "\n" @@ -50,7 +57,7 @@ if(UNIX) " apt install autoconf automake libtool yasm nasm tcl\n" "\n" "On macOS (with homebrew):\n" - " brew install cmake autoconf automake libtool yasm nasm\n" + " brew install cmake autoconf automake libtool yasm nasm bison\n" "\n" "Other platforms:\n" " Install equivalent packages.\n") diff --git a/build_files/build_environment/cmake/ispc.cmake b/build_files/build_environment/cmake/ispc.cmake index 0bb5db82aea..9143a7ec984 100644 --- a/build_files/build_environment/cmake/ispc.cmake +++ b/build_files/build_environment/cmake/ispc.cmake @@ -22,6 +22,12 @@ if(WIN32) -DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe -DM4_EXECUTABLE=${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/m4.exe ) +elseif(APPLE) + # Use bison installed via Homebrew. + # The one which comes which Xcode toolset is too old. + set(ISPC_EXTRA_ARGS_APPLE + -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison + ) endif() set(ISPC_EXTRA_ARGS @@ -36,6 +42,7 @@ set(ISPC_EXTRA_ARGS -DCLANG_LIBRARY_DIR=${LIBDIR}/clang/lib -DCLANG_INCLUDE_DIRS=${LIBDIR}/clang/include ${ISPC_EXTRA_ARGS_WIN} + ${ISPC_EXTRA_ARGS_APPLE} ) ExternalProject_Add(external_ispc diff --git a/build_files/build_environment/cmake/ogg.cmake b/build_files/build_environment/cmake/ogg.cmake index e2d0f0905b8..808a35c6e4d 100644 --- a/build_files/build_environment/cmake/ogg.cmake +++ b/build_files/build_environment/cmake/ogg.cmake @@ -21,6 +21,7 @@ ExternalProject_Add(external_ogg DOWNLOAD_DIR ${DOWNLOAD_DIR} URL_HASH SHA256=${OGG_HASH} PREFIX ${BUILD_DIR}/ogg + PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/ogg/src/external_ogg < ${PATCH_DIR}/ogg.diff CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ogg --disable-shared --enable-static BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && make -j${MAKE_THREADS} INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && make install diff --git a/build_files/build_environment/cmake/tiff.cmake b/build_files/build_environment/cmake/tiff.cmake index fa5a1423603..fe2c82a6eaa 100644 --- a/build_files/build_environment/cmake/tiff.cmake +++ b/build_files/build_environment/cmake/tiff.cmake @@ -16,6 +16,12 @@ # # ***** END GPL LICENSE BLOCK ***** +if(WITH_WEBP) + set(WITH_TIFF_WEBP ON) +else() + set(WITH_TIFF_WEBP OFF) +endif() + set(TIFF_EXTRA_ARGS -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY} -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include @@ -23,6 +29,8 @@ set(TIFF_EXTRA_ARGS -DBUILD_SHARED_LIBS=OFF -Dlzma=OFF -Djbig=OFF + -Dzstd=OFF + -Dwebp=${WITH_TIFF_WEBP} ) ExternalProject_Add(external_tiff diff --git a/build_files/build_environment/patches/ogg.diff b/build_files/build_environment/patches/ogg.diff new file mode 100644 index 00000000000..fca426e1d35 --- /dev/null +++ b/build_files/build_environment/patches/ogg.diff @@ -0,0 +1,12 @@ +diff --git a/include/ogg/os_types.h b/include/ogg/os_types.h +index eb8a322..6f73b72 100644 +--- a/include/ogg/os_types.h ++++ b/include/ogg/os_types.h +@@ -71,6 +71,7 @@ + #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ + + # include <sys/types.h> ++# include <stdint.h> + typedef int16_t ogg_int16_t; + typedef uint16_t ogg_uint16_t; + typedef int32_t ogg_int32_t; |