1 Star 0 Fork 177

wangshuide/mindinsight

forked from MindSpore/mindinsight 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
LiHongzhang 提交于 2020-04-02 14:57 . add securec to submodule
cmake_minimum_required(VERSION 3.14)
find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
option(GIT_SUBMODULE "Check submodules during build" ON)
if(GIT_SUBMODULE)
message(STATUS "Updating submodules")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT)
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "git submodule update failed with ${GIT_SUBMOD_RESULT}, please checkout submodules.")
endif()
endif()
elseif(NOT EXISTS "${PROJECT_SOURCE_DIR}/third_party/securec/src")
message(FATAL_ERROR "git command not found or not in a git repository, third_party/securec/src not exists.")
else()
message(WARNING "git command not found or not in a git repository, submodules not updated.")
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
set(CMAKE_C_FLAGS_DEBUG "$ENV{CFLAGS} -fPIC -O0 -Wall -fvisibility=hidden -Wno-deprecated-declarations -g2 -ggdb -fno-inline-functions -fno-omit-frame-pointer -D_LIBCPP_INLINE_VISIBILITY='' -D'_LIBCPP_EXTERN_TEMPLATE(...)='")
set(CMAKE_C_FLAGS_RELEASE "$ENV{CFLAGS} -fPIC -O3 -Wall -fvisibility=hidden -Wno-deprecated-declarations")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#add flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include -Werror")
include_directories(./third_party/securec/include)
aux_source_directory(./third_party/securec/src SECUREC_SRCS)
add_library(securec ${SECUREC_SRCS})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/wangshuide2020/mindinsight.git
git@gitee.com:wangshuide2020/mindinsight.git
wangshuide2020
mindinsight
mindinsight
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385