From 939a88ab4afeacf86f42049456953e0056f15e25 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Wed, 18 Dec 2019 14:17:20 +0000 Subject: [PATCH] cmake: No default ffmpeg on 32 bit Windows. Only check for ffmpeg if it's not explicitly turned off and the target is not 32 bit Windows. This is done because Windows XP does not have bcrypt.dll which ffmpeg requires and the 32 bit builds are more likely to be used on older systems which would also benefit from the smaller binary size. Also add the X86 and X64 cmake architecture variable flags. Signed-off-by: Rafael Kitover --- CMakeLists.txt | 12 +++++++----- cmake/Architecture.cmake | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04a9efc6..c413c06a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,13 +153,15 @@ macro(check_ffmpeg_component_versions) endif() endmacro() -set(FFMPEG_DEFAULT ON) +if(((NOT DEFINED ENABLE_FFMPEG) AND (NOT (WIN32 AND X86))) OR ENABLE_FFMPEG) + set(FFMPEG_DEFAULT ON) -find_package(FFmpeg COMPONENTS ${FFMPEG_COMPONENTS}) -check_ffmpeg_component_versions() + find_package(FFmpeg COMPONENTS ${FFMPEG_COMPONENTS}) + check_ffmpeg_component_versions() -if(NOT FFMPEG_FOUND) - set(FFMPEG_DEFAULT OFF) + if(NOT FFMPEG_FOUND) + set(FFMPEG_DEFAULT OFF) + endif() endif() option(ENABLE_FFMPEG "Enable ffmpeg A/V recording" ${FFMPEG_DEFAULT}) diff --git a/cmake/Architecture.cmake b/cmake/Architecture.cmake index 60842355..677fc0f5 100644 --- a/cmake/Architecture.cmake +++ b/cmake/Architecture.cmake @@ -16,9 +16,11 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86|i[3-9]86|[aA][mM][dD]64") if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4) # 32 bit set(ASM_DEFAULT ON) set(X86_32 ON) + set(X86 ON) set(WINARCH x86) else() set(AMD64 ON) + set(X64 ON) set(WINARCH x64) endif()