调整sysinfo的结构

This commit is contained in:
Debaucher 2021-11-03 21:03:31 +08:00
parent 449bb53b6e
commit 012cbc8604
8 changed files with 11 additions and 10 deletions

View File

@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.1.3)
project(kysdk-system)
include_directories("${PROJECT_BINARY_DIR}")
include_directories("/usr/include/kysdk/kysdk-base")
link_directories("/usr/lib/kysdk/kysdk-base")
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
@ -11,7 +13,7 @@ set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
add_definitions(-Drelease)
add_definitions(-DRELEASE_BUILD)
set(CMAKE_C_FLAGS "$ENV{CFLAGS} -O2 -Wall")
set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O2 -Wall")
else (CMAKE_BUILD_TYPE)

View File

@ -1,5 +1,3 @@
include_directories(/usr/include/kysdk/kysdk-base/)
add_subdirectory(disk)
add_subdirectory(systeminfo)
add_subdirectory(systemtime)

View File

@ -2,8 +2,8 @@ aux_source_directory(. SOURCESCODE)
add_library(kydiskinfo SHARED ${SOURCESCODE})
add_executable(test-getdiskinfo test/getdiskinfo.c)
add_executable(test-getdisklist test/getdisklist.c)
target_link_libraries(test-getdiskinfo kydiskinfo)
target_link_libraries(test-getdisklist kydiskinfo)
target_link_libraries(test-getdiskinfo kydiskinfo blkid kylog pthread systemd kyconf)
target_link_libraries(test-getdisklist kydiskinfo blkid kylog pthread systemd kyconf)
install(TARGETS kydiskinfo
DESTINATION lib/kysdk/kysdk-system)

View File

@ -1,10 +1,11 @@
aux_source_directory(. SOURCESCODE)
include_directories(.)
add_library(kysysinfo SHARED ${SOURCESCODE})
add_executable(kysysinfo-test test/test.cpp)
add_executable(kysysinfo-test test/kysysinfo_test.cpp)
target_link_libraries(kysysinfo-test kysysinfo)
install(TARGETS kysysinfo
DESTINATION lib/kysdk/kysdk-system)
install(FILES systeminfo.hpp
install(FILES libkysysinfo.hpp
DESTINATION include/kysdk/kysdk-system)

View File

@ -1,4 +1,4 @@
#include "systeminfo.hpp"
#include "libkysysinfo.hpp"
#include <fstream>
namespace KDK_SYSTEM{

View File

@ -2,7 +2,7 @@
#define KYSDK_SYSTEM_SYSINFO_H__
/**
* @file systeminfo.h
* @file libkysysinfo.h
* @author liuyunhe (liuyunhe@kylinos.cn)
* @brief
* @version 0.1

View File

@ -1,4 +1,4 @@
#include "systeminfo.hpp"
#include <libkysysinfo.hpp>
#include <iostream>
using namespace std;