e6fd125d31
We currently write a mix of "if (FOO)" and "if(FOO)". While the former looks more like a usual language, CMake believes everything, even "if" and "else", is just a really really funny function call (a "command"). We should pick something for consistency. Upstream CMake writes "if(FOO)", so go with that one. Change-Id: I67e0eb650a52670110b417312a362c9f161c8721 Reviewed-on: https://boringssl-review.googlesource.com/30807 Reviewed-by: Adam Langley <agl@google.com>
49 lines
725 B
CMake
49 lines
725 B
CMake
include_directories(../../include)
|
|
|
|
if(${ARCH} STREQUAL "arm")
|
|
set(
|
|
CHACHA_ARCH_SOURCES
|
|
|
|
chacha-armv4.${ASM_EXT}
|
|
)
|
|
endif()
|
|
|
|
if(${ARCH} STREQUAL "aarch64")
|
|
set(
|
|
CHACHA_ARCH_SOURCES
|
|
|
|
chacha-armv8.${ASM_EXT}
|
|
)
|
|
endif()
|
|
|
|
if(${ARCH} STREQUAL "x86")
|
|
set(
|
|
CHACHA_ARCH_SOURCES
|
|
|
|
chacha-x86.${ASM_EXT}
|
|
)
|
|
endif()
|
|
|
|
if(${ARCH} STREQUAL "x86_64")
|
|
set(
|
|
CHACHA_ARCH_SOURCES
|
|
|
|
chacha-x86_64.${ASM_EXT}
|
|
)
|
|
endif()
|
|
|
|
add_library(
|
|
chacha
|
|
|
|
OBJECT
|
|
|
|
chacha.c
|
|
|
|
${CHACHA_ARCH_SOURCES}
|
|
)
|
|
|
|
perlasm(chacha-armv4.${ASM_EXT} asm/chacha-armv4.pl)
|
|
perlasm(chacha-armv8.${ASM_EXT} asm/chacha-armv8.pl)
|
|
perlasm(chacha-x86.${ASM_EXT} asm/chacha-x86.pl)
|
|
perlasm(chacha-x86_64.${ASM_EXT} asm/chacha-x86_64.pl)
|