forked from mindspore-Ecosystem/mindspore
eliminate securec warning
This commit is contained in:
parent
08985a1e56
commit
523fde0e25
|
@ -9,6 +9,9 @@ if (NOT TARGET securec)
|
||||||
set(_ms_tmp_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
|
set(_ms_tmp_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "${SECURE_CXX_FLAGS}")
|
set(CMAKE_C_FLAGS "${SECURE_CXX_FLAGS}")
|
||||||
|
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
|
add_compile_definitions(SECUREC_ONLY_DECLARE_MEMSET)
|
||||||
|
endif()
|
||||||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/securec ${CMAKE_BINARY_DIR}/securec)
|
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/securec ${CMAKE_BINARY_DIR}/securec)
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ${_ms_tmp_CMAKE_POSITION_INDEPENDENT_CODE})
|
set(CMAKE_POSITION_INDEPENDENT_CODE ${_ms_tmp_CMAKE_POSITION_INDEPENDENT_CODE})
|
||||||
set(CMAKE_C_FLAGS ${_ms_tmp_CMAKE_C_FLAGS})
|
set(CMAKE_C_FLAGS ${_ms_tmp_CMAKE_C_FLAGS})
|
||||||
|
|
|
@ -9,7 +9,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
#add flags
|
#add flags
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include -Wno-attributes")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include -Werror")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include -Werror")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
aux_source_directory(. SECUREC_SRCS)
|
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
|
list(APPEND SECUREC_SRCS "memset_s.c")
|
||||||
|
else()
|
||||||
|
aux_source_directory(. SECUREC_SRCS)
|
||||||
|
endif()
|
||||||
add_library(securec STATIC ${SECUREC_SRCS})
|
add_library(securec STATIC ${SECUREC_SRCS})
|
||||||
|
|
Loading…
Reference in New Issue