Commit b839f927f5 for aom

commit b839f927f5d8a448fbcd67b4d434672b9698a3a8
Author: Wan-Teh Chang <wtc@google.com>
Date:   Tue Apr 7 17:19:54 2026 -0700

    Remove the build directory, move build/cmake up

    Change-Id: I030613d22f02a733cab009ffe1f6dd134b6611dd

diff --git a/CHANGELOG b/CHANGELOG
index 3e1f97c6fe..ca1cfb141f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -5,6 +5,11 @@ yyyy-mm-dd next version
   quality improvements for layered image encoding, in addition to bug
   fixes.

+  The `build` directory in the source tree was removed and the original
+  build/cmake directory was moved up one level. If you use the CMake
+  toolchain files in the original build/cmake/toolchains directory,
+  they are now in the cmake/toolchains directory.
+
   - New Features
     * Tuning modes AOM_TUNE_IQ and AOM_TUNE_SSIMULACRA2 now work with
       inter-frame encoding modes (good-quality and realtime), enabling
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 580a6931da..8283f7e1c7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,7 +70,7 @@ unset(LT_AGE)
 # Enable generators like Xcode and Visual Studio to place projects in folders.
 set_property(GLOBAL PROPERTY USE_FOLDERS TRUE)

-include("${AOM_ROOT}/build/cmake/aom_configure.cmake")
+include("${AOM_ROOT}/cmake/aom_configure.cmake")
 if(CONFIG_THREE_PASS)
   include("${AOM_ROOT}/common/ivf_dec.cmake")
 endif()
@@ -80,9 +80,9 @@ 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}/build/cmake/aom_install.cmake")
-include("${AOM_ROOT}/build/cmake/sanitizers.cmake")
-include("${AOM_ROOT}/build/cmake/util.cmake")
+include("${AOM_ROOT}/cmake/aom_install.cmake")
+include("${AOM_ROOT}/cmake/sanitizers.cmake")
+include("${AOM_ROOT}/cmake/util.cmake")
 include("${AOM_ROOT}/test/test.cmake")

 list(APPEND AOM_RTCD_SOURCES
@@ -95,7 +95,7 @@ list(APPEND AOM_RTCD_SOURCES
             "${AOM_ROOT}/aom_scale/aom_scale_rtcd.c"
             "${AOM_ROOT}/av1/common/av1_rtcd_defs.pl"
             "${AOM_ROOT}/av1/common/av1_rtcd.c"
-            "${AOM_ROOT}/build/cmake/rtcd.pl")
+            "${AOM_ROOT}/cmake/rtcd.pl")

 list(APPEND AOM_LIBWEBM_SOURCES
             "${AOM_ROOT}/third_party/libwebm/common/hdr_util.cc"
@@ -230,29 +230,27 @@ add_custom_command(OUTPUT "${AOM_CONFIG_DIR}/config/aom_version.h"
                            -DAOM_ROOT=${AOM_ROOT}
                            -DGIT_EXECUTABLE=${GIT_EXECUTABLE}
                            -DPERL_EXECUTABLE=${PERL_EXECUTABLE} -P
-                           "${AOM_ROOT}/build/cmake/version.cmake"
+                           "${AOM_ROOT}/cmake/version.cmake"
                    COMMENT "Writing aom_version.h"
                    VERBATIM)

 add_custom_target(aom_version_check
-                  COMMAND ${CMAKE_COMMAND}
-                          -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR}
-                          -DAOM_ROOT=${AOM_ROOT}
-                          -DGIT_EXECUTABLE=${GIT_EXECUTABLE}
-                          -DPERL_EXECUTABLE=${PERL_EXECUTABLE} -P
-                          "${AOM_ROOT}/build/cmake/version.cmake"
+                  COMMAND ${CMAKE_COMMAND} -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR}
+                                           -DAOM_ROOT=${AOM_ROOT}
+                                           -DGIT_EXECUTABLE=${GIT_EXECUTABLE}
+                                           -DPERL_EXECUTABLE=${PERL_EXECUTABLE}
+                                           -P "${AOM_ROOT}/cmake/version.cmake"
                   COMMENT "Updating version info if necessary."
                   VERBATIM)

 if(BUILD_SHARED_LIBS AND NOT MSVC)
   # Generate version file immediately for non-MSVC shared builds: The version
   # string is needed for the aom target.
