mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-07 12:33:39 +08:00
Update SM4 OpenCL implementation
This commit is contained in:
@@ -327,6 +327,15 @@ if (ENABLE_SM4_CTR_AESNI_AVX)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
|
||||
endif()
|
||||
|
||||
if (ENABLE_SM4_CL)
|
||||
message(STATUS "ENABLE_SM4_CL is ON")
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
add_definitions(-DMACOS) # to include <OpenCL/OpenCL.h>
|
||||
endif()
|
||||
list(APPEND src src/sm4_cl.c)
|
||||
list(APPEND tests sm4_cl)
|
||||
endif()
|
||||
|
||||
if (ENABLE_SM4_ECB)
|
||||
message(STATUS "ENABLE_SM4_ECB is ON")
|
||||
add_definitions(-DENABLE_SM4_ECB)
|
||||
@@ -516,7 +525,10 @@ if (WIN32)
|
||||
elseif (APPLE)
|
||||
target_link_libraries(gmssl dl)
|
||||
target_link_libraries(gmssl "-framework Security")
|
||||
#target_link_libraries(gmssl "-framework OpenCL")
|
||||
if (ENABLE_SM4_CL)
|
||||
# FIXME: different rules for cl and OpenCL framework
|
||||
target_link_libraries(gmssl "-framework OpenCL")
|
||||
endif()
|
||||
#target_link_libraries(gmssl "-framework CoreFoundation") # rand_apple.c CFRelease()
|
||||
elseif (MINGW)
|
||||
target_link_libraries(gmssl PRIVATE wsock32)
|
||||
|
||||
Reference in New Issue
Block a user