diff options
Diffstat (limited to 'third_party/aom/CMakeLists.txt')
-rw-r--r-- | third_party/aom/CMakeLists.txt | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/third_party/aom/CMakeLists.txt b/third_party/aom/CMakeLists.txt index 3b27de58f..dfafc8c64 100644 --- a/third_party/aom/CMakeLists.txt +++ b/third_party/aom/CMakeLists.txt @@ -11,8 +11,9 @@ cmake_minimum_required(VERSION 3.5) if (NOT EMSCRIPTEN) - if ("${CMAKE_BUILD_TYPE}" STREQUAL "") - set(CMAKE_BUILD_TYPE "RelWithDebInfo") + if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE + "Build type: Debug, Release, RelWithDebInfo or MinSizeRel" STRING FORCE) endif () endif () @@ -20,6 +21,11 @@ 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) +option(ENABLE_IDE_TEST_HOSTING + "Enables running tests within IDEs like Visual Studio and Xcode." OFF) + +# $BUILD_SHARED_LIBS is a CMake built-in-- it's listed here for visibility. +option(BUILD_SHARED_LIBS "CMake should generate a shared library build." OFF) project(AOM C CXX) @@ -34,7 +40,6 @@ if ("${AOM_ROOT}" STREQUAL "${AOM_CONFIG_DIR}") endif () include("${AOM_ROOT}/build/cmake/aom_configure.cmake") -include("${AOM_ROOT}/build/cmake/aom_optimization.cmake") include("${AOM_ROOT}/aom_dsp/aom_dsp.cmake") include("${AOM_ROOT}/aom_mem/aom_mem.cmake") include("${AOM_ROOT}/aom_ports/aom_ports.cmake") @@ -42,6 +47,7 @@ include("${AOM_ROOT}/aom_scale/aom_scale.cmake") include("${AOM_ROOT}/aom_util/aom_util.cmake") include("${AOM_ROOT}/av1/av1.cmake") include("${AOM_ROOT}/test/test.cmake") +include("${AOM_ROOT}/build/cmake/util.cmake") set(AOM_RTCD_SOURCES "${AOM_CONFIG_DIR}/aom_dsp_rtcd.h" @@ -212,9 +218,9 @@ add_library(aom_common_app_util OBJECT ${AOM_COMMON_APP_UTIL_SOURCES}) 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>) + "${AOM_ROOT}/aomdec.c" + $<TARGET_OBJECTS:aom_common_app_util> + $<TARGET_OBJECTS:aom_decoder_app_util>) if (CONFIG_ANALYZER) add_executable(analyzer @@ -223,6 +229,7 @@ if (CONFIG_AV1_DECODER) $<TARGET_OBJECTS:aom_decoder_app_util>) target_link_libraries(analyzer ${AOM_LIB_LINK_TYPE} ${wxWidgets_LIBRARIES}) set(AOM_APP_TARGETS ${AOM_APP_TARGETS} analyzer) + set(AOM_DECODER_EXAMPLE_TARGETS ${AOM_DECODER_EXAMPLE_TARGETS} analyzer) endif () add_executable(decode_to_md5 @@ -247,14 +254,17 @@ if (CONFIG_AV1_DECODER) 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") + append_link_flag_to_target("inspect" "-s TOTAL_MEMORY=134217728") + append_link_flag_to_target("inspect" "-s MODULARIZE=1") + append_link_flag_to_target("inspect" + "-s EXPORT_NAME=\"\'DecoderModule\'\"") + append_link_flag_to_target("inspect" "--memory-init-file 0") + if ("${CMAKE_BUILD_TYPE}" STREQUAL "") # Default to -O3 when no build type specified. - add_compiler_flag_if_supported("-O3") + append_compiler_flag("-O3") endif () + em_link_post_js(inspect "${AOM_ROOT}/tools/inspect-post.js") endif () endif () @@ -324,7 +334,7 @@ if (CONFIG_LIBYUV) # Add to existing targets. foreach (aom_app ${AOM_APP_TARGETS}) - target_sources(${aom_app} PUBLIC $<TARGET_OBJECTS:yuv>) + target_sources(${aom_app} PRIVATE $<TARGET_OBJECTS:yuv>) set_property(TARGET ${aom_app} PROPERTY LINKER_LANGUAGE CXX) endforeach () endif () @@ -339,15 +349,15 @@ if (CONFIG_WEBM_IO) # Add to existing targets. if (CONFIG_AV1_DECODER) - target_sources(aom_decoder_app_util PUBLIC ${AOM_WEBM_DECODER_SOURCES}) + target_sources(aom_decoder_app_util PRIVATE ${AOM_WEBM_DECODER_SOURCES}) endif () if (CONFIG_AV1_ENCODER) - target_sources(aom_encoder_app_util PUBLIC ${AOM_WEBM_ENCODER_SOURCES}) + target_sources(aom_encoder_app_util PRIVATE ${AOM_WEBM_ENCODER_SOURCES}) endif () foreach (aom_app ${AOM_APP_TARGETS}) - target_sources(${aom_app} PUBLIC $<TARGET_OBJECTS:webm>) + target_sources(${aom_app} PRIVATE $<TARGET_OBJECTS:webm>) set_property(TARGET ${aom_app} PROPERTY LINKER_LANGUAGE CXX) endforeach () endif () @@ -374,11 +384,8 @@ if (XCODE) # Note: LINKER_LANGUAGE is explicitly set to C++ for all targets touched # here, it really is the Xcode generator's fault, or just a deficiency in # Xcode itself. - set(XCODE_DUMMY_CXX_FILE "${AOM_CONFIG_DIR}/dummy.cc") - file(WRITE "${XCODE_DUMMY_CXX_FILE}" - "// Xcode needs a C++ file to link, ignore this file.") foreach (aom_app ${AOM_APP_TARGETS}) - target_sources(${aom_app} PUBLIC "${XCODE_DUMMY_CXX_FILE}") + add_dummy_source_file_to_target("${aom_app}" "cc") endforeach () endif () endif () @@ -391,6 +398,12 @@ if ("${CMAKE_GENERATOR}" MATCHES "Makefiles$" ) RUNTIME_OUTPUT_DIRECTORY "${AOM_CONFIG_DIR}/examples") endif () +if (BUILD_SHARED_LIBS) + include("${AOM_ROOT}/build/cmake/exports.cmake") + setup_exports_target() + set_target_properties(aom PROPERTIES SOVERSION 0) +endif () + # Aomedia documentation rule. if (ENABLE_DOCS) include(FindDoxygen) |