summaryrefslogtreecommitdiffstats
path: root/third_party/aom/CMakeLists.txt
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-17 05:59:08 -0500
committertrav90 <travawine@palemoon.org>2018-10-17 05:59:08 -0500
commitdf9477dfa60ebb5d31bc142e58ce46535c17abce (patch)
treec4fdd5d1b09d08c0514f208246260fc87372cb56 /third_party/aom/CMakeLists.txt
parent0cc51bc106250988cc3b89cb5d743a5af52cd35a (diff)
downloadUXP-df9477dfa60ebb5d31bc142e58ce46535c17abce.tar
UXP-df9477dfa60ebb5d31bc142e58ce46535c17abce.tar.gz
UXP-df9477dfa60ebb5d31bc142e58ce46535c17abce.tar.lz
UXP-df9477dfa60ebb5d31bc142e58ce46535c17abce.tar.xz
UXP-df9477dfa60ebb5d31bc142e58ce46535c17abce.zip
Update aom to slightly newer commit ID
Diffstat (limited to 'third_party/aom/CMakeLists.txt')
-rw-r--r--third_party/aom/CMakeLists.txt257
1 files changed, 185 insertions, 72 deletions
diff --git a/third_party/aom/CMakeLists.txt b/third_party/aom/CMakeLists.txt
index 4ba2d40aa..3b27de58f 100644
--- a/third_party/aom/CMakeLists.txt
+++ b/third_party/aom/CMakeLists.txt
@@ -9,6 +9,18 @@
## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
##
cmake_minimum_required(VERSION 3.5)
+
+if (NOT EMSCRIPTEN)
+ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
+ set(CMAKE_BUILD_TYPE "RelWithDebInfo")
+ endif ()
+endif ()
+
+option(ENABLE_CCACHE "Enable ccache support." OFF)
+option(ENABLE_DISTCC "Enable distcc support." OFF)
+option(ENABLE_DOCS "Enable documentation generation (doxygen required)." ON)
+option(ENABLE_NASM "Use nasm instead of yasm for x86 assembly." OFF)
+
project(AOM C CXX)
set(AOM_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
@@ -114,15 +126,15 @@ set(AOM_COMMON_APP_UTIL_SOURCES
"${AOM_ROOT}/md5_utils.h"
"${AOM_ROOT}/tools_common.c"
"${AOM_ROOT}/tools_common.h"
- "${AOM_ROOT}/video_common.h")
+ "${AOM_ROOT}/video_common.h"
+ "${AOM_ROOT}/y4menc.c"
+ "${AOM_ROOT}/y4menc.h")
set(AOM_DECODER_APP_UTIL_SOURCES
"${AOM_ROOT}/ivfdec.c"
"${AOM_ROOT}/ivfdec.h"
"${AOM_ROOT}/video_reader.c"
- "${AOM_ROOT}/video_reader.h"
- "${AOM_ROOT}/y4menc.c"
- "${AOM_ROOT}/y4menc.h")
+ "${AOM_ROOT}/video_reader.h")
set(AOM_ENCODER_APP_UTIL_SOURCES
"${AOM_ROOT}/ivfenc.c"
@@ -190,88 +202,117 @@ foreach (aom_lib ${AOM_LIB_TARGETS})
add_dependencies(${aom_lib} aom_rtcd)
endif ()
endforeach ()
+
#
# Application and application support targets.
#
add_library(aom_common_app_util OBJECT ${AOM_COMMON_APP_UTIL_SOURCES})
-add_library(aom_decoder_app_util OBJECT ${AOM_DECODER_APP_UTIL_SOURCES})
-add_library(aom_encoder_app_util OBJECT ${AOM_ENCODER_APP_UTIL_SOURCES})
-add_executable(aom_cx_set_ref
- "${AOM_ROOT}/examples/aom_cx_set_ref.c"
- $<TARGET_OBJECTS:aom_common_app_util>
- $<TARGET_OBJECTS:aom_encoder_app_util>)
-add_executable(aomdec
+if (CONFIG_AV1_DECODER)
+ add_library(aom_decoder_app_util OBJECT ${AOM_DECODER_APP_UTIL_SOURCES})
+ add_executable(aomdec
"${AOM_ROOT}/aomdec.c"
$<TARGET_OBJECTS:aom_common_app_util>
$<TARGET_OBJECTS:aom_decoder_app_util>)
-add_executable(aomenc
- "${AOM_ROOT}/aomenc.c"
- $<TARGET_OBJECTS:aom_common_app_util>
- $<TARGET_OBJECTS:aom_encoder_app_util>
- $<TARGET_OBJECTS:aom_encoder_stats>)
+ if (CONFIG_ANALYZER)
+ add_executable(analyzer
+ "${AOM_ROOT}/examples/analyzer.cc"
+ $<TARGET_OBJECTS:aom_common_app_util>
+ $<TARGET_OBJECTS:aom_decoder_app_util>)
+ target_link_libraries(analyzer ${AOM_LIB_LINK_TYPE} ${wxWidgets_LIBRARIES})
+ set(AOM_APP_TARGETS ${AOM_APP_TARGETS} analyzer)
+ endif ()
-if (CONFIG_ANALYZER)
- add_executable(analyzer
- "${AOM_ROOT}/examples/analyzer.cc"
+ add_executable(decode_to_md5
+ "${AOM_ROOT}/examples/decode_to_md5.c"
+ $<TARGET_OBJECTS:aom_common_app_util>
+ $<TARGET_OBJECTS:aom_decoder_app_util>)
+ add_executable(decode_with_drops
+ "${AOM_ROOT}/examples/decode_with_drops.c"
+ $<TARGET_OBJECTS:aom_common_app_util>
+ $<TARGET_OBJECTS:aom_decoder_app_util>)
+ add_executable(simple_decoder
+ "${AOM_ROOT}/examples/simple_decoder.c"
$<TARGET_OBJECTS:aom_common_app_util>
$<TARGET_OBJECTS:aom_decoder_app_util>)
- target_link_libraries(analyzer PUBLIC ${wxWidgets_LIBRARIES})
- set(AOM_APP_TARGETS ${AOM_APP_TARGETS} analyzer)
-endif ()
-
-add_executable(decode_to_md5
- "${AOM_ROOT}/examples/decode_to_md5.c"
- $<TARGET_OBJECTS:aom_common_app_util>
- $<TARGET_OBJECTS:aom_decoder_app_util>)
-add_executable(decode_with_drops
- "${AOM_ROOT}/examples/decode_with_drops.c"
- $<TARGET_OBJECTS:aom_common_app_util>
- $<TARGET_OBJECTS:aom_decoder_app_util>)
+ if (CONFIG_INSPECTION)
+ add_executable(inspect
+ "${AOM_ROOT}/examples/inspect.c"
+ $<TARGET_OBJECTS:aom_common_app_util>
+ $<TARGET_OBJECTS:aom_decoder_app_util>)
+ set(AOM_DECODER_EXAMPLE_TARGETS ${AOM_DECODER_EXAMPLE_TARGETS} inspect)
+
+ if (EMSCRIPTEN)
+ add_preproc_definition(_POSIX_SOURCE)
+ add_compiler_flag_if_supported("-s TOTAL_MEMORY=134217728")
+ add_compiler_flag_if_supported("-s MODULARIZE=1")
+ add_compiler_flag_if_supported("-s EXPORT_NAME=\"\'DecoderModule\'\"")
+ add_compiler_flag_if_supported("--memory-init-file 0")
+ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
+ # Default to -O3 when no build type specified.
+ add_compiler_flag_if_supported("-O3")
+ endif ()
+ em_link_post_js(inspect "${AOM_ROOT}/tools/inspect-post.js")
+ endif ()
+ endif ()
-add_executable(lossless_encoder
- "${AOM_ROOT}/examples/lossless_encoder.c"
- $<TARGET_OBJECTS:aom_common_app_util>
- $<TARGET_OBJECTS:aom_encoder_app_util>)
+ # Maintain lists of example and app targets.
+ set(AOM_DECODER_EXAMPLE_TARGETS ${AOM_DECODER_EXAMPLE_TARGETS}
+ decode_to_md5 decode_with_drops simple_decoder)
+ set(AOM_APP_TARGETS ${AOM_APP_TARGETS} aomdec ${AOM_DECODER_EXAMPLE_TARGETS})
+endif ()
-add_executable(set_maps
- "${AOM_ROOT}/examples/set_maps.c"
- $<TARGET_OBJECTS:aom_common_app_util>
- $<TARGET_OBJECTS:aom_encoder_app_util>)
-add_executable(simple_decoder
- "${AOM_ROOT}/examples/simple_decoder.c"
- $<TARGET_OBJECTS:aom_common_app_util>
- $<TARGET_OBJECTS:aom_decoder_app_util>)
+if (CONFIG_AV1_ENCODER)
+ add_library(aom_encoder_app_util OBJECT ${AOM_ENCODER_APP_UTIL_SOURCES})
+ add_executable(aomenc
+ "${AOM_ROOT}/aomenc.c"
+ $<TARGET_OBJECTS:aom_common_app_util>
+ $<TARGET_OBJECTS:aom_encoder_app_util>
+ $<TARGET_OBJECTS:aom_encoder_stats>)
+ add_executable(lossless_encoder
+ "${AOM_ROOT}/examples/lossless_encoder.c"
+ $<TARGET_OBJECTS:aom_common_app_util>
+ $<TARGET_OBJECTS:aom_encoder_app_util>)
+ add_executable(set_maps
+ "${AOM_ROOT}/examples/set_maps.c"
+ $<TARGET_OBJECTS:aom_common_app_util>
+ $<TARGET_OBJECTS:aom_encoder_app_util>)
+ add_executable(simple_encoder
+ "${AOM_ROOT}/examples/simple_encoder.c"
+ $<TARGET_OBJECTS:aom_common_app_util>
+ $<TARGET_OBJECTS:aom_encoder_app_util>)
+ add_executable(twopass_encoder
+ "${AOM_ROOT}/examples/twopass_encoder.c"
+ $<TARGET_OBJECTS:aom_common_app_util>
+ $<TARGET_OBJECTS:aom_encoder_app_util>)
-if (CONFIG_INSPECTION)
-add_executable(inspect
- "${AOM_ROOT}/examples/inspect.c"
- $<TARGET_OBJECTS:aom_common_app_util>
- $<TARGET_OBJECTS:aom_decoder_app_util>)
-set(AOM_APP_TARGETS ${AOM_APP_TARGETS} inspect)
+ # Add encoder apps and examples to target lists.
+ set(AOM_ENCODER_EXAMPLE_TARGETS
+ lossless_encoder set_maps simple_encoder twopass_encoder)
+ set(AOM_APP_TARGETS ${AOM_APP_TARGETS} aomenc ${AOM_ENCODER_EXAMPLE_TARGETS})
endif ()
-add_executable(simple_encoder
- "${AOM_ROOT}/examples/simple_encoder.c"
- $<TARGET_OBJECTS:aom_common_app_util>
- $<TARGET_OBJECTS:aom_encoder_app_util>)
-
-add_executable(twopass_encoder
- "${AOM_ROOT}/examples/twopass_encoder.c"
- $<TARGET_OBJECTS:aom_common_app_util>
- $<TARGET_OBJECTS:aom_encoder_app_util>)
+# Maintain a separate variable listing only the examples to facilitate
+# installation of example programs into an examples sub directory of
+# $AOM_DIST_DIR/bin when building the dist target.
+set(AOM_EXAMPLE_TARGETS
+ ${AOM_DECODER_EXAMPLE_TARGETS} ${AOM_ENCODER_EXAMPLE_TARGETS})
-# List of app targets.
-set(AOM_APP_TARGETS ${AOM_APP_TARGETS} aom_cx_set_ref aomdec aomenc
- decode_to_md5 decode_with_drops lossless_encoder set_maps simple_decoder
- simple_encoder twopass_encoder)
+if (CONFIG_AV1_DECODER AND CONFIG_AV1_ENCODER)
+ add_executable(aom_cx_set_ref
+ "${AOM_ROOT}/examples/aom_cx_set_ref.c"
+ $<TARGET_OBJECTS:aom_common_app_util>
+ $<TARGET_OBJECTS:aom_encoder_app_util>)
+ set(AOM_EXAMPLE_TARGETS ${AOM_EXAMPLE_TARGETS} aom_cx_set_ref)
+ set(AOM_APP_TARGETS ${AOM_APP_TARGETS} aom_cx_set_ref)
+endif ()
foreach (aom_app ${AOM_APP_TARGETS})
- target_link_libraries(${aom_app} PUBLIC aom)
+ target_link_libraries(${aom_app} ${AOM_LIB_LINK_TYPE} aom)
endforeach ()
if (CONFIG_LIBYUV)
@@ -297,8 +338,13 @@ if (CONFIG_WEBM_IO)
endif ()
# Add to existing targets.
- target_sources(aom_decoder_app_util PUBLIC ${AOM_WEBM_DECODER_SOURCES})
- target_sources(aom_encoder_app_util PUBLIC ${AOM_WEBM_ENCODER_SOURCES})
+ if (CONFIG_AV1_DECODER)
+ target_sources(aom_decoder_app_util PUBLIC ${AOM_WEBM_DECODER_SOURCES})
+ endif ()
+
+ if (CONFIG_AV1_ENCODER)
+ target_sources(aom_encoder_app_util PUBLIC ${AOM_WEBM_ENCODER_SOURCES})
+ endif ()
foreach (aom_app ${AOM_APP_TARGETS})
target_sources(${aom_app} PUBLIC $<TARGET_OBJECTS:webm>)
@@ -314,7 +360,7 @@ endif ()
if (HAVE_PTHREAD_H AND CONFIG_MULTITHREAD)
find_package(Threads)
foreach (app_target ${AOM_APP_TARGETS})
- target_link_libraries(${app_target} PUBLIC Threads::Threads)
+ target_link_libraries(${app_target} ${AOM_LIB_LINK_TYPE} Threads::Threads)
endforeach ()
endif ()
@@ -337,23 +383,90 @@ if (XCODE)
endif ()
endif ()
+if ("${CMAKE_GENERATOR}" MATCHES "Makefiles$" )
+ # Users of the configure build expect the example targets to be built in the
+ # examples sub directory of the configured build directory after running make.
+ file(MAKE_DIRECTORY "${AOM_CONFIG_DIR}/examples")
+ set_target_properties(${AOM_EXAMPLE_TARGETS} PROPERTIES
+ RUNTIME_OUTPUT_DIRECTORY "${AOM_CONFIG_DIR}/examples")
+endif ()
+
+# Aomedia documentation rule.
+if (ENABLE_DOCS)
+ include(FindDoxygen)
+ if (DOXYGEN_FOUND)
+ include("${AOM_ROOT}/docs.cmake")
+ setup_documentation_targets()
+ else ()
+ message("--- Cannot find doxygen, ENABLE_DOCS turned off.")
+ set(ENABLE_DOCS OFF)
+ endif ()
+endif ()
+
# Aomedia install rule.
-# TODO(tomfinegan): Add the missing pkg-config related bits.
set(AOM_INSTALL_INCS
"${AOM_ROOT}/aom/aom.h"
- "${AOM_ROOT}/aom/aomcx.h"
- "${AOM_ROOT}/aom/aomdx.h"
"${AOM_ROOT}/aom/aom_codec.h"
"${AOM_ROOT}/aom/aom_frame_buffer.h"
"${AOM_ROOT}/aom/aom_image.h"
"${AOM_ROOT}/aom/aom_integer.h"
- "${AOM_ROOT}/aom/aom_decoder.h"
- "${AOM_ROOT}/aom/aom_encoder.h"
"${AOM_ROOT}/aom/aom.h")
-set(AOM_INSTALL_BINS aomdec aomenc)
+
+if (CONFIG_AV1_DECODER)
+ set(AOM_INSTALL_BINS ${AOM_INSTALL_BINS} aomdec)
+ set(AOM_INSTALL_INCS
+ ${AOM_INSTALL_INCS}
+ "${AOM_ROOT}/aom/aom_decoder.h"
+ "${AOM_ROOT}/aom/aomdx.h")
+endif ()
+
+if (CONFIG_AV1_ENCODER)
+ set(AOM_INSTALL_INCS
+ ${AOM_INSTALL_INCS}
+ "${AOM_ROOT}/aom/aomcx.h"
+ "${AOM_ROOT}/aom/aom_encoder.h")
+ set(AOM_INSTALL_BINS ${AOM_INSTALL_BINS} aomenc)
+endif ()
+
set(AOM_INSTALL_LIBS aom)
install(FILES ${AOM_INSTALL_INCS}
DESTINATION "${CMAKE_INSTALL_PREFIX}/include/aom")
+install(FILES "${AOM_CONFIG_DIR}/aom.pc"
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
install(TARGETS ${AOM_INSTALL_LIBS} DESTINATION "${CMAKE_INSTALL_PREFIX}/lib")
install(TARGETS ${AOM_INSTALL_BINS} DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
+
+# Aomedia dist rule.
+if (CONFIG_AV1_DECODER)
+ set(AOM_DIST_APPS ${AOM_DIST_APPS} $<TARGET_FILE:aomdec>)
+endif ()
+if (CONFIG_AV1_ENCODER)
+ set(AOM_DIST_APPS ${AOM_DIST_APPS} $<TARGET_FILE:aomenc>)
+endif ()
+
+foreach (example ${AOM_EXAMPLE_TARGETS})
+ list(APPEND AOM_DIST_EXAMPLES $<TARGET_FILE:${example}>)
+endforeach ()
+
+if (NOT AOM_DIST_DIR)
+ set(AOM_DIST_DIR "${AOM_CONFIG_DIR}/dist")
+endif ()
+
+add_custom_target(dist
+ COMMAND ${CMAKE_COMMAND}
+ -DAOM_ROOT=${AOM_ROOT}
+ -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR}
+ -DAOM_DIST_DIR=${AOM_DIST_DIR}
+ -DAOM_DIST_APPS="${AOM_DIST_APPS}"
+ -DAOM_DIST_EXAMPLES="${AOM_DIST_EXAMPLES}"
+ -DAOM_DIST_INCLUDES="${AOM_INSTALL_INCS}"
+ -DAOM_DIST_LIBS=$<TARGET_FILE:aom>
+ -DENABLE_DOCS=${ENABLE_DOCS}
+ -P "${AOM_ROOT}/build/cmake/dist.cmake"
+ DEPENDS ${AOM_INSTALL_BINS} ${AOM_INSTALL_LIBS}
+ ${AOM_INSTALL_INCS} ${AOM_EXAMPLE_TARGETS})
+
+if (ENABLE_DOCS)
+ add_dependencies(dist docs)
+endif ()