Skip to content

Commit

Permalink
Fix the most horrible merge I've done yet
Browse files Browse the repository at this point in the history
  • Loading branch information
isilkor committed Mar 21, 2018
1 parent c291488 commit c1ee1bd
Show file tree
Hide file tree
Showing 22 changed files with 58 additions and 4,044 deletions.
21 changes: 0 additions & 21 deletions thirdparty/blake2/.gitignore

This file was deleted.

85 changes: 58 additions & 27 deletions thirdparty/blake2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,64 @@
# To redistribute this file separately, substitute the full license texts
# for the above references.

add_library(blake2 STATIC
blake2.h
)
include(CheckCSourceCompiles)

target_sources(blake2
PRIVATE
blake2b.c
blake2bp.c
blake2s.c
blake2sp.c
blake2xb.c
blake2xs.c
blake2b-load-sse2.h
blake2b-load-sse41.h
blake2b-round.h
blake2s-load-sse2.h
blake2s-load-sse41.h
blake2s-load-xop.h
blake2s-round.h
blake2-config.h
blake2-impl.h
)
CHECK_C_SOURCE_COMPILES("
#if __x86_64 || __x86_64__ || __amd64 || __AMD64 || _M_X64
// x86-64 target system
#else
#error Not building for x86-64
#endif
int main() {}
" HAVE_X86_64)

include(CheckCCompilerFlag)
CHECK_C_COMPILER_FLAG("-msse2" HAVE_CFLAG_MSSE2)
target_compile_definitions(blake2 PRIVATE -DHAVE_SSE2)
if(HAVE_CFLAG_MSSE2)
target_compile_options(blake2 PUBLIC -msse2)
option(BLAKE2B_USE_SSE2 "Use SSE2 instructions for BLAKE2b" ${HAVE_X86_64})

if (BLAKE2B_USE_SSE2)
add_library(blake2 STATIC
sse/blake2.h
)

target_sources(blake2
PRIVATE
sse/blake2b.c
sse/blake2bp.c
sse/blake2s.c
sse/blake2sp.c
sse/blake2xb.c
sse/blake2xs.c
sse/blake2b-load-sse2.h
sse/blake2b-load-sse41.h
sse/blake2b-round.h
sse/blake2s-load-sse2.h
sse/blake2s-load-sse41.h
sse/blake2s-load-xop.h
sse/blake2s-round.h
sse/blake2-config.h
sse/blake2-impl.h
)

include(CheckCCompilerFlag)
CHECK_C_COMPILER_FLAG("-msse2" HAVE_CFLAG_MSSE2)
target_compile_definitions(blake2 PRIVATE -DHAVE_SSE2)
if(HAVE_CFLAG_MSSE2)
target_compile_options(blake2 PUBLIC -msse2)
endif()
target_include_directories(blake2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/sse)
else()
add_library(blake2 STATIC
ref/blake2.h
)

target_sources(blake2
PRIVATE
ref/blake2bp-ref.c
ref/blake2b-ref.c
ref/blake2sp-ref.c
ref/blake2s-ref.c
ref/blake2xb-ref.c
ref/blake2xs-ref.c
ref/blake2-impl.h
)
target_include_directories(blake2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/ref)
endif()
target_include_directories(blake2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
121 changes: 0 additions & 121 deletions thirdparty/blake2/COPYING

This file was deleted.

25 changes: 0 additions & 25 deletions thirdparty/blake2/README.md

This file was deleted.

72 changes: 0 additions & 72 deletions thirdparty/blake2/blake2-config.h

This file was deleted.

Loading

0 comments on commit c1ee1bd

Please sign in to comment.