diff options
Diffstat (limited to 'third_party/aom/build/cmake/toolchains')
22 files changed, 684 insertions, 0 deletions
diff --git a/third_party/aom/build/cmake/toolchains/android.cmake b/third_party/aom/build/cmake/toolchains/android.cmake new file mode 100644 index 0000000000..fb086856a7 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/android.cmake @@ -0,0 +1,53 @@ +# +# Copyright (c) 2019, 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_ANDROID_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ANDROID_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_ANDROID_CMAKE_ 1) + +if(NOT ANDROID_PLATFORM) + set(ANDROID_PLATFORM android-24) +endif() + +# Choose target architecture with: +# +# -DANDROID_ABI={armeabi-v7a,armeabi-v7a with NEON,arm64-v8a,x86,x86_64} +if(NOT ANDROID_ABI) + set(ANDROID_ABI arm64-v8a) +endif() + +# Toolchain files don't have access to cached variables: +# https://gitlab.kitware.com/cmake/cmake/issues/16170. Set an intermediate +# environment variable when loaded the first time. +if(AOM_ANDROID_NDK_PATH) + set(ENV{_AOM_ANDROID_NDK_PATH} "${AOM_ANDROID_NDK_PATH}") +else() + set(AOM_ANDROID_NDK_PATH "$ENV{_AOM_ANDROID_NDK_PATH}") +endif() + +if("${AOM_ANDROID_NDK_PATH}" STREQUAL "") + message(FATAL_ERROR "AOM_ANDROID_NDK_PATH not set.") + return() +endif() + +include("${AOM_ANDROID_NDK_PATH}/build/cmake/android.toolchain.cmake") + +if(ANDROID_ABI MATCHES "^armeabi") + set(AOM_NEON_INTRIN_FLAG "-mfpu=neon") +endif() + +if(ANDROID_ABI MATCHES "^arm") + set(CMAKE_ASM_COMPILER as) +elseif(ANDROID_ABI MATCHES "^x86") + set(CMAKE_ASM_NASM_COMPILER yasm) +endif() + +set(CMAKE_SYSTEM_NAME "Android") diff --git a/third_party/aom/build/cmake/toolchains/arm-ios-common.cmake b/third_party/aom/build/cmake/toolchains/arm-ios-common.cmake new file mode 100644 index 0000000000..2c433befd9 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/arm-ios-common.cmake @@ -0,0 +1,24 @@ +# +# 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_ARM_IOS_COMMON_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARM_IOS_COMMON_CMAKE_ +set(AOM_BUILD_CMAKE_ARM_IOS_COMMON_CMAKE_ 1) + +set(CMAKE_SYSTEM_NAME "Darwin") +set(CMAKE_OSX_SYSROOT iphoneos) +set(CMAKE_C_COMPILER clang) +set(CMAKE_C_FLAGS_INIT "-arch ${CMAKE_SYSTEM_PROCESSOR}") +set(CMAKE_CXX_COMPILER clang++) +set(CMAKE_CXX_FLAGS_INIT "-arch ${CMAKE_SYSTEM_PROCESSOR}") +set(CMAKE_EXE_LINKER_FLAGS_INIT "-arch ${CMAKE_SYSTEM_PROCESSOR}") + +# TODO(tomfinegan): Handle bit code embedding. diff --git a/third_party/aom/build/cmake/toolchains/arm64-ios.cmake b/third_party/aom/build/cmake/toolchains/arm64-ios.cmake new file mode 100644 index 0000000000..6feb1090f2 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/arm64-ios.cmake @@ -0,0 +1,23 @@ +# +# 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_IOS_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_IOS_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_IOS_CMAKE_ 1) + +if(XCODE) # TODO(tomfinegan): Handle arm builds in Xcode. + message(FATAL_ERROR "This toolchain does not support Xcode.") +endif() + +set(CMAKE_SYSTEM_PROCESSOR "arm64") +set(CMAKE_OSX_ARCHITECTURES "arm64") + +include("${CMAKE_CURRENT_LIST_DIR}/arm-ios-common.cmake") diff --git a/third_party/aom/build/cmake/toolchains/arm64-linux-clang.cmake b/third_party/aom/build/cmake/toolchains/arm64-linux-clang.cmake new file mode 100644 index 0000000000..b4645cc09e --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/arm64-linux-clang.cmake @@ -0,0 +1,30 @@ +# +# Copyright (c) 2023, 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. +# + +if(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_LINUX_CLANG_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_LINUX_CLANG_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_LINUX_CLANG_CMAKE_ 1) + +set(CMAKE_SYSTEM_NAME "Linux") + +set(TRIPLE aarch64-linux-gnu) + +set(CMAKE_C_COMPILER clang) +set(CMAKE_C_COMPILER_TARGET ${TRIPLE}) + +set(CMAKE_CXX_COMPILER clang++) +set(CMAKE_CXX_COMPILER_TARGET ${TRIPLE}) + +set(CMAKE_ASM_COMPILER clang) +set(CMAKE_ASM_COMPILER_TARGET ${TRIPLE}) + +set(CMAKE_SYSTEM_PROCESSOR "arm64") diff --git a/third_party/aom/build/cmake/toolchains/arm64-linux-gcc.cmake b/third_party/aom/build/cmake/toolchains/arm64-linux-gcc.cmake new file mode 100644 index 0000000000..3d0dff0252 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/arm64-linux-gcc.cmake @@ -0,0 +1,40 @@ +# +# 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_LINUX_GCC_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_LINUX_GCC_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_LINUX_GCC_CMAKE_ 1) + +set(CMAKE_SYSTEM_NAME "Linux") + +if("${CROSS}" STREQUAL "") + + # Default the cross compiler prefix to one used by Debian and other package + # management systems. + set(CROSS aarch64-linux-gnu-) +endif() + +if(NOT CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER ${CROSS}gcc) +endif() +if(NOT CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER ${CROSS}g++) +endif() +if(NOT CMAKE_ASM_COMPILER) + set(CMAKE_ASM_COMPILER ${CROSS}as) +endif() +set(CMAKE_C_FLAGS_INIT "-march=armv8-a") +set(CMAKE_CXX_FLAGS_INIT "-march=armv8-a") +set(AOM_AS_FLAGS "-march=armv8-a") +set(CMAKE_SYSTEM_PROCESSOR "arm64") + +# No intrinsics flag required for arm64-linux-gcc. +set(AOM_NEON_INTRIN_FLAG "") diff --git a/third_party/aom/build/cmake/toolchains/arm64-macos.cmake b/third_party/aom/build/cmake/toolchains/arm64-macos.cmake new file mode 100644 index 0000000000..99f8d16e16 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/arm64-macos.cmake @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022, 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 "arm64") +set(CMAKE_SYSTEM_NAME "Darwin") +set(CMAKE_OSX_ARCHITECTURES "arm64") +set(CMAKE_C_FLAGS_INIT "-arch arm64") +set(CMAKE_CXX_FLAGS_INIT "-arch arm64") +set(CMAKE_EXE_LINKER_FLAGS_INIT "-arch arm64") diff --git a/third_party/aom/build/cmake/toolchains/arm64-mingw-gcc.cmake b/third_party/aom/build/cmake/toolchains/arm64-mingw-gcc.cmake new file mode 100644 index 0000000000..95b26d3ceb --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/arm64-mingw-gcc.cmake @@ -0,0 +1,36 @@ +# +# Copyright (c) 2018, 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_MINGW_GCC_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_MINGW_GCC_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_MINGW_GCC_CMAKE_ 1) + +set(CMAKE_SYSTEM_PROCESSOR "arm64") +set(CMAKE_SYSTEM_NAME "Windows") + +if("${CROSS}" STREQUAL "") + + # Default the cross compiler prefix to one used by MSYS2. + set(CROSS aarch64-w64-mingw32-) +endif() + +if(NOT CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER ${CROSS}gcc) +endif() +if(NOT CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER ${CROSS}g++) +endif() +if(NOT CMAKE_AR) + set(CMAKE_AR ${CROSS}ar CACHE FILEPATH Archiver) +endif() +if(NOT CMAKE_RANLIB) + set(CMAKE_RANLIB ${CROSS}ranlib CACHE FILEPATH Indexer) +endif() diff --git a/third_party/aom/build/cmake/toolchains/armv7-ios.cmake b/third_party/aom/build/cmake/toolchains/armv7-ios.cmake new file mode 100644 index 0000000000..11f7e160df --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/armv7-ios.cmake @@ -0,0 +1,31 @@ +# +# 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_IOS_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_IOS_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_IOS_CMAKE_ 1) + +if(XCODE) + + # TODO(tomfinegan): Handle arm builds in Xcode. + message(FATAL_ERROR "This toolchain does not support Xcode.") +endif() + +set(CMAKE_SYSTEM_PROCESSOR "armv7") +set(CMAKE_OSX_ARCHITECTURES "armv7") + +include("${CMAKE_CURRENT_LIST_DIR}/arm-ios-common.cmake") + +# No intrinsics flag required for armv7s-ios. +set(AOM_NEON_INTRIN_FLAG "") + +# No runtime cpu detect for armv7s-ios. +set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE STRING "") diff --git a/third_party/aom/build/cmake/toolchains/armv7-linux-gcc.cmake b/third_party/aom/build/cmake/toolchains/armv7-linux-gcc.cmake new file mode 100644 index 0000000000..aa0550574d --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/armv7-linux-gcc.cmake @@ -0,0 +1,46 @@ +# +# 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_LINUX_GCC_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_LINUX_GCC_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_LINUX_GCC_CMAKE_ 1) + +set(CMAKE_SYSTEM_NAME "Linux") + +if("${CROSS}" STREQUAL "") + + # Default the cross compiler prefix to one used by Debian and other package + # management systems. + set(CROSS arm-linux-gnueabihf-) +endif() + +if(NOT ${CROSS} MATCHES hf-$) + set(AOM_EXTRA_TOOLCHAIN_FLAGS "-mfloat-abi=softfp") +endif() + +if(NOT CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER ${CROSS}gcc) +endif() +if(NOT CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER ${CROSS}g++) +endif() +if(NOT CMAKE_ASM_COMPILER) + set(CMAKE_ASM_COMPILER ${CROSS}as) +endif() +set(CMAKE_C_FLAGS_INIT "-march=armv7-a -mfpu=vfpv3 \ + ${AOM_EXTRA_TOOLCHAIN_FLAGS}") +set(CMAKE_CXX_FLAGS_INIT "-march=armv7-a -mfpu=vfpv3 \ + ${AOM_EXTRA_TOOLCHAIN_FLAGS}") +set(AOM_AS_FLAGS --defsym ARCHITECTURE=7 -march=armv7-a -mfpu=neon + ${AOM_EXTRA_TOOLCHAIN_FLAGS}) +set(CMAKE_SYSTEM_PROCESSOR "armv7") + +set(AOM_NEON_INTRIN_FLAG "-mfpu=neon ${AOM_EXTRA_TOOLCHAIN_FLAGS}") diff --git a/third_party/aom/build/cmake/toolchains/armv7-mingw-gcc.cmake b/third_party/aom/build/cmake/toolchains/armv7-mingw-gcc.cmake new file mode 100644 index 0000000000..93f8c065c9 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/armv7-mingw-gcc.cmake @@ -0,0 +1,39 @@ +# +# Copyright (c) 2018, 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_MINGW_GCC_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_MINGW_GCC_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_MINGW_GCC_CMAKE_ 1) + +set(CMAKE_SYSTEM_PROCESSOR "armv7") +set(CMAKE_SYSTEM_NAME "Windows") + +if("${CROSS}" STREQUAL "") + + # Default the cross compiler prefix to one used by MSYS2. + set(CROSS armv7-w64-mingw32-) +endif() + +if(NOT CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER ${CROSS}gcc) +endif() +if(NOT CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER ${CROSS}g++) +endif() +if(NOT CMAKE_AR) + set(CMAKE_AR ${CROSS}ar CACHE FILEPATH Archiver) +endif() +if(NOT CMAKE_RANLIB) + set(CMAKE_RANLIB ${CROSS}ranlib CACHE FILEPATH Indexer) +endif() + +# No runtime cpu detect for armv7-mingw-gcc. +set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE STRING "") diff --git a/third_party/aom/build/cmake/toolchains/armv7s-ios.cmake b/third_party/aom/build/cmake/toolchains/armv7s-ios.cmake new file mode 100644 index 0000000000..faa2933cf0 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/armv7s-ios.cmake @@ -0,0 +1,31 @@ +# +# 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7S_IOS_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7S_IOS_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7S_IOS_CMAKE_ 1) + +if(XCODE) + + # TODO(tomfinegan): Handle arm builds in Xcode. + message(FATAL_ERROR "This toolchain does not support Xcode.") +endif() + +set(CMAKE_SYSTEM_PROCESSOR "armv7s") +set(CMAKE_OSX_ARCHITECTURES "armv7s") + +include("${CMAKE_CURRENT_LIST_DIR}/arm-ios-common.cmake") + +# No intrinsics flag required for armv7s-ios. +set(AOM_NEON_INTRIN_FLAG "") + +# No runtime cpu detect for armv7s-ios. +set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE STRING "") diff --git a/third_party/aom/build/cmake/toolchains/i686-linux-gcc.cmake b/third_party/aom/build/cmake/toolchains/i686-linux-gcc.cmake new file mode 100644 index 0000000000..c4f6ab9465 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/i686-linux-gcc.cmake @@ -0,0 +1,34 @@ +# +# Copyright (c) 2023, 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_I686_LINUX_GCC_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_I686_LINUX_GCC_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_I686_LINUX_GCC_CMAKE_ 1) + +set(CMAKE_SYSTEM_NAME "Linux") +set(CMAKE_SYSTEM_PROCESSOR "x86") + +if("${CROSS}" STREQUAL "") + + # Default the cross compiler prefix to one used by Debian and other package + # management systems. + set(CROSS i686-linux-gnu-) +endif() + +if(NOT CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER ${CROSS}gcc) +endif() +if(NOT CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER ${CROSS}g++) +endif() +if(NOT CMAKE_ASM_COMPILER) + set(CMAKE_ASM_COMPILER ${CROSS}as) +endif() diff --git a/third_party/aom/build/cmake/toolchains/ios-simulator-common.cmake b/third_party/aom/build/cmake/toolchains/ios-simulator-common.cmake new file mode 100644 index 0000000000..173c423c3d --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/ios-simulator-common.cmake @@ -0,0 +1,24 @@ +# +# 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_IOS_SIMULATOR_COMMON_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_IOS_SIMULATOR_COMMON_CMAKE_ +set(AOM_BUILD_CMAKE_IOS_SIMULATOR_COMMON_CMAKE_ 1) + +set(CMAKE_SYSTEM_NAME "Darwin") +set(CMAKE_OSX_SYSROOT iphonesimulator) +set(CMAKE_C_COMPILER clang) +set(CMAKE_C_FLAGS_INIT "-arch ${CMAKE_SYSTEM_PROCESSOR}") +set(CMAKE_CXX_COMPILER clang++) +set(CMAKE_CXX_FLAGS_INIT "-arch ${CMAKE_SYSTEM_PROCESSOR}") +set(CMAKE_EXE_LINKER_FLAGS_INIT "-arch ${CMAKE_SYSTEM_PROCESSOR}") + +# TODO(tomfinegan): Handle bit code embedding. diff --git a/third_party/aom/build/cmake/toolchains/ppc-linux-gcc.cmake b/third_party/aom/build/cmake/toolchains/ppc-linux-gcc.cmake new file mode 100644 index 0000000000..3aa265254e --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/ppc-linux-gcc.cmake @@ -0,0 +1,36 @@ +# +# Copyright (c) 2018, 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_PPC_LINUX_GCC_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_PPC_LINUX_GCC_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_PPC_LINUX_GCC_CMAKE_ 1) + +set(CMAKE_SYSTEM_NAME "Linux") + +if("${CROSS}" STREQUAL "") + + # Default the cross compiler prefix to one used by Debian and other package + # management systems. + set(CROSS powerpc64le-linux-gnu-) +endif() + +if(NOT CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER ${CROSS}gcc) +endif() +if(NOT CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER ${CROSS}g++) +endif() +if(NOT CMAKE_ASM_COMPILER) + set(CMAKE_ASM_COMPILER ${CROSS}as) +endif() +set(CMAKE_SYSTEM_PROCESSOR "ppc") + +set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE STRING "") diff --git a/third_party/aom/build/cmake/toolchains/riscv-linux-gcc.cmake b/third_party/aom/build/cmake/toolchains/riscv-linux-gcc.cmake new file mode 100644 index 0000000000..4133be68b3 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/riscv-linux-gcc.cmake @@ -0,0 +1,36 @@ +# +# Copyright (c) 2022, 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_RISCV_LINUX_GCC_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_RISCV_LINUX_GCC_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_RISCV_LINUX_GCC_CMAKE_ 1) + +set(CMAKE_SYSTEM_NAME "Linux") + +if("${CROSS}" STREQUAL "") + + # Default the cross compiler prefix to one used by Debian and other package + # management systems. + set(CROSS riscv64-linux-gnu-) +endif() + +if(NOT CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER ${CROSS}gcc) +endif() +if(NOT CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER ${CROSS}g++) +endif() +if(NOT CMAKE_ASM_COMPILER) + set(CMAKE_ASM_COMPILER ${CROSS}as) +endif() +set(CMAKE_SYSTEM_PROCESSOR "riscv") + +set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE STRING "") diff --git a/third_party/aom/build/cmake/toolchains/x86-ios-simulator.cmake b/third_party/aom/build/cmake/toolchains/x86-ios-simulator.cmake new file mode 100644 index 0000000000..caacb8c38b --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/x86-ios-simulator.cmake @@ -0,0 +1,28 @@ +# +# 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_X86_IOS_SIMULATOR_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_X86_IOS_SIMULATOR_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_X86_IOS_SIMULATOR_CMAKE_ 1) + +if(XCODE) + + # TODO(tomfinegan): Handle ios sim builds in Xcode. + message(FATAL_ERROR "This toolchain does not support Xcode.") +endif() + +set(CMAKE_SYSTEM_PROCESSOR "i386") +set(CMAKE_OSX_ARCHITECTURES "i386") + +# Avoid noisy PIC/PIE warnings. +set(CONFIG_PIC 1 CACHE STRING "") + +include("${CMAKE_CURRENT_LIST_DIR}/ios-simulator-common.cmake") diff --git a/third_party/aom/build/cmake/toolchains/x86-linux.cmake b/third_party/aom/build/cmake/toolchains/x86-linux.cmake new file mode 100644 index 0000000000..a9c4f8c6b4 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/x86-linux.cmake @@ -0,0 +1,20 @@ +# +# 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_X86_LINUX_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_X86_LINUX_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_X86_LINUX_CMAKE_ 1) + +set(CMAKE_SYSTEM_PROCESSOR "x86") +set(CMAKE_SYSTEM_NAME "Linux") +set(CMAKE_C_FLAGS_INIT "-m32") +set(CMAKE_CXX_FLAGS_INIT "-m32") +set(CMAKE_EXE_LINKER_FLAGS_INIT "-m32") diff --git a/third_party/aom/build/cmake/toolchains/x86-macos.cmake b/third_party/aom/build/cmake/toolchains/x86-macos.cmake new file mode 100644 index 0000000000..68e1bb07ff --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/x86-macos.cmake @@ -0,0 +1,19 @@ +# +# 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 "Darwin") +set(CMAKE_OSX_ARCHITECTURES "i386") +set(CMAKE_C_FLAGS_INIT "-arch i386") +set(CMAKE_CXX_FLAGS_INIT "-arch i386") +set(CMAKE_EXE_LINKER_FLAGS_INIT "-arch i386") + +# Apple tools always complain in 32 bit mode without PIC. +set(CONFIG_PIC 1 CACHE STRING "") diff --git a/third_party/aom/build/cmake/toolchains/x86-mingw-gcc.cmake b/third_party/aom/build/cmake/toolchains/x86-mingw-gcc.cmake new file mode 100644 index 0000000000..2208333f37 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/x86-mingw-gcc.cmake @@ -0,0 +1,40 @@ +# +# 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_X86_MINGW_GCC_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_X86_MINGW_GCC_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_X86_MINGW_GCC_CMAKE_ 1) + +set(CMAKE_SYSTEM_PROCESSOR "x86") +set(CMAKE_SYSTEM_NAME "Windows") +set(CMAKE_C_FLAGS_INIT "-m32") +set(CMAKE_CXX_FLAGS_INIT "-m32") +set(CMAKE_EXE_LINKER_FLAGS_INIT "-m32") + +if("${CROSS}" STREQUAL "") + + # Default the cross compiler prefix to one used by Debian and other package + # management systems. + set(CROSS i686-w64-mingw32-) +endif() + +if(NOT CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER ${CROSS}gcc) +endif() +if(NOT CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER ${CROSS}g++) +endif() +if(NOT CMAKE_AR) + set(CMAKE_AR ${CROSS}ar CACHE FILEPATH Archiver) +endif() +if(NOT CMAKE_RANLIB) + set(CMAKE_RANLIB ${CROSS}ranlib CACHE FILEPATH Indexer) +endif() diff --git a/third_party/aom/build/cmake/toolchains/x86_64-ios-simulator.cmake b/third_party/aom/build/cmake/toolchains/x86_64-ios-simulator.cmake new file mode 100644 index 0000000000..d4b40ed098 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/x86_64-ios-simulator.cmake @@ -0,0 +1,25 @@ +# +# 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_X86_64_IOS_SIMULATOR_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_X86_64_IOS_SIMULATOR_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_X86_64_IOS_SIMULATOR_CMAKE_ 1) + +if(XCODE) + + # TODO(tomfinegan): Handle ios sim builds in Xcode. + message(FATAL_ERROR "This toolchain does not support Xcode.") +endif() + +set(CMAKE_SYSTEM_PROCESSOR "x86_64") +set(CMAKE_OSX_ARCHITECTURES "x86_64") + +include("${CMAKE_CURRENT_LIST_DIR}/ios-simulator-common.cmake") diff --git a/third_party/aom/build/cmake/toolchains/x86_64-macos.cmake b/third_party/aom/build/cmake/toolchains/x86_64-macos.cmake new file mode 100644 index 0000000000..899df6f353 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/x86_64-macos.cmake @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022, 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_64") +set(CMAKE_SYSTEM_NAME "Darwin") +set(CMAKE_OSX_ARCHITECTURES "x86_64") +set(CMAKE_C_FLAGS_INIT "-arch x86_64") +set(CMAKE_CXX_FLAGS_INIT "-arch x86_64") +set(CMAKE_EXE_LINKER_FLAGS_INIT "-arch x86_64") diff --git a/third_party/aom/build/cmake/toolchains/x86_64-mingw-gcc.cmake b/third_party/aom/build/cmake/toolchains/x86_64-mingw-gcc.cmake new file mode 100644 index 0000000000..978146a4f2 --- /dev/null +++ b/third_party/aom/build/cmake/toolchains/x86_64-mingw-gcc.cmake @@ -0,0 +1,37 @@ +# +# 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. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_X86_64_MINGW_GCC_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_X86_64_MINGW_GCC_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_X86_64_MINGW_GCC_CMAKE_ 1) + +set(CMAKE_SYSTEM_PROCESSOR "x86_64") +set(CMAKE_SYSTEM_NAME "Windows") + +if("${CROSS}" STREQUAL "") + + # Default the cross compiler prefix to one used by Debian and other package + # management systems. + set(CROSS x86_64-w64-mingw32-) +endif() + +if(NOT CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER ${CROSS}gcc) +endif() +if(NOT CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER ${CROSS}g++) +endif() +if(NOT CMAKE_AR) + set(CMAKE_AR ${CROSS}ar CACHE FILEPATH Archiver) +endif() +if(NOT CMAKE_RANLIB) + set(CMAKE_RANLIB ${CROSS}ranlib CACHE FILEPATH Indexer) +endif() |