加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 1.91 KB
一键复制 编辑 原始数据 按行查看 历史
cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
cmake_policy (SET CMP0054 NEW)
option (YOCTO "Use YOCTO depedencies system" ON)
set (CMAKE_CXX_STANDARD 20)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (
CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} \
-Werror \
-Wtype-limits \
-Wnull-dereference \
"
)
project (phytium-ipmi-oem CXX)
add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY)
add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED)
add_definitions (-DBOOST_ALL_NO_LIB)
add_definitions (-DBOOST_NO_RTTI)
add_definitions (-DBOOST_NO_TYPEID)
add_definitions (-DBOOST_ASIO_DISABLE_THREADS)
add_definitions (-DBOOST_COROUTINES_NO_DEPRECATION_WARNING)
add_definitions (-Wno-psabi)
if (YOCTO)
find_package (PkgConfig REQUIRED)
pkg_check_modules (LOGGING phosphor-logging REQUIRED)
include_directories (SYSTEM ${LOGGING_INCLUDE_DIRS})
link_directories (${LOGGING_LIBRARY_DIRS})
pkg_check_modules (LIBIPMID libipmid REQUIRED)
include_directories (SYSTEM ${LIBIPMID_INCLUDE_DIRS})
link_directories (${LIBIPMID_LIBRARY_DIRS})
endif ()
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
add_library (phytiumoemcmds
SHARED src/devicehandler.cpp src/hostmonitor.cpp
src/cperhandler.cpp src/boardadaptive.cpp
src/tcmhandler.cpp)
set_target_properties (phytiumoemcmds PROPERTIES VERSION "0.1.0")
set_target_properties (phytiumoemcmds PROPERTIES SOVERSION "0")
target_link_libraries (phytiumoemcmds stdc++fs)
target_link_libraries (phytiumoemcmds ipmid)
target_link_libraries (phytiumoemcmds sdbusplus)
target_link_libraries (phytiumoemcmds ipmiblob)
target_link_libraries (phytiumoemcmds phosphor_logging)
option (TPCM_ENABLE "Use Phytium tpcm device" OFF)
if (TPCM_ENABLE)
target_compile_definitions (phytiumoemcmds PRIVATE TPCM_ENABLE)
target_link_libraries (phytiumoemcmds tsbapi)
endif()
install (TARGETS phytiumoemcmds DESTINATION lib/ipmid-providers)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化