diff options
Diffstat (limited to 'build_files/build_environment/cmake')
-rw-r--r-- | build_files/build_environment/cmake/aom.cmake | 45 | ||||
-rw-r--r-- | build_files/build_environment/cmake/download.cmake | 1 | ||||
-rw-r--r-- | build_files/build_environment/cmake/ffmpeg.cmake | 8 | ||||
-rw-r--r-- | build_files/build_environment/cmake/harvest.cmake | 1 | ||||
-rw-r--r-- | build_files/build_environment/cmake/versions.cmake | 6 | ||||
-rw-r--r-- | build_files/build_environment/cmake/vpx.cmake | 28 |
6 files changed, 76 insertions, 13 deletions
diff --git a/build_files/build_environment/cmake/aom.cmake b/build_files/build_environment/cmake/aom.cmake new file mode 100644 index 00000000000..9f64439771f --- /dev/null +++ b/build_files/build_environment/cmake/aom.cmake @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +if(WIN32) + # The default generator on windows is msbuild, which we do not + # want to use for this dep, as needs to build with mingw + set(AOM_GENERATOR "Ninja") + # The default flags are full of MSVC options given this will be + # building with mingw, it'll have an unhappy time with that and + # we need to clear them out. + set(AOM_CMAKE_FLAGS ) + # CMake will correctly identify phreads being available, however + # we do not want to use them, as that gains a dependency on + # libpthreadswin.dll which we do not want. when pthreads is not + # available oam will use a pthreads emulation layer using win32 threads + set(AOM_EXTRA_ARGS_WIN32 -DCMAKE_HAVE_PTHREAD_H=OFF) +else() + set(AOM_GENERATOR "Unix Makefiles") + set(AOM_CMAKE_FLAGS ${DEFAULT_CMAKE_FLAGS}) +endif() + +set(AOM_EXTRA_ARGS + -DENABLE_TESTDATA=OFF + -DENABLE_TESTS=OFF + -DENABLE_TOOLS=OFF + -DENABLE_EXAMPLES=OFF + ${AOM_EXTRA_ARGS_WIN32} +) + +# This is slightly different from all other deps in the way that +# aom uses cmake as a build system, but still needs the environment setup +# to include perl so we manually setup the environment and call +# cmake directly for the configure, build and install commands. + +ExternalProject_Add(external_aom + URL file://${PACKAGE_DIR}/${AOM_FILE} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${AOM_HASH_TYPE}=${AOM_HASH} + PREFIX ${BUILD_DIR}/aom + CONFIGURE_COMMAND ${CONFIGURE_ENV} && + cd ${BUILD_DIR}/aom/src/external_aom-build/ && + ${CMAKE_COMMAND} -G "${AOM_GENERATOR}" -DCMAKE_INSTALL_PREFIX=${LIBDIR}/aom ${AOM_CMAKE_FLAGS} ${AOM_EXTRA_ARGS} ${BUILD_DIR}/aom/src/external_aom/ + BUILD_COMMAND ${CMAKE_COMMAND} --build . + INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install + INSTALL_DIR ${LIBDIR}/aom +) diff --git a/build_files/build_environment/cmake/download.cmake b/build_files/build_environment/cmake/download.cmake index b7150525a65..547bf77f8dd 100644 --- a/build_files/build_environment/cmake/download.cmake +++ b/build_files/build_environment/cmake/download.cmake @@ -116,3 +116,4 @@ download_source(IGC_SPIRV_TOOLS) download_source(IGC_SPIRV_TRANSLATOR) download_source(GMMLIB) download_source(OCLOC) +download_source(AOM) diff --git a/build_files/build_environment/cmake/ffmpeg.cmake b/build_files/build_environment/cmake/ffmpeg.cmake index 4cf96ee2fcb..7730607c514 100644 --- a/build_files/build_environment/cmake/ffmpeg.cmake +++ b/build_files/build_environment/cmake/ffmpeg.cmake @@ -1,9 +1,9 @@ # SPDX-License-Identifier: GPL-2.0-or-later -set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/opus/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include") -set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/opus/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib") +set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/opus/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include -I${mingw_LIBDIR}/aom/include") +set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/opus/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib -L${mingw_LIBDIR}/aom/lib") set(FFMPEG_EXTRA_FLAGS --pkg-config-flags=--static --extra-cflags=${FFMPEG_CFLAGS} --extra-ldflags=${FFMPEG_LDFLAGS}) -set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig:) +set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig:${mingw_LIBDIR}/aom/lib/pkgconfig:) if(WIN32) set(FFMPEG_ENV set ${FFMPEG_ENV} &&) @@ -79,6 +79,7 @@ ExternalProject_Add(external_ffmpeg --disable-librtmp --enable-libx264 --enable-libxvid + --enable-libaom --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libdc1394 @@ -125,6 +126,7 @@ add_dependencies( external_vorbis external_ogg external_lame + external_aom ) if(WIN32) add_dependencies( diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake index 2865a5304d7..1572feb9220 100644 --- a/build_files/build_environment/cmake/harvest.cmake +++ b/build_files/build_environment/cmake/harvest.cmake @@ -177,6 +177,7 @@ harvest(opus/lib ffmpeg/lib "*.a") harvest(vpx/lib ffmpeg/lib "*.a") harvest(x264/lib ffmpeg/lib "*.a") harvest(xvidcore/lib ffmpeg/lib "*.a") +harvest(aom/lib ffmpeg/lib "*.a") harvest(webp/lib webp/lib "*.a") harvest(webp/include webp/include "*.h") harvest(usd/include usd/include "*.h") diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake index 42c82b68654..3a37a4372af 100644 --- a/build_files/build_environment/cmake/versions.cmake +++ b/build_files/build_environment/cmake/versions.cmake @@ -633,3 +633,9 @@ set(OCLOC_URI https://github.com/intel/compute-runtime/archive/refs/tags/${OCLOC set(OCLOC_HASH ab22b8bf2560a57fdd3def0e35a62ca75991406f959c0263abb00cd6cd9ae998) set(OCLOC_HASH_TYPE SHA256) set(OCLOC_FILE ocloc-${OCLOC_VERSION}.tar.gz) + +set(AOM_VERSION 3.4.0) +set(AOM_URI https://storage.googleapis.com/aom-releases/libaom-${AOM_VERSION}.tar.gz) +set(AOM_HASH bd754b58c3fa69f3ffd29da77de591bd9c26970e3b18537951336d6c0252e354) +set(AOM_HASH_TYPE SHA256) +set(AOM_FILE libaom-${AOM_VERSION}.tar.gz) diff --git a/build_files/build_environment/cmake/vpx.cmake b/build_files/build_environment/cmake/vpx.cmake index ba17acad80f..111e93e79e1 100644 --- a/build_files/build_environment/cmake/vpx.cmake +++ b/build_files/build_environment/cmake/vpx.cmake @@ -1,11 +1,13 @@ # SPDX-License-Identifier: GPL-2.0-or-later if(WIN32) - if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - set(VPX_EXTRA_FLAGS --target=x86_64-win64-gcc --disable-multithread) - else() - set(VPX_EXTRA_FLAGS --target=x86-win32-gcc --disable-multithread) - endif() + # VPX is determined to use pthreads which it will tell ffmpeg to dynamically + # link, which is not something we're super into distribution wise. However + # if it cannot find pthread.h it'll happily provide a pthread emulation + # layer using win32 threads. So all this patch does is make it not find + # pthead.h + set(VPX_PATCH ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/vpx/src/external_vpx < ${PATCH_DIR}/vpx_windows.diff) + set(VPX_EXTRA_FLAGS --target=x86_64-win64-gcc ) else() if(APPLE) if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64") @@ -18,6 +20,16 @@ else() endif() endif() +if(NOT BLENDER_PLATFORM_ARM) + list(APPEND VPX_EXTRA_FLAGS + --enable-sse4_1 + --enable-sse3 + --enable-ssse3 + --enable-avx + --enable-avx2 + ) +endif() + ExternalProject_Add(external_vpx URL file://${PACKAGE_DIR}/${VPX_FILE} DOWNLOAD_DIR ${DOWNLOAD_DIR} @@ -30,11 +42,6 @@ ExternalProject_Add(external_vpx --enable-static --disable-install-bins --disable-install-srcs - --disable-sse4_1 - --disable-sse3 - --disable-ssse3 - --disable-avx - --disable-avx2 --disable-unit-tests --disable-examples --enable-vp8 @@ -42,6 +49,7 @@ ExternalProject_Add(external_vpx ${VPX_EXTRA_FLAGS} BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make -j${MAKE_THREADS} INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make install + PATCH_COMMAND ${VPX_PATCH} INSTALL_DIR ${LIBDIR}/vpx ) |