build: Compile for Sandy Bridge CPU target. (#2651)

This commit is contained in:
squidbus 2025-03-18 16:02:34 -07:00 committed by GitHub
parent 5691046dcc
commit 171f755c13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 31 deletions

View file

@ -26,22 +26,19 @@ if (NOT TARGET fmt::fmt)
add_subdirectory(fmt)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND MSVC)
# If it is clang and MSVC we will add a static lib
# CryptoPP
add_subdirectory(cryptoppwin)
target_include_directories(cryptoppwin INTERFACE cryptoppwin/include)
else()
# CryptoPP
if (NOT TARGET cryptopp::cryptopp)
set(CRYPTOPP_INSTALL OFF)
set(CRYPTOPP_BUILD_TESTING OFF)
set(CRYPTOPP_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/cryptopp)
add_subdirectory(cryptopp-cmake)
file(COPY cryptopp DESTINATION cryptopp FILES_MATCHING PATTERN "*.h")
# remove externals/cryptopp from include directories because it contains a conflicting zlib.h file
set_target_properties(cryptopp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/cryptopp")
endif()
# CryptoPP
if (NOT TARGET cryptopp::cryptopp)
set(CRYPTOPP_INSTALL OFF)
set(CRYPTOPP_BUILD_TESTING OFF)
set(CRYPTOPP_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/cryptopp)
# cryptopp instruction set checks do not account for added compile options,
# so disable extensions in the library config to match our chosen target CPU.
set(CRYPTOPP_DISABLE_AESNI ON)
set(CRYPTOPP_DISABLE_AVX2 ON)
add_subdirectory(cryptopp-cmake)
file(COPY cryptopp DESTINATION cryptopp FILES_MATCHING PATTERN "*.h")
# remove externals/cryptopp from include directories because it contains a conflicting zlib.h file
set_target_properties(cryptopp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/cryptopp")
endif()
if (NOT TARGET FFmpeg::ffmpeg)

2
externals/cryptopp vendored

@ -1 +1 @@
Subproject commit 60f81a77e0c9a0e7ffc1ca1bc438ddfa2e43b78e
Subproject commit ee84a3144137ac0a1294c0b4a342dca13b66923f

@ -1 +0,0 @@
Subproject commit bc3441dd2d6a9728e747dc0180bc8b9065a2923c