Files
goo-engine/build_files/build_environment/cmake/opus.cmake
T
Anthony Roberts ee1b2f53cc Deps_builder: Move Windows build from MinGW/GCC to msys2/MSVC
Currently on Windows some dependencies are built with MinGW/GCC 3.x
this commit removes that, in favor of building them with MSVC
via msys2. This will make it easier in the future to offer Win/Arm64
builds of blender.

Notable changes:

- This change drops support for the external libxvid library in favor
of ffmpegs built in support for this format. This has been done with
permission from the VFX module.

Pull Request: https://projects.blender.org/blender/blender/pulls/108983
              https://projects.blender.org/blender/blender/pulls/105502
2023-06-14 21:57:48 +02:00

39 lines
1.3 KiB
CMake

# SPDX-FileCopyrightText: 2002-2023 Blender Foundation
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(MSVC)
set(OPUS_CMAKE_ARGS
-DPACKAGE_VERSION=${OPUS_VERSION}
-DOPUS_BUILD_PROGRAMS=OFF
-DOPUS_BUILD_TESTING=OFF
)
endif()
if(NOT WIN32)
ExternalProject_Add(external_opus
URL file://${PACKAGE_DIR}/${OPUS_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPUS_HASH_TYPE}=${OPUS_HASH}
PREFIX ${BUILD_DIR}/opus
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/opus/src/external_opus/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/opus
--disable-shared
--enable-static
--with-pic
--disable-maintainer-mode
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/opus/src/external_opus/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/opus/src/external_opus/ && make install
INSTALL_DIR ${LIBDIR}/opus
)
else()
ExternalProject_Add(external_opus
URL file://${PACKAGE_DIR}/${OPUS_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPUS_HASH_TYPE}=${OPUS_HASH}
PREFIX ${BUILD_DIR}/opus
PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/opus/src/external_opus < ${PATCH_DIR}/opus_windows.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opus ${OPUS_CMAKE_ARGS}
INSTALL_DIR ${LIBDIR}/opus
)
endif()