Export MatrixSSL AES compiler option to consumers

This commit is contained in:
OpenAI
2026-06-05 17:25:53 +00:00
committed by Mario Fetka
parent c81266e30a
commit 9c3619078c

View File

@@ -333,7 +333,11 @@ function(matrixssl_configure_target target_name)
target_compile_definitions(${target_name} PUBLIC MATRIX_CONFIGURATION_INCDIR_FIRST)
target_compile_options(${target_name} PRIVATE -ffunction-sections -fdata-sections -fno-math-errno)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64|i[3-6]86)$")
target_compile_options(${target_name} PRIVATE -maes)
# MatrixSSL builds the library with AES enabled on x86 so
# PSCRYPTO_CONFIG contains AESNI=Y. Consumers that include
# cryptoApi.h must see the same compiler feature macros, otherwise
# psCryptoOpen() rejects them with a crypto config mismatch.
target_compile_options(${target_name} PUBLIC -maes)
endif()
if(UNIX AND NOT APPLE)
target_link_libraries(${target_name} PUBLIC pthread m)