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 <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2019-12-18 14:17:20 +00:00
parent 4e00fa605b
commit 939a88ab4a
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
2 changed files with 9 additions and 5 deletions

View File

@ -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})

View File

@ -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()