From 2d82d84fd5e2432253dd134cf18dd9c63338c302 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Mon, 1 Mar 2021 23:24:34 +0100 Subject: [PATCH] CMake: Fix regular expression for BLAKE2 SSE2 source files selection The comparison was being made against the variable's name instead of its value, causing the result to always be true. For reference: https://cmake.org/cmake/help/v3.10/manual/cmake-generator-expressions.7.html#genex:BOOL In addition to that, this commit also fixes the source file name of the non-SSE2 code. --- src/Cedar/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Cedar/CMakeLists.txt b/src/Cedar/CMakeLists.txt index 37fe1ac1..2e5c99f9 100644 --- a/src/Cedar/CMakeLists.txt +++ b/src/Cedar/CMakeLists.txt @@ -21,10 +21,11 @@ set_target_properties(cedar cmake_host_system_information(RESULT HAS_SSE2 QUERY HAS_SSE2) -set(BLAKE2_SRC_PATH $,${TOP_DIRECTORY}/3rdparty/BLAKE2/sse,${TOP_DIRECTORY}/3rdparty/BLAKE2/ref>) +set(BLAKE2_SRC_PATH $,${TOP_DIRECTORY}/3rdparty/BLAKE2/sse,${TOP_DIRECTORY}/3rdparty/BLAKE2/ref>) +set(BLAKE2_SRC $,${BLAKE2_SRC_PATH}/blake2s.c,${BLAKE2_SRC_PATH}/blake2s-ref.c>) target_include_directories(cedar PUBLIC ${BLAKE2_SRC_PATH}) -target_sources(cedar PRIVATE "${BLAKE2_SRC_PATH}/blake2s.c") +target_sources(cedar PRIVATE ${BLAKE2_SRC}) if(VCPKG_TARGET_TRIPLET) find_package(unofficial-sodium CONFIG REQUIRED)