-  execute_process(COMMAND ${CMAKE_COMMAND}
-                          -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR}
-                          -DAOM_ROOT=${AOM_ROOT}
-                          -DGIT_EXECUTABLE=${GIT_EXECUTABLE}
-                          -DPERL_EXECUTABLE=${PERL_EXECUTABLE} -P
-                          "${AOM_ROOT}/build/cmake/version.cmake")
+  execute_process(COMMAND ${CMAKE_COMMAND} -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR}
+                                           -DAOM_ROOT=${AOM_ROOT}
+                                           -DGIT_EXECUTABLE=${GIT_EXECUTABLE}
+                                           -DPERL_EXECUTABLE=${PERL_EXECUTABLE}
+                                           -P "${AOM_ROOT}/cmake/version.cmake")
 endif()

 add_dependencies(aom_version aom_version_check)
@@ -928,7 +926,7 @@ if(BUILD_SHARED_LIBS)
     endif()
   endif()

-  include("${AOM_ROOT}/build/cmake/exports.cmake")
+  include("${AOM_ROOT}/cmake/exports.cmake")
   setup_exports_target()
 endif()

@@ -1015,7 +1013,7 @@ add_custom_target(dist
                           -DAOM_DIST_INCLUDES="${AOM_INSTALL_INCS}"
                           -DAOM_DIST_LIBS=$<TARGET_FILE:aom>
                           -DENABLE_DOCS=${ENABLE_DOCS} -P
-                          "${AOM_ROOT}/build/cmake/dist.cmake"
+                          "${AOM_ROOT}/cmake/dist.cmake"
                   DEPENDS ${AOM_INSTALL_BINS} ${AOM_INSTALL_LIBS}
                           ${AOM_INSTALL_INCS} ${AOM_EXAMPLE_TARGETS}
                           ${AOM_TOOL_TARGETS})
diff --git a/README.md b/README.md
index f2141516c3..0a3a4b27a6 100644
--- a/README.md
+++ b/README.md
@@ -116,7 +116,7 @@ enables ccache and disables the AV1 encoder:
 The available configuration options are too numerous to list here. Build system
 configuration options can be found at the top of the CMakeLists.txt file found
 in the root of the AV1 repository, and AV1 codec configuration options can
-currently be found in the file `build/cmake/aom_config_defaults.cmake`.
+currently be found in the file `cmake/aom_config_defaults.cmake`.

 ### Dylib builds {#dylib-builds}

@@ -189,7 +189,7 @@ a x86\_64 MacOS host:

 ~~~
     $ cmake path/to/aom \
-      -DCMAKE_TOOLCHAIN_FILE=path/to/aom/build/cmake/toolchains/x86-macos.cmake
+      -DCMAKE_TOOLCHAIN_FILE=path/to/aom/cmake/toolchains/x86-macos.cmake
     $ make
 ~~~

diff --git a/build/.gitattributes b/build/.gitattributes
deleted file mode 100644
index 03db79bc08..0000000000
--- a/build/.gitattributes
+++ /dev/null
@@ -1,2 +0,0 @@
-*-vs8/*.rules -crlf
-*-msvs/*.rules -crlf
diff --git a/build/.gitignore b/build/.gitignore
deleted file mode 100644
index 1350fcb5eb..0000000000
--- a/build/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-x86*-win32-vs*
diff --git a/build/cmake/aom_config.c.template b/cmake/aom_config.c.template
similarity index 100%
rename from build/cmake/aom_config.c.template
rename to cmake/aom_config.c.template
diff --git a/build/cmake/aom_config_defaults.cmake b/cmake/aom_config_defaults.cmake
similarity index 99%
rename from build/cmake/aom_config_defaults.cmake
rename to cmake/aom_config_defaults.cmake
index 05113fbdef..875bf5abaa 100644
--- a/build/cmake/aom_config_defaults.cmake
+++ b/cmake/aom_config_defaults.cmake
@@ -8,7 +8,7 @@
 # License 1.0 was not distributed with this source code in the PATENTS file, you
 # can obtain it at www.aomedia.org/license/patent.

-include("${AOM_ROOT}/build/cmake/util.cmake")
+include("${AOM_ROOT}/cmake/util.cmake")

 # This file sets default values for libaom configuration variables. All libaom
 # config variables are added to the CMake variable cache via the macros provided
diff --git a/build/cmake/aom_configure.cmake b/cmake/aom_configure.cmake
similarity index 96%
rename from build/cmake/aom_configure.cmake
rename to cmake/aom_configure.cmake
index 9b8a0dc9f8..d5cd4db55b 100644
--- a/build/cmake/aom_configure.cmake
+++ b/cmake/aom_configure.cmake
@@ -16,12 +16,12 @@ set(AOM_BUILD_CMAKE_AOM_CONFIGURE_CMAKE_ 1)
 include(FindThreads)
 include(CheckSymbolExists)

-include("${AOM_ROOT}/build/cmake/aom_config_defaults.cmake")
-include("${AOM_ROOT}/build/cmake/aom_experiment_deps.cmake")
-include("${AOM_ROOT}/build/cmake/aom_optimization.cmake")
-include("${AOM_ROOT}/build/cmake/compiler_flags.cmake")
-include("${AOM_ROOT}/build/cmake/compiler_tests.cmake")
-include("${AOM_ROOT}/build/cmake/util.cmake")
+include("${AOM_ROOT}/cmake/aom_config_defaults.cmake")
+include("${AOM_ROOT}/cmake/aom_experiment_deps.cmake")
+include("${AOM_ROOT}/cmake/aom_optimization.cmake")
+include("${AOM_ROOT}/cmake/compiler_flags.cmake")
+include("${AOM_ROOT}/cmake/compiler_tests.cmake")
+include("${AOM_ROOT}/cmake/util.cmake")

 if(DEFINED CONFIG_LOWBITDEPTH)
   message(WARNING "CONFIG_LOWBITDEPTH has been removed. \
@@ -279,7 +279,7 @@ if(NOT WIN32)
   aom_pop_var(CMAKE_REQUIRED_LIBRARIES)
 endif()

-include("${AOM_ROOT}/build/cmake/cpu.cmake")
+include("${AOM_ROOT}/cmake/cpu.cmake")

 if(ENABLE_CCACHE)
   set_compiler_launcher(ENABLE_CCACHE ccache)
@@ -461,10 +461,10 @@ endforeach()
 # Generate aom_config templates.
 set(aom_config_asm_template "${AOM_CONFIG_DIR}/config/aom_config.asm.cmake")
 set(aom_config_h_template "${AOM_CONFIG_DIR}/config/aom_config.h.cmake")
-execute_process(
-  COMMAND ${CMAKE_COMMAND}
-          -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} -DAOM_ROOT=${AOM_ROOT} -P
-          "${AOM_ROOT}/build/cmake/generate_aom_config_templates.cmake")
+execute_process(COMMAND ${CMAKE_COMMAND}
+                        -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR}
+                        -DAOM_ROOT=${AOM_ROOT} -P
+                        "${AOM_ROOT}/cmake/generate_aom_config_templates.cmake")

 # Generate aom_config.{asm,h}.
 configure_file("${aom_config_asm_template}"
@@ -479,7 +479,7 @@ if(NOT GIT_FOUND)
 endif()

 string(TIMESTAMP year "%Y")
-configure_file("${AOM_ROOT}/build/cmake/aom_config.c.template"
+configure_file("${AOM_ROOT}/cmake/aom_config.c.template"
                "${AOM_CONFIG_DIR}/config/aom_config.c")

 # Find Perl and generate the RTCD sources.
@@ -508,7 +508,7 @@ foreach(NUM RANGE ${AOM_RTCD_CUSTOM_COMMAND_COUNT})
   list(GET AOM_RTCD_SYMBOL_LIST ${NUM} AOM_RTCD_SYMBOL)
   execute_process(
     COMMAND
-      ${PERL_EXECUTABLE} "${AOM_ROOT}/build/cmake/rtcd.pl"
+      ${PERL_EXECUTABLE} "${AOM_ROOT}/cmake/rtcd.pl"
       --arch=${AOM_TARGET_CPU}
       --sym=${AOM_RTCD_SYMBOL} ${AOM_RTCD_FLAGS}
       --config=${AOM_CONFIG_DIR}/config/aom_config.h ${AOM_RTCD_CONFIG_FILE}
@@ -521,4 +521,4 @@ execute_process(COMMAND ${CMAKE_COMMAND}
                         -DAOM_ROOT=${AOM_ROOT}
                         -DGIT_EXECUTABLE=${GIT_EXECUTABLE}
                         -DPERL_EXECUTABLE=${PERL_EXECUTABLE} -P
-                        "${AOM_ROOT}/build/cmake/version.cmake")
+                        "${AOM_ROOT}/cmake/version.cmake")
diff --git a/build/cmake/aom_experiment_deps.cmake b/cmake/aom_experiment_deps.cmake
similarity index 100%
rename from build/cmake/aom_experiment_deps.cmake
rename to cmake/aom_experiment_deps.cmake
diff --git a/build/cmake/aom_install.cmake b/cmake/aom_install.cmake
similarity index 97%
rename from build/cmake/aom_install.cmake
rename to cmake/aom_install.cmake
index 1ac795e1b3..a8f6d64361 100644
--- a/build/cmake/aom_install.cmake
+++ b/cmake/aom_install.cmake
@@ -55,7 +55,7 @@ macro(setup_aom_install_targets)
               -DCONFIG_SALIENCY_MAP=${CONFIG_SALIENCY_MAP}
               -DCONFIG_TFLITE=${CONFIG_TFLITE}
               -P
-              "${AOM_ROOT}/build/cmake/pkg_config.cmake"
+              "${AOM_ROOT}/cmake/pkg_config.cmake"
       COMMENT "Writing aom.pc"
       VERBATIM)

@@ -100,7 +100,7 @@ macro(setup_aom_install_targets)
     set(AOM_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
     set(AOM_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
     configure_package_config_file(
-      "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.cmake.in"
+      "${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake.in"
       "${AOM_PROJECT_CONFIG}" INSTALL_DESTINATION "${AOM_CONFIG_INSTALL_DIR}"
       PATH_VARS CMAKE_INSTALL_INCLUDEDIR)

diff --git a/build/cmake/aom_optimization.cmake b/cmake/aom_optimization.cmake
similarity index 96%
rename from build/cmake/aom_optimization.cmake
rename to cmake/aom_optimization.cmake
index 2750a0be41..c939ea7d06 100644
--- a/build/cmake/aom_optimization.cmake
+++ b/cmake/aom_optimization.cmake
@@ -13,7 +13,7 @@ if(AOM_BUILD_CMAKE_AOM_OPTIMIZATION_CMAKE_)
 endif() # AOM_BUILD_CMAKE_AOM_OPTIMIZATION_CMAKE_
 set(AOM_BUILD_CMAKE_AOM_OPTIMIZATION_CMAKE_ 1)

-include("${AOM_ROOT}/build/cmake/util.cmake")
+include("${AOM_ROOT}/cmake/util.cmake")

 # Translate $flag to one which MSVC understands, and write the new flag to the
 # variable named by $translated_flag (or unset it, when MSVC needs no flag).
@@ -261,18 +261,18 @@ function(test_nasm)
   endif()
 endfunction()

-# Adds build command for generation of rtcd C source files using
-# build/cmake/rtcd.pl. $config is the input perl file, $output is the output C
-# include file, $source is the C source file, and $symbol is used for the symbol
-# argument passed to rtcd.pl.
+# Adds build command for generation of rtcd C source files using cmake/rtcd.pl.
+# $config is the input perl file, $output is the output C include file, $source
+# is the C source file, and $symbol is used for the symbol argument passed to
+# rtcd.pl.
 function(add_rtcd_build_step config output source symbol)
   add_custom_command(
     OUTPUT ${output}
-    COMMAND ${PERL_EXECUTABLE} ARGS "${AOM_ROOT}/build/cmake/rtcd.pl"
+    COMMAND ${PERL_EXECUTABLE} ARGS "${AOM_ROOT}/cmake/rtcd.pl"
             --arch=${AOM_TARGET_CPU}
             --sym=${symbol} ${AOM_RTCD_FLAGS}
             --config=${AOM_CONFIG_DIR}/config/aom_config.h ${config} > ${output}
-    DEPENDS "${AOM_ROOT}/build/cmake/rtcd.pl" ${config}
+    DEPENDS "${AOM_ROOT}/cmake/rtcd.pl" ${config}
     COMMENT "Generating ${output}"
     WORKING_DIRECTORY ${AOM_CONFIG_DIR}
     VERBATIM)
diff --git a/build/cmake/compiler_flags.cmake b/cmake/compiler_flags.cmake
similarity index 99%
rename from build/cmake/compiler_flags.cmake
rename to cmake/compiler_flags.cmake
index dc3902a6da..b9fc352beb 100644
--- a/build/cmake/compiler_flags.cmake
+++ b/cmake/compiler_flags.cmake
@@ -15,7 +15,7 @@ set(AOM_BUILD_CMAKE_COMPILER_FLAGS_CMAKE_ 1)

 include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
-include("${AOM_ROOT}/build/cmake/compiler_tests.cmake")
+include("${AOM_ROOT}/cmake/compiler_tests.cmake")

 # Strings used to cache flags.
 set(AOM_C_FLAGS)
diff --git a/build/cmake/compiler_tests.cmake b/cmake/compiler_tests.cmake
similarity index 100%
rename from build/cmake/compiler_tests.cmake
rename to cmake/compiler_tests.cmake
diff --git a/build/cmake/config.cmake.in b/cmake/config.cmake.in
similarity index 100%
rename from build/cmake/config.cmake.in
rename to cmake/config.cmake.in
diff --git a/build/cmake/cpu.cmake b/cmake/cpu.cmake
similarity index 100%
rename from build/cmake/cpu.cmake
rename to cmake/cpu.cmake
diff --git a/build/cmake/dist.cmake b/cmake/dist.cmake
similarity index 100%
rename from build/cmake/dist.cmake
rename to cmake/dist.cmake
diff --git a/build/cmake/exports.cmake b/cmake/exports.cmake
similarity index 95%
rename from build/cmake/exports.cmake
rename to cmake/exports.cmake
index 2ce4601ba4..d89c2ec735 100644
--- a/build/cmake/exports.cmake
+++ b/cmake/exports.cmake
@@ -13,7 +13,7 @@ if(AOM_BUILD_CMAKE_EXPORTS_CMAKE_)
 endif() # AOM_BUILD_CMAKE_EXPORTS_CMAKE_
 set(AOM_BUILD_CMAKE_EXPORTS_CMAKE_ 1)

-include("${AOM_ROOT}/build/cmake/exports_sources.cmake")
+include("${AOM_ROOT}/cmake/exports_sources.cmake")

 # Creates the custom target which handles generation of the symbol export lists.
 function(setup_exports_target)
@@ -43,7 +43,7 @@ function(setup_exports_target)
             -DCONFIG_INSPECTION=${CONFIG_INSPECTION}
             -DENABLE_TESTS=${ENABLE_TESTS}
             -P
-            "${AOM_ROOT}/build/cmake/generate_exports.cmake"
+            "${AOM_ROOT}/cmake/generate_exports.cmake"
     SOURCES ${AOM_EXPORTS_SOURCES}
     DEPENDS ${AOM_EXPORTS_SOURCES} BYPRODUCTS ${aom_sym_file})

diff --git a/build/cmake/exports_sources.cmake b/cmake/exports_sources.cmake
similarity index 100%
rename from build/cmake/exports_sources.cmake
rename to cmake/exports_sources.cmake
diff --git a/build/cmake/generate_aom_config_templates.cmake b/cmake/generate_aom_config_templates.cmake
similarity index 96%
rename from build/cmake/generate_aom_config_templates.cmake
rename to cmake/generate_aom_config_templates.cmake
index 17e4c2d04c..206e8d215c 100644
--- a/build/cmake/generate_aom_config_templates.cmake
+++ b/cmake/generate_aom_config_templates.cmake
@@ -62,13 +62,13 @@ endfunction()
 check_directory_var(AOM_CONFIG_DIR)
 check_directory_var(AOM_ROOT)

-set(AOM_DEFAULTS "${AOM_ROOT}/build/cmake/aom_config_defaults.cmake")
+set(AOM_DEFAULTS "${AOM_ROOT}/cmake/aom_config_defaults.cmake")
 if(NOT EXISTS "${AOM_DEFAULTS}")
   message(
     FATAL_ERROR "Configuration default values file (${AOM_DEFAULTS}) missing.")
 endif()

-include("${AOM_ROOT}/build/cmake/aom_config_defaults.cmake")
+include("${AOM_ROOT}/cmake/aom_config_defaults.cmake")
 list(APPEND aom_build_vars ${AOM_DETECT_VARS} ${AOM_CONFIG_VARS})
 list(SORT aom_build_vars)

diff --git a/build/cmake/generate_exports.cmake b/cmake/generate_exports.cmake
similarity index 97%
rename from build/cmake/generate_exports.cmake
rename to cmake/generate_exports.cmake
index bab165d704..2546782a3b 100644
--- a/build/cmake/generate_exports.cmake
+++ b/cmake/generate_exports.cmake
@@ -20,7 +20,7 @@ foreach(arg ${REQUIRED_ARGS})
   endif()
 endforeach()

-include("${AOM_ROOT}/build/cmake/exports_sources.cmake")
+include("${AOM_ROOT}/cmake/exports_sources.cmake")

 if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
   set(symbol_prefix "_")
diff --git a/build/cmake/pkg_config.cmake b/cmake/pkg_config.cmake
similarity index 98%
rename from build/cmake/pkg_config.cmake
rename to cmake/pkg_config.cmake
index 88a33a58a6..ad3cf77009 100644
--- a/build/cmake/pkg_config.cmake
+++ b/cmake/pkg_config.cmake
@@ -21,7 +21,7 @@ foreach(arg ${REQUIRED_ARGS})
   endif()
 endforeach()

-include("${AOM_ROOT}/build/cmake/util.cmake")
+include("${AOM_ROOT}/cmake/util.cmake")

 extract_version_string("${AOM_CONFIG_DIR}/config/aom_version.h" aom_version)

diff --git a/build/cmake/rtcd.pl b/cmake/rtcd.pl
similarity index 100%
rename from build/cmake/rtcd.pl
rename to cmake/rtcd.pl
diff --git a/build/cmake/sanitizers.cmake b/cmake/sanitizers.cmake
similarity index 96%
rename from build/cmake/sanitizers.cmake
rename to cmake/sanitizers.cmake
index 3557d5ee58..bd5a11248e 100644
--- a/build/cmake/sanitizers.cmake
+++ b/cmake/sanitizers.cmake
@@ -17,7 +17,7 @@ if(MSVC OR NOT SANITIZE)
   return()
 endif()

-include("${AOM_ROOT}/build/cmake/compiler_flags.cmake")
+include("${AOM_ROOT}/cmake/compiler_flags.cmake")

 string(TOLOWER ${SANITIZE} SANITIZE)

diff --git a/build/cmake/toolchains/android.cmake b/cmake/toolchains/android.cmake
similarity index 100%
rename from build/cmake/toolchains/android.cmake
rename to cmake/toolchains/android.cmake
diff --git a/build/cmake/toolchains/arm-ios-common.cmake b/cmake/toolchains/arm-ios-common.cmake
similarity index 100%
rename from build/cmake/toolchains/arm-ios-common.cmake
rename to cmake/toolchains/arm-ios-common.cmake
diff --git a/build/cmake/toolchains/arm64-ios.cmake b/cmake/toolchains/arm64-ios.cmake
similarity index 100%
rename from build/cmake/toolchains/arm64-ios.cmake
rename to cmake/toolchains/arm64-ios.cmake
diff --git a/build/cmake/toolchains/arm64-linux-clang.cmake b/cmake/toolchains/arm64-linux-clang.cmake
similarity index 100%
rename from build/cmake/toolchains/arm64-linux-clang.cmake
rename to cmake/toolchains/arm64-linux-clang.cmake
diff --git a/build/cmake/toolchains/arm64-linux-gcc.cmake b/cmake/toolchains/arm64-linux-gcc.cmake
similarity index 100%
rename from build/cmake/toolchains/arm64-linux-gcc.cmake
rename to cmake/toolchains/arm64-linux-gcc.cmake
diff --git a/build/cmake/toolchains/arm64-macos.cmake b/cmake/toolchains/arm64-macos.cmake
similarity index 100%
rename from build/cmake/toolchains/arm64-macos.cmake
rename to cmake/toolchains/arm64-macos.cmake
diff --git a/build/cmake/toolchains/arm64-mingw-gcc.cmake b/cmake/toolchains/arm64-mingw-gcc.cmake
similarity index 100%
rename from build/cmake/toolchains/arm64-mingw-gcc.cmake
rename to cmake/toolchains/arm64-mingw-gcc.cmake
diff --git a/build/cmake/toolchains/armv7-ios.cmake b/cmake/toolchains/armv7-ios.cmake
similarity index 100%
rename from build/cmake/toolchains/armv7-ios.cmake
rename to cmake/toolchains/armv7-ios.cmake
diff --git a/build/cmake/toolchains/armv7-linux-gcc.cmake b/cmake/toolchains/armv7-linux-gcc.cmake
similarity index 100%
rename from build/cmake/toolchains/armv7-linux-gcc.cmake
rename to cmake/toolchains/armv7-linux-gcc.cmake
diff --git a/build/cmake/toolchains/armv7-mingw-gcc.cmake b/cmake/toolchains/armv7-mingw-gcc.cmake
similarity index 100%
rename from build/cmake/toolchains/armv7-mingw-gcc.cmake
rename to cmake/toolchains/armv7-mingw-gcc.cmake
diff --git a/build/cmake/toolchains/armv7s-ios.cmake b/cmake/toolchains/armv7s-ios.cmake
similarity index 100%
rename from build/cmake/toolchains/armv7s-ios.cmake
rename to cmake/toolchains/armv7s-ios.cmake
diff --git a/build/cmake/toolchains/i686-linux-gcc.cmake b/cmake/toolchains/i686-linux-gcc.cmake
similarity index 100%
rename from build/cmake/toolchains/i686-linux-gcc.cmake
rename to cmake/toolchains/i686-linux-gcc.cmake
diff --git a/build/cmake/toolchains/ios-simulator-common.cmake b/cmake/toolchains/ios-simulator-common.cmake
similarity index 100%
rename from build/cmake/toolchains/ios-simulator-common.cmake
rename to cmake/toolchains/ios-simulator-common.cmake
diff --git a/build/cmake/toolchains/ppc-linux-gcc.cmake b/cmake/toolchains/ppc-linux-gcc.cmake
similarity index 100%
rename from build/cmake/toolchains/ppc-linux-gcc.cmake
rename to cmake/toolchains/ppc-linux-gcc.cmake
diff --git a/build/cmake/toolchains/riscv-linux-gcc.cmake b/cmake/toolchains/riscv-linux-gcc.cmake
similarity index 100%
rename from build/cmake/toolchains/riscv-linux-gcc.cmake
rename to cmake/toolchains/riscv-linux-gcc.cmake
diff --git a/build/cmake/toolchains/x86-ios-simulator.cmake b/cmake/toolchains/x86-ios-simulator.cmake
similarity index 100%
rename from build/cmake/toolchains/x86-ios-simulator.cmake
rename to cmake/toolchains/x86-ios-simulator.cmake
diff --git a/build/cmake/toolchains/x86-linux.cmake b/cmake/toolchains/x86-linux.cmake
similarity index 100%
rename from build/cmake/toolchains/x86-linux.cmake
rename to cmake/toolchains/x86-linux.cmake
diff --git a/build/cmake/toolchains/x86-macos.cmake b/cmake/toolchains/x86-macos.cmake
similarity index 100%
rename from build/cmake/toolchains/x86-macos.cmake
rename to cmake/toolchains/x86-macos.cmake
diff --git a/build/cmake/toolchains/x86-mingw-gcc.cmake b/cmake/toolchains/x86-mingw-gcc.cmake
similarity index 100%
rename from build/cmake/toolchains/x86-mingw-gcc.cmake
rename to cmake/toolchains/x86-mingw-gcc.cmake
diff --git a/build/cmake/toolchains/x86_64-ios-simulator.cmake b/cmake/toolchains/x86_64-ios-simulator.cmake
similarity index 100%
rename from build/cmake/toolchains/x86_64-ios-simulator.cmake
rename to cmake/toolchains/x86_64-ios-simulator.cmake
diff --git a/build/cmake/toolchains/x86_64-macos.cmake b/cmake/toolchains/x86_64-macos.cmake
similarity index 100%
rename from build/cmake/toolchains/x86_64-macos.cmake
rename to cmake/toolchains/x86_64-macos.cmake
diff --git a/build/cmake/toolchains/x86_64-mingw-gcc.cmake b/cmake/toolchains/x86_64-mingw-gcc.cmake
similarity index 100%
rename from build/cmake/toolchains/x86_64-mingw-gcc.cmake
rename to cmake/toolchains/x86_64-mingw-gcc.cmake
diff --git a/build/cmake/util.cmake b/cmake/util.cmake
similarity index 100%
rename from build/cmake/util.cmake
rename to cmake/util.cmake
diff --git a/build/cmake/version.cmake b/cmake/version.cmake
similarity index 93%
rename from build/cmake/version.cmake
rename to cmake/version.cmake
index 3b2842ee44..7b86aae693 100644
--- a/build/cmake/version.cmake
+++ b/cmake/version.cmake
@@ -19,7 +19,7 @@ foreach(arg ${REQUIRED_ARGS})
   endif()
 endforeach()

-include("${AOM_ROOT}/build/cmake/util.cmake")
+include("${AOM_ROOT}/cmake/util.cmake")

 # Generate the version string for this run.
 unset(aom_version)
@@ -60,8 +60,7 @@ endif()
 if(NOT "${aom_version}" STREQUAL "${last_aom_version}")
   # TODO(tomfinegan): Perl dependency is unnecessary. CMake can do everything
   # that is done by version.pl on its own (if a bit more verbosely...).
-  execute_process(COMMAND ${PERL_EXECUTABLE}
-                          "${AOM_ROOT}/build/cmake/version.pl"
+  execute_process(COMMAND ${PERL_EXECUTABLE} "${AOM_ROOT}/cmake/version.pl"
                           --version_data=${aom_version}
                           --version_filename=${version_file} VERBATIM)
 endif()
diff --git a/build/cmake/version.pl b/cmake/version.pl
similarity index 100%
rename from build/cmake/version.pl
rename to cmake/version.pl
diff --git a/doc/dev_guide/av1_encoder.dox b/doc/dev_guide/av1_encoder.dox
index aa1e5bab22..460b10531e 100644
--- a/doc/dev_guide/av1_encoder.dox
+++ b/doc/dev_guide/av1_encoder.dox
@@ -1335,7 +1335,7 @@ implementation which the SIMD variants can be tested against.
 As different machines with the same nominal architecture may support different
 subsets of SIMD instructions, we have dynamic CPU detection logic which chooses
 the appropriate functions to use at run time. This process is handled by
-`build/cmake/rtcd.pl`, with function definitions in the files
+`cmake/rtcd.pl`, with function definitions in the files
 `*_rtcd_defs.pl` elsewhere in the codebase.

 Currently SIMD is supported on the following platforms:
diff --git a/test/av1_c_vs_simd_encode.sh b/test/av1_c_vs_simd_encode.sh
index 67e17b1ebd..830521c392 100755
--- a/test/av1_c_vs_simd_encode.sh
+++ b/test/av1_c_vs_simd_encode.sh
@@ -440,7 +440,7 @@ av1_test_generic() {
     # The cmake command line option -DENABLE_MMX=0 flag disables all SIMD
     # optimizations, and generates a C-only binary.
     local cmake_command="cmake $LIBAOM_SOURCE_DIR -DENABLE_MMX=0 \
-      -DCMAKE_TOOLCHAIN_FILE=${LIBAOM_SOURCE_DIR}/build/cmake/toolchains/i686-linux-gcc.cmake"
+      -DCMAKE_TOOLCHAIN_FILE=${LIBAOM_SOURCE_DIR}/cmake/toolchains/i686-linux-gcc.cmake"
   fi

   echo "Build for: Generic ${arch}"
@@ -483,7 +483,7 @@ av1_test_x86() {
     local target="x86-linux"
     local cmake_command="cmake \
     $LIBAOM_SOURCE_DIR \
-    -DCMAKE_TOOLCHAIN_FILE=${LIBAOM_SOURCE_DIR}/build/cmake/toolchains/i686-linux-gcc.cmake"
+    -DCMAKE_TOOLCHAIN_FILE=${LIBAOM_SOURCE_DIR}/cmake/toolchains/i686-linux-gcc.cmake"
   elif [ $arch = "x86_64" ]; then
     local target="x86_64-linux"
     local cmake_command="cmake $LIBAOM_SOURCE_DIR"
@@ -519,7 +519,7 @@ av1_test_arm() {
   local arch="arm64"
   local target="arm64-linux-gcc"
   local cmake_command="cmake $LIBAOM_SOURCE_DIR \
-        -DCMAKE_TOOLCHAIN_FILE=$LIBAOM_SOURCE_DIR/build/cmake/toolchains/${target}.cmake \
+        -DCMAKE_TOOLCHAIN_FILE=$LIBAOM_SOURCE_DIR/cmake/toolchains/${target}.cmake \
         -DCMAKE_C_FLAGS=-Wno-maybe-uninitialized"
   echo "Build for arm64: ${target}"
   if ! av1_enc_build "${target}" "${cmake_command}"; then