From d914f617ed1c1e7c7d1d022d19c4665483722704 Mon Sep 17 00:00:00 2001 From: liubuyu Date: Wed, 16 Sep 2020 16:17:29 +0800 Subject: [PATCH] fix compile warning --- CMakeLists.txt | 2 +- build.sh | 2 +- mindspore/core/gvar/CMakeLists.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aad9c5dd54e..cda70d5b74a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.14.1) project (MindSpore) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3.0) diff --git a/build.sh b/build.sh index d2f1d68238b..3be1a58bee6 100755 --- a/build.sh +++ b/build.sh @@ -236,7 +236,7 @@ checkopts() z) eval ARG=\$\{$OPTIND\} if [[ -n $ARG && $ARG != -* ]]; then - OPTARG=$ARG + OPTARG="$ARG" check_on_off $OPTARG z OPTIND=$((OPTIND + 1)) else diff --git a/mindspore/core/gvar/CMakeLists.txt b/mindspore/core/gvar/CMakeLists.txt index 26ff5ff870c..7da661b2b65 100644 --- a/mindspore/core/gvar/CMakeLists.txt +++ b/mindspore/core/gvar/CMakeLists.txt @@ -1,5 +1,6 @@ file(GLOB_RECURSE MS_GVAR_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cc) set_property(SOURCE ${MS_GVAR_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_COMMON) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2 -O2") if (CMAKE_SYSTEM_NAME MATCHES "Windows") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes -DHAVE_SNPRINTF") add_compile_definitions(BUILDING_DLL)