diff --git a/build/cmake/aom_configure.cmake b/build/cmake/aom_configure.cmake index 7aae928d331790adc77f247c15d59c0e776c7b2b..f0f026a2ab69a9526d5a2db851edaab184083e9b 100644 --- a/build/cmake/aom_configure.cmake +++ b/build/cmake/aom_configure.cmake @@ -29,10 +29,15 @@ if (NOT AOM_TARGET_CPU) " CMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}\n" " CMAKE_GENERATOR=${CMAKE_GENERATOR}\n") endif () + elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i386" OR + "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86") + set(AOM_TARGET_CPU "x86") endif () endif () +message("--- aom_configure: Detected CPU: ${AOM_TARGET_CPU}") set(AOM_TARGET_SYSTEM ${CMAKE_SYSTEM_NAME}) + if (NOT EXISTS "${AOM_ROOT}/build/cmake/targets/${AOM_TARGET_CPU}.cmake") message(FATAL_ERROR "No RTCD template for ${AOM_TARGET_CPU}. Create one, or " "add -DAOM_TARGET_CPU=generic to your cmake command line for a " @@ -68,12 +73,15 @@ else () add_compiler_flag_if_supported("-Wfloat-conversion") add_compiler_flag_if_supported("-Wimplicit-function-declaration") add_compiler_flag_if_supported("-Wpointer-arith") - add_compiler_flag_if_supported("-Wshadow") add_compiler_flag_if_supported("-Wsign-compare") add_compiler_flag_if_supported("-Wtype-limits") add_compiler_flag_if_supported("-Wuninitialized") add_compiler_flag_if_supported("-Wunused") add_compiler_flag_if_supported("-Wvla") + + # Add -Wshadow only for C files to avoid massive gtest warning spam. + add_c_flag_if_supported("-Wshadow") + if (ENABLE_WERROR) add_compiler_flag_if_supported("-Werror") endif () diff --git a/build/cmake/aom_optimization.cmake b/build/cmake/aom_optimization.cmake index dc304b37959fbf2d74f8c0db76102d5fcf9b102b..701abff30f2a980a28cc2c80d4b961eeabc870ed 100644 --- a/build/cmake/aom_optimization.cmake +++ b/build/cmake/aom_optimization.cmake @@ -81,6 +81,8 @@ function (get_asm_obj_format out_format) elseif ("${AOM_TARGET_CPU}" STREQUAL "x86") if ("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin") set(objformat "macho32") + elseif ("${AOM_TARGET_SYSTEM}" STREQUAL "Linux") + set(objformat "elf32") elseif ("${AOM_TARGET_SYSTEM}" STREQUAL "Windows") set(objformat "win32") else () diff --git a/build/cmake/toolchains/x86-linux.cmake b/build/cmake/toolchains/x86-linux.cmake new file mode 100644 index 0000000000000000000000000000000000000000..077c8f325ba8bf3607c5e65b5eb709dd8b22a49a --- /dev/null +++ b/build/cmake/toolchains/x86-linux.cmake @@ -0,0 +1,14 @@ +## +## 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(CMAKE_SYSTEM_PROCESSOR "x86") +set(CMAKE_SYSTEM_NAME "Linux") +set(CMAKE_C_COMPILER_ARG1 "-m32") +set(CMAKE_CXX_COMPILER_ARG1 "-m32")