Commit bbd740ee authored by David Michael Barr's avatar David Michael Barr Committed by Commit Bot

libaom: tidy files for cmake config

BUILD.gn.cmake:
Merge blocks with identical conditions. Remove an empty block.
Inline arm_assembly_sources, it has a single reference.
Use generic sources for libaom static_library.
Note, architecure-specific sources are included via deps.

cmake_update.sh:
Move common console message to reset_dirs step.
Handle creation of config dir for aom_version.h on first run.

Bug: 783519
Change-Id: If8b4be6bb1f54ea0eec839c8281cd1861e4f3195
Reviewed-on: https://chromium-review.googlesource.com/1077715Reviewed-by: default avatarJohann Koenig <johannkoenig@google.com>
Commit-Queue: Johann Koenig <johannkoenig@google.com>
Cr-Commit-Position: refs/heads/master@{#562957}
parent 2e4b3ac2
......@@ -107,9 +107,6 @@ if (enable_av1_decoder) {
sources = aom_dsp_common_asm_sse2
sources += aom_dsp_common_asm_ssse3
sources += aom_ports_asm_x86
if (current_cpu == "x64") {
}
defines = [ "CHROMIUM" ]
if (is_android) {
# TODO(johannkoenig): this was for vp8 assembly. May no longer apply.
......@@ -119,9 +116,7 @@ if (enable_av1_decoder) {
}
include_dirs = libaom_include_dirs
}
}
if (current_cpu == "x86" || (current_cpu == "x64" && !is_msan)) {
# The following targets are deliberately source_set rather than
# static_library. The :libaom target exposes these intrinsic implementations
# via global function pointer symbols, which hides the object dependency at
......@@ -204,12 +199,10 @@ if (enable_av1_decoder) {
sources += aom_dsp_common_intrin_neon
}
arm_assembly_sources = aom_dsp_common_asm_neon
# Converts ARM assembly files to GAS style.
action_foreach("convert_arm_assembly") {
script = "//third_party/libvpx/run_perl.py"
sources = arm_assembly_sources
sources = aom_dsp_common_asm_neon
gen_file =
get_label_info("//third_party/libaom/source/libaom", "root_gen_dir") +
"/{{source_root_relative_dir}}/{{source_file_part}}.S"
......@@ -257,44 +250,18 @@ if (enable_av1_decoder) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
if (is_nacl) {
sources = libaom_srcs_generic
} else if (current_cpu == "x86") {
sources = libaom_srcs_x86
} else if (current_cpu == "x64") {
if (is_msan) {
sources = libaom_srcs_generic
} else {
sources = aom_av1_common_sources
sources += aom_av1_decoder_sources
sources += aom_dsp_common_sources
sources += aom_dsp_decoder_sources
sources += aom_mem_sources
sources += aom_rtcd_sources
sources += aom_scale_sources
sources += aom_sources
sources += aom_util_sources
}
} else if (current_cpu == "mipsel" || current_cpu == "mips64el") {
sources = libaom_srcs_mips
} else if (current_cpu == "arm") {
sources = aom_av1_common_sources
sources += aom_av1_decoder_sources
sources += aom_dsp_common_sources
sources += aom_dsp_decoder_sources
sources += aom_mem_sources
sources += aom_rtcd_sources
sources += aom_scale_sources
sources += aom_sources
sources += aom_util_sources
} else if (current_cpu == "arm64") {
sources = libaom_srcs_arm64
}
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":libaom_config" ]
sources = aom_av1_common_sources
sources += aom_av1_decoder_sources
sources += aom_dsp_common_sources
sources += aom_dsp_decoder_sources
sources += aom_mem_sources
sources += aom_rtcd_sources
sources += aom_scale_sources
sources += aom_sources
sources += aom_util_sources
deps = []
if (current_cpu == "x86" || (current_cpu == "x64" && !is_msan)) {
deps += [
......@@ -309,14 +276,13 @@ if (enable_av1_decoder) {
}
if (cpu_arch_full == "arm-neon" || cpu_arch_full == "arm-neon-cpu-detect") {
deps += [
":libaom_intrinsics_neon",
":libaom_assembly_arm",
":libaom_intrinsics_neon",
]
}
if (is_android) {
deps += [ "//third_party/android_tools:cpu_features" ]
}
public_configs = [ ":libaom_external_config" ]
}
}
......@@ -43,6 +43,7 @@ function reset_dirs {
mkdir "${TMP}"
cd "${TMP}"
echo "Generate ${1} config files."
rm -fr "${CFG}/${1}"
mkdir -p "${CFG}/${1}/config"
}
......@@ -166,16 +167,18 @@ all_platforms+=" -DCONFIG_LOWBITDEPTH=1"
#all_platforms+=" -DENABLE_AVX2=0"
toolchain="-DCMAKE_TOOLCHAIN_FILE=${SRC}/build/cmake/toolchains"
echo "Generate linux/ia32 config files."
reset_dirs linux/ia32
gen_config_files linux/ia32 "${toolchain}/x86-linux.cmake ${all_platforms}"
# libaom_srcs.gni and aom_version.h are shared.
cp libaom_srcs.gni "${BASE}"
rm -f "${CFG}/aom_version.h"
cp config/aom_version.h "${CFG}/config"
if [ ! -f "${CFG}/config/aom_version.h" ]; then
# These steps can be removed after the first run.
rm -f "${CFG}/aom_version.h"
mkdir -p "${CFG}/config/"
fi
cp config/aom_version.h "${CFG}/config/"
gen_rtcd_header linux/ia32 x86 #--disable-avx2
echo "Generate linux/x64 config files."
reset_dirs linux/x64
gen_config_files linux/x64 "${all_platforms}"
gen_rtcd_header linux/x64 x86_64 #--disable-avx2
......@@ -183,7 +186,6 @@ gen_rtcd_header linux/x64 x86_64 #--disable-avx2
# Windows looks like linux but with some minor tweaks. Cmake doesn't generate VS
# project files on linux otherwise we would not resort to these hacks.
echo "Generate win/x64 config files"
reset_dirs win/x64
cp "${CFG}/linux/x64/config"/* "${CFG}/win/x64/config/"
sed -i.bak \
......@@ -197,18 +199,15 @@ rm "${CFG}/win/x64/config/aom_config.h.bak"
egrep "#define [A-Z0-9_]+ [01]" "${CFG}/win/x64/config/aom_config.h" \
| awk '{print "%define " $2 " " $3}' > "${CFG}/win/x64/config/aom_config.asm"
echo "Generate linux/arm config files."
reset_dirs linux/arm
gen_config_files linux/arm \
"${toolchain}/armv7-linux-gcc.cmake -DENABLE_NEON=0 -DENABLE_NEON_ASM=0 ${all_platforms}"
gen_rtcd_header linux/arm armv7 --disable-neon
echo "Generate linux/arm-neon config files."
reset_dirs linux/arm-neon
gen_config_files linux/arm-neon "${toolchain}/armv7-linux-gcc.cmake ${all_platforms}"
gen_rtcd_header linux/arm-neon armv7
echo "Generate linux/arm-neon-cpu-detect config files."
reset_dirs linux/arm-neon-cpu-detect
gen_config_files linux/arm-neon-cpu-detect \
"${toolchain}/armv7-linux-gcc.cmake -DCONFIG_RUNTIME_CPU_DETECT=1 ${all_platforms}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment