From 9d3c26218f3ce2951639e6b0f78733192f62e9ab Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Thu, 25 Sep 2025 11:23:18 +0200 Subject: [PATCH] crypto-native: respect platform flags if platform build Type: improvement Change-Id: I79200230c6ebfba988b5f36baa98ef976c9ba58f Signed-off-by: Damjan Marion --- src/crypto_engines/native/CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/crypto_engines/native/CMakeLists.txt b/src/crypto_engines/native/CMakeLists.txt index d9d72aff58e..d3b42408f58 100644 --- a/src/crypto_engines/native/CMakeLists.txt +++ b/src/crypto_engines/native/CMakeLists.txt @@ -11,6 +11,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +set (COMPILE_FILES aes_cbc.c aes_gcm.c aes_ctr.c sha2.c) +set (COMPILE_OPTS -Wall -fno-common) + +if(DEFINED VPP_PLATFORM) + add_vpp_crypto_engine(native SOURCES main.c ${COMPILE_FILES}) + target_compile_options(native_crypto_engine PUBLIC ${COMPILE_OPTS}) + return() +endif() + if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*") list(APPEND VARIANTS "slm\;-march=silvermont -maes") list(APPEND VARIANTS "hsw\;-march=haswell -maes") @@ -29,9 +38,6 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)") list(APPEND VARIANTS "armv8\;-march=armv8.1-a+crc+crypto") endif() -set (COMPILE_FILES aes_cbc.c aes_gcm.c aes_ctr.c sha2.c) -set (COMPILE_OPTS -Wall -fno-common) - if (NOT VARIANTS) return() endif() -- 2.16.6