fix compile warning

This commit is contained in:
liubuyu 2020-09-16 16:17:29 +08:00
parent dccd231ff0
commit d914f617ed
3 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)