1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 17:39:53 +03:00

CMake: Fix BLAKE2 build failure with MSVC due to it not defining __SSE2__

This commit is contained in:
Davide Beatrici 2021-08-10 22:58:28 +02:00
parent 832c69add2
commit 7f8e527883

View File

@ -29,6 +29,12 @@ set(BLAKE2_SRC $<IF:$<BOOL:${HAS_SSE2}>,${BLAKE2_SRC_PATH}/blake2s.c,${BLAKE2_SR
target_include_directories(cedar PUBLIC ${BLAKE2_SRC_PATH})
target_sources(cedar PRIVATE ${BLAKE2_SRC})
if(HAS_SSE2)
# If SSE2 is enabled, a build failure occurs with MSVC because it doesn't define "__SSE2__".
# The fix consists in defining "HAVE_SSE2" manually, effectively overriding the check.
set_property(SOURCE ${BLAKE2_SRC} PROPERTY COMPILE_DEFINITIONS "HAVE_SSE2")
endif()
if(VCPKG_TARGET_TRIPLET)
find_package(unofficial-sodium CONFIG REQUIRED)
target_link_libraries(cedar PUBLIC unofficial-sodium::sodium)