Skip to content

Commit 18ab9f5

Browse files
cbodleymattbenjamin
authored andcommitted
cmake: use BLAKE3's cmake
Added EXCLUDE_FROM_ALL to prevent gristing files in the subdir. Signed-off-by: Casey Bodley <[email protected]> Signed-off-by: Matt Benjamin <[email protected]>
1 parent 77f6997 commit 18ab9f5

File tree

2 files changed

+5
-33
lines changed

2 files changed

+5
-33
lines changed

src/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,16 @@ if(HAS_GLIBCXX_ASSERTIONS AND CMAKE_BUILD_TYPE STREQUAL Debug)
196196
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-D_GLIBCXX_ASSERTIONS>)
197197
endif()
198198

199+
# add BLAKE3 before we clobber CMAKE_ASM_COMPILER
200+
add_subdirectory(BLAKE3/c EXCLUDE_FROM_ALL)
201+
199202
include(SIMDExt)
200203
if(HAVE_INTEL)
201204
if(APPLE)
202205
set(object_format "macho64")
203206
else()
204207
set(object_format "elf64")
205208
endif()
206-
207-
set(SAVE_CMAKE_ASM_FLAGS ${CMAKE_ASM_FLAGS})
208-
set(SAVE_CMAKE_ASM_COMPILER ${CMAKE_ASM_COMPILER})
209-
210209
set(CMAKE_ASM_FLAGS "-f ${object_format}")
211210
set(CMAKE_ASM_COMPILER ${PROJECT_SOURCE_DIR}/src/nasm-wrapper)
212211
if(NOT WIN32)

src/rgw/CMakeLists.txt

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,6 @@ endfunction()
3030

3131
find_package(ICU 52.0 COMPONENTS uc REQUIRED)
3232

33-
set(blake3_srcs
34-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3.c
35-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3_dispatch.c
36-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3_portable.c)
37-
38-
if (HAVE_INTEL)
39-
# restore compiler detected assembler, following use gas syntax
40-
set(CMAKE_ASM_FLAGS ${SAVE_CMAKE_ASM_FLAGS})
41-
set(CMAKE_ASM_COMPILER ${SAVE_CMAKE_ASM_COMPILER})
42-
if(WIN32)
43-
list(APPEND blake3_srcs
44-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3_sse2_x86-64_windows_gnu.S
45-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3_sse41_x86-64_windows_gnu.S
46-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3_avx2_x86-64_windows_gnu.S
47-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3_avx512_x86-64_windows_gnu.S)
48-
else()
49-
list(APPEND blake3_srcs
50-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3.c
51-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3_dispatch.c
52-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3_portable.c
53-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3_sse2_x86-64_unix.S
54-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3_sse41_x86-64_unix.S
55-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3_avx2_x86-64_unix.S
56-
${CMAKE_SOURCE_DIR}/src/BLAKE3/c/blake3_avx512_x86-64_unix.S)
57-
endif()
58-
endif()
59-
6033
set(librgw_common_srcs
6134
services/svc_finisher.cc
6235
services/svc_bi_rados.cc
@@ -84,7 +57,6 @@ set(librgw_common_srcs
8457
services/svc_user_rados.cc
8558
services/svc_zone.cc
8659
services/svc_zone_utils.cc
87-
${blake3_srcs}
8860
rgw_account.cc
8961
rgw_acl.cc
9062
rgw_acl_s3.cc
@@ -333,7 +305,8 @@ target_link_libraries(rgw_common
333305
RapidJSON::RapidJSON
334306
Boost::context
335307
${FMT_LIB}
336-
OpenSSL::SSL)
308+
OpenSSL::SSL
309+
BLAKE3::blake3)
337310
target_include_directories(rgw_common
338311
PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw/services"
339312
PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw"

0 commit comments

Comments
 (0)