From 9c3619078c1929792b6e08e0f7f62d5937d6e355 Mon Sep 17 00:00:00 2001 From: OpenAI Date: Fri, 5 Jun 2026 17:25:53 +0000 Subject: [PATCH] Export MatrixSSL AES compiler option to consumers --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab70b11..048d844 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)