Add nasm support to the CMake build.
BUG=aomedia:76,aomedia:507 Change-Id: I1d7d6932dbc23ad1b0b23f2df8230c17a2e76387
This commit is contained in:
Родитель
17ccaec4bb
Коммит
6d1dd6232c
|
@ -19,6 +19,7 @@ endif ()
|
|||
option(ENABLE_CCACHE "Enable ccache support." OFF)
|
||||
option(ENABLE_DISTCC "Enable distcc support." OFF)
|
||||
option(ENABLE_DOCS "Enable documentation generation (doxygen required)." ON)
|
||||
option(ENABLE_NASM "Use nasm instead of yasm for x86 assembly." OFF)
|
||||
|
||||
project(AOM C CXX)
|
||||
|
||||
|
|
|
@ -92,7 +92,13 @@ endif ()
|
|||
if ("${AOM_TARGET_CPU}" STREQUAL "x86" OR "${AOM_TARGET_CPU}" STREQUAL "x86_64")
|
||||
# TODO(tomfinegan): Support nasm at least as well as the existing build
|
||||
# system.
|
||||
find_program(AS_EXECUTABLE yasm $ENV{YASM_PATH})
|
||||
if (ENABLE_NASM)
|
||||
find_program(AS_EXECUTABLE nasm $ENV{NASM_PATH})
|
||||
set(AOM_AS_FLAGS ${AOM_AS_FLAGS} -Ox)
|
||||
else ()
|
||||
find_program(AS_EXECUTABLE yasm $ENV{YASM_PATH})
|
||||
endif ()
|
||||
|
||||
if (NOT AS_EXECUTABLE)
|
||||
message(FATAL_ERROR "Unable to find yasm. To build without optimizations, "
|
||||
"add -DAOM_TARGET_CPU=generic to your cmake command line.")
|
||||
|
|
|
@ -122,7 +122,7 @@ function (add_asm_library lib_name asm_sources dependent_target)
|
|||
add_custom_command(OUTPUT "${asm_object}"
|
||||
COMMAND ${AS_EXECUTABLE}
|
||||
ARGS ${AOM_AS_FLAGS}
|
||||
-I${AOM_ROOT} -I${AOM_CONFIG_DIR}
|
||||
-I${AOM_ROOT}/ -I${AOM_CONFIG_DIR}/
|
||||
-o "${asm_object}" "${asm_source}"
|
||||
DEPENDS "${asm_source}"
|
||||
COMMENT "Building ASM object ${asm_object}"
|
||||
|
|
Загрузка…
Ссылка в новой задаче