diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-07 11:47:09 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-07 17:26:13 +0300 |
commit | 1e3c0b4b03e1b1f6a2a66539e7648a5b92fada91 (patch) | |
tree | d46d93355f0bda55834b9e0fa419300e51ab92e0 /build_files/build_environment/cmake | |
parent | 202e7ccaaee8909f72465f67ab59626fa6dd3a48 (diff) |
Make deps: Compile own version of nasm for Apple
The upstream version of nasm does not put version information to the
generated object files, which makes linker to show the following
warning:
building for macOS, but linking in object file
Using own patched version of nasm which puts required information to
the object file, making linker happy.
The plan is to either streamline the patch and provide it to the
upstream, or, it that takes too long, get an independent fix from the
upstream.
Diffstat (limited to 'build_files/build_environment/cmake')
-rw-r--r-- | build_files/build_environment/cmake/ffmpeg.cmake | 6 | ||||
-rw-r--r-- | build_files/build_environment/cmake/nasm.cmake | 29 | ||||
-rw-r--r-- | build_files/build_environment/cmake/versions.cmake | 4 | ||||
-rw-r--r-- | build_files/build_environment/cmake/x264.cmake | 7 |
4 files changed, 46 insertions, 0 deletions
diff --git a/build_files/build_environment/cmake/ffmpeg.cmake b/build_files/build_environment/cmake/ffmpeg.cmake index 02e78c605af..7b759ab8f1d 100644 --- a/build_files/build_environment/cmake/ffmpeg.cmake +++ b/build_files/build_environment/cmake/ffmpeg.cmake @@ -143,6 +143,12 @@ if(WIN32) external_zlib_mingw ) endif() +if(APPLE) + add_dependencies( + external_ffmpeg + external_nasm + ) +endif() if(BUILD_MODE STREQUAL Release AND WIN32) ExternalProject_Add_Step(external_ffmpeg after_install diff --git a/build_files/build_environment/cmake/nasm.cmake b/build_files/build_environment/cmake/nasm.cmake new file mode 100644 index 00000000000..51d7ebd8830 --- /dev/null +++ b/build_files/build_environment/cmake/nasm.cmake @@ -0,0 +1,29 @@ +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ***** END GPL LICENSE BLOCK ***** + +ExternalProject_Add(external_nasm + URL ${NASM_URI} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH SHA256=${NASM_HASH} + PREFIX ${BUILD_DIR}/nasm + PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/nasm/src/external_nasm < ${PATCH_DIR}/nasm.diff + CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/nasm + BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make -j${MAKE_THREADS} + INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make install + INSTALL_DIR ${LIBDIR}/nasm +) diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake index 5ec5553079c..ce2a1191f17 100644 --- a/build_files/build_environment/cmake/versions.cmake +++ b/build_files/build_environment/cmake/versions.cmake @@ -305,6 +305,10 @@ set(MESA_VERSION 18.3.1) set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa//mesa-${MESA_VERSION}.tar.xz) set(MESA_HASH d60828056d77bfdbae0970f9b15fb1be) +set(NASM_VERSION 2.15.02) +set(NASM_URI https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.xz) +set(NASM_HASH f4fd1329b1713e1ccd34b2fc121c4bcd278c9f91cc4cb205ae8fcd2e4728dd14) + set(XR_OPENXR_SDK_VERSION 1.0.8) set(XR_OPENXR_SDK_URI https://github.com/KhronosGroup/OpenXR-SDK/archive/release-${XR_OPENXR_SDK_VERSION}.tar.gz) set(XR_OPENXR_SDK_HASH c6de63d2e0f9029aa58dfa97cad8ce07) diff --git a/build_files/build_environment/cmake/x264.cmake b/build_files/build_environment/cmake/x264.cmake index 8bcb5a2938f..62a46254a99 100644 --- a/build_files/build_environment/cmake/x264.cmake +++ b/build_files/build_environment/cmake/x264.cmake @@ -39,3 +39,10 @@ ExternalProject_Add(external_x264 if(MSVC) set_target_properties(external_x264 PROPERTIES FOLDER Mingw) endif() + +if(APPLE) + add_dependencies( + external_x264 + external_nasm + ) +endif() |