eliminate securec warning

This commit is contained in:
chenjianping 2020-04-17 02:33:37 +00:00
parent 08985a1e56
commit 523fde0e25
3 changed files with 9 additions and 3 deletions

View File

@ -9,6 +9,9 @@ if (NOT TARGET securec)
set(_ms_tmp_CMAKE_C_FLAGS ${CMAKE_C_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)
set(CMAKE_POSITION_INDEPENDENT_CODE ${_ms_tmp_CMAKE_POSITION_INDEPENDENT_CODE})
set(CMAKE_C_FLAGS ${_ms_tmp_CMAKE_C_FLAGS})

View File

@ -9,7 +9,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#add flags
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()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include -Werror")
endif()

View File

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