From 936e5173bd5062b557bbec03bfb3020b6d660447 Mon Sep 17 00:00:00 2001 From: gongdaguo1 Date: Wed, 24 Aug 2022 09:30:42 +0800 Subject: [PATCH] fix nnacl x86 build --- .../ccsrc/plugin/device/cpu/kernel/nnacl/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/CMakeLists.txt b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/CMakeLists.txt index 826805bccf1..d5188ea2229 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/CMakeLists.txt +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/CMakeLists.txt @@ -64,6 +64,11 @@ if(APPLE OR PLATFORM_ARM32 OR PLATFORM_ARM64 OR PLATFORM_MCU) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer -fstrict-aliasing \ -ffunction-sections -fdata-sections -ffast-math") endif() +elseif(NOT MSVC) + if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer -fstrict-aliasing -ffunction-sections \ + -fdata-sections") + endif() endif() if(NOT MSVC)