2020-03-27 14:49:12 +08:00
|
|
|
# securec library
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# SECUREC_LIBRARY
|
|
|
|
#
|
|
|
|
|
2021-01-23 20:20:31 +08:00
|
|
|
if(NOT TARGET securec)
|
2020-03-27 14:49:12 +08:00
|
|
|
set(_ms_tmp_CMAKE_POSITION_INDEPENDENT_CODE ${CMAKE_POSITION_INDEPENDENT_CODE})
|
|
|
|
set(_ms_tmp_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
|
|
|
|
|
2021-07-20 20:46:00 +08:00
|
|
|
if(TARGET_OHOS_LITE)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SECURE_CXX_FLAGS}")
|
|
|
|
else()
|
|
|
|
set(CMAKE_C_FLAGS "${SECURE_CXX_FLAGS}")
|
|
|
|
endif()
|
2021-01-23 20:20:31 +08:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
2020-04-17 10:33:37 +08:00
|
|
|
add_compile_definitions(SECUREC_ONLY_DECLARE_MEMSET)
|
|
|
|
endif()
|
2020-03-27 14:49:12 +08:00
|
|
|
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})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include_directories(${CMAKE_CURRENT_LIST_DIR}/../third_party/securec/include)
|
|
|
|
|
|
|
|
set(SECUREC_LIBRARY securec)
|