From b7d025400d7b0bac63c0b8f6322531a8a4c3510a Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Wed, 1 Mar 2017 21:14:28 -0800 Subject: [PATCH] Move aom_util cmake commands to aom_util/aom_util.cmake. Also adds CONFIG_BITSTREAM_DEBUG support (because it was in aom_util/aom_util.mk, and that's partly the guidance here). BUG=https://bugs.chromium.org/p/aomedia/issues/detail?id=76 Change-Id: I971b4025e345fd7d6d766526059f74d8b6ff2ebd --- CMakeLists.txt | 17 +++++------------ aom_util/aom_util.cmake | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 aom_util/aom_util.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 474cc4946..6e4ebc05e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ include("${AOM_ROOT}/aom_dsp/aom_dsp.cmake") include("${AOM_ROOT}/aom_mem/aom_mem.cmake") include("${AOM_ROOT}/aom_ports/aom_ports.cmake") 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") @@ -99,11 +100,6 @@ set(AOM_SOURCES "${AOM_ROOT}/aom/src/aom_encoder.c" "${AOM_ROOT}/aom/src/aom_image.c") -set(AOM_UTIL_SOURCES - "${AOM_ROOT}/aom_util/aom_thread.c" - "${AOM_ROOT}/aom_util/aom_thread.h" - "${AOM_ROOT}/aom_util/endian_inl.h") - set(AOM_COMMON_APP_UTIL_SOURCES "${AOM_ROOT}/args.c" "${AOM_ROOT}/args.h" @@ -164,21 +160,18 @@ add_rtcd_build_step("${AOM_ROOT}/av1/common/av1_rtcd_defs.pl" "av1_rtcd") add_library(aom_rtcd OBJECT ${AOM_RTCD_SOURCES}) -add_library(aom_util OBJECT ${AOM_UTIL_SOURCES}) add_library(aom_encoder_stats OBJECT ${AOM_ENCODER_STATS_SOURCES}) -add_library(aom - ${AOM_SOURCES} - $ - $) +add_library(aom ${AOM_SOURCES} $) # List of object and static library targets. -set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_rtcd aom_util aom_encoder_stats - aom_mem aom_scale aom) +set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_rtcd aom_encoder_stats aom_mem + aom_scale aom) # Setup dependencies. setup_aom_dsp_targets() setup_aom_mem_targets() setup_aom_ports_targets() +setup_aom_util_targets() setup_aom_scale_targets() setup_av1_targets() diff --git a/aom_util/aom_util.cmake b/aom_util/aom_util.cmake new file mode 100644 index 000000000..484d9d9a0 --- /dev/null +++ b/aom_util/aom_util.cmake @@ -0,0 +1,29 @@ +## +## Copyright (c) 2017, Alliance for Open Media. All rights reserved +## +## This source code is subject to the terms of the BSD 2 Clause License and +## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License +## was not distributed with this source code in the LICENSE file, you can +## obtain it at www.aomedia.org/license/software. If the Alliance for Open +## Media Patent License 1.0 was not distributed with this source code in the +## PATENTS file, you can obtain it at www.aomedia.org/license/patent. +## +set(AOM_UTIL_SOURCES + "${AOM_ROOT}/aom_util/aom_thread.c" + "${AOM_ROOT}/aom_util/aom_thread.h" + "${AOM_ROOT}/aom_util/endian_inl.h") + +if (CONFIG_BITSTREAM_DEBUG) + set(AOM_UTIL_SOURCES + ${AOM_UTIL_SOURCES} + "${AOM_ROOT}/aom_util/debug_util.c" + "${AOM_ROOT}/aom_util/debug_util.h") +endif () + +# Creates the aom_util build target and makes libaom depend on it. The libaom +# target must exist before this function is called. +function (setup_aom_util_targets) + add_library(aom_util OBJECT ${AOM_UTIL_SOURCES}) + set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_util PARENT_SCOPE) + target_sources(aom PUBLIC $) +endfunction ()