diff --git a/build/cmake/aom_configure.cmake b/build/cmake/aom_configure.cmake index fbadc10c2..463f73a8e 100644 --- a/build/cmake/aom_configure.cmake +++ b/build/cmake/aom_configure.cmake @@ -30,18 +30,19 @@ if (NOT AOM_TARGET_CPU) " CMAKE_GENERATOR=${CMAKE_GENERATOR}\n") endif () endif () - set(AOM_TARGET_SYSTEM ${CMAKE_SYSTEM_NAME}) - if (NOT EXISTS "${AOM_ROOT}/build/cmake/targets/${AOM_TARGET_CPU}.cmake") - message("No RTCD template for ${AOM_TARGET_CPU}, using generic.") +endif () + +set(AOM_TARGET_SYSTEM ${CMAKE_SYSTEM_NAME}) +if (NOT EXISTS "${AOM_ROOT}/build/cmake/targets/${AOM_TARGET_CPU}.cmake") + message("No RTCD template for ${AOM_TARGET_CPU}, using generic.") + set(AOM_TARGET_CPU "generic") +endif () +if ("${AOM_TARGET_CPU}" STREQUAL "x86" OR "${AOM_TARGET_CPU}" STREQUAL "x86_64") + find_program(YASM_EXECUTABLE yasm $ENV{YASM_PATH}) + if (NOT YASM_EXECUTABLE) + message(WARNING "Unable to find yasm, using generic as target CPU.") set(AOM_TARGET_CPU "generic") endif () - if (NOT AOM_TARGET_CPU STREQUAL "generic") - find_program(YASM_EXECUTABLE yasm $ENV{YASM_PATH}) - if (NOT YASM_EXECUTABLE) - message(WARNING "Unable to find yasm, using generic as target CPU.") - set(AOM_TARGET_CPU "generic") - endif () - endif () endif () include("${AOM_ROOT}/build/cmake/targets/${AOM_TARGET_CPU}.cmake") diff --git a/build/cmake/aom_optimization.cmake b/build/cmake/aom_optimization.cmake index 76e7c4221..dc304b379 100644 --- a/build/cmake/aom_optimization.cmake +++ b/build/cmake/aom_optimization.cmake @@ -79,7 +79,9 @@ function (get_asm_obj_format out_format) message(FATAL_ERROR "Unknown obj format: ${AOM_TARGET_SYSTEM}") endif () elseif ("${AOM_TARGET_CPU}" STREQUAL "x86") - if ("${AOM_TARGET_SYSTEM}" STREQUAL "Windows") + if ("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin") + set(objformat "macho32") + elseif ("${AOM_TARGET_SYSTEM}" STREQUAL "Windows") set(objformat "win32") else () message(FATAL_ERROR "Unknown obj format: ${AOM_TARGET_SYSTEM}")