crypto-native: respect platform flags if platform build 50/43750/2
authorDamjan Marion <[email protected]>
Thu, 25 Sep 2025 09:23:18 +0000 (11:23 +0200)
committerDamjan Marion <[email protected]>
Thu, 25 Sep 2025 12:15:41 +0000 (12:15 +0000)
Type: improvement
Change-Id: I79200230c6ebfba988b5f36baa98ef976c9ba58f
Signed-off-by: Damjan Marion <[email protected]>
src/crypto_engines/native/CMakeLists.txt

index d9d72af..d3b4240 100644 (file)
 # 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()