1 Star 0 Fork 21

lifeng_isula/clibcni_openeuler

forked from openEuler/clibcni 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CMakeLists.txt 1.93 KB
一键复制 编辑 原始数据 按行查看 历史
lifeng_isula 提交于 2020-12-29 10:27 . clibcni: Release v2.0.4
cmake_minimum_required (VERSION 2.8)
project (clibcni)
option(VERSION "set clibcni version" ON)
if (VERSION STREQUAL "ON")
set(CLIBCNI_VERSION "2.0.4")
endif()
option(DEBUG "set clibcni gcc option" ON)
if (DEBUG STREQUAL "ON")
add_definitions("-g -o2")
endif()
option(GCOV "set clibcni gcov option" OFF)
if (GCOV STREQUAL "ON")
set(CLIBCNI_GCOV "ON")
endif()
# check depends libs and headers
include(cmake/checker.cmake)
if (CHECKER_RESULT)
return()
endif()
set(CMAKE_C_FLAGS "-fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 -O2 -Wall -Werror")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-E -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wtrampolines -fPIE -pie -shared -pthread")
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-E -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wtrampolines -fPIE -shared -pthread")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
"${CMAKE_BINARY_DIR}/conf/config.h"
)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/clibcni.pc.in"
"${CMAKE_BINARY_DIR}/conf/clibcni.pc"
)
# build which type of clibcni library
option(USESHARED "set type of libclibcni, default is shared" ON)
if (USESHARED STREQUAL "ON")
set(LIBTYPE "SHARED")
message("-- Build shared library")
else ()
set(LIBTYPE "STATIC")
message("-- Build static library")
endif()
if (LIB_INSTALL_DIR)
set(LIB_INSTALL_DIR_DEFAULT ${LIB_INSTALL_DIR})
else()
set(LIB_INSTALL_DIR_DEFAULT "lib")
endif()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)
# install all files
install(FILES ${CMAKE_BINARY_DIR}/conf/clibcni.pc
DESTINATION ${LIB_INSTALL_DIR_DEFAULT}/pkgconfig PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE)
install(FILES src/types/types.h DESTINATION include/clibcni)
install(FILES src/version/version.h DESTINATION include/clibcni)
install(FILES src/api.h DESTINATION include/clibcni)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/lifeng2221dd1/clibcni_openeuler.git
git@gitee.com:lifeng2221dd1/clibcni_openeuler.git
lifeng2221dd1
clibcni_openeuler
clibcni_openeuler
master

搜索帮助