Начало рефакторинга

This commit is contained in:
Andrei Astafev 2020-04-21 12:46:30 +03:00
parent b845211222
commit 44817a8a94
8 changed files with 21 additions and 9 deletions

View File

@ -15,7 +15,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/find)
include(CMLibCommon)
option(MYXLIB_BUILD_COMPILED "Build compiled version of library" OFF)
option(MYXLIB_HEADER_ONLY "Build header only version of library" ON)
option(MYXLIB_BUILD_EXAMPLES "Build examples" OFF)
# Поиск библиотек с помощью pkgconfig
@ -64,4 +64,3 @@ endif()
# Документация
add_subdirectory(cmake/doc)

View File

@ -9,6 +9,7 @@ set(TRGT_cpp
# Список заголовочных файлов
set(TRGT_hpp
${CMAKE_CURRENT_SOURCE_DIR}/config.hpp
${CMAKE_CURRENT_SOURCE_DIR}/config-inl.hpp
${CMAKE_CURRENT_SOURCE_DIR}/limits.hpp
${CMAKE_CURRENT_SOURCE_DIR}/enum_bitmask_operations.hpp)
@ -33,7 +34,7 @@ add_pvs_check(${TRGT})
# Создание цели для автоматического форматирования кода
add_format_sources(${TRGT} ${TRGT_cpp} ${TRGT_headers})
target_include_directories(${TRGT} SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS})
target_include_directories(${TRGT} SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/src)
cotire(${TRGT})

View File

@ -0,0 +1,10 @@
#ifndef MYX_BASE_CONFIG_INL_HPP_
#define MYX_BASE_CONFIG_INL_HPP_
#pragma once
#ifndef MYXLIB_HEADER_ONLY
#include <myx/base/config.hpp>
#endif
#endif // MYX_BASE_CONFIG_INL_HPP_

View File

@ -1,6 +1,12 @@
#ifndef MYX_BASE_CONFIG_HPP_
#define MYX_BASE_CONFIG_HPP_
#include "config_flags.hpp"
#pragma once
#include <myx/base/config_flags.hpp>
#ifdef MYXLIB_HEADER_ONLY
#include "config-inl.hpp"
#endif
#endif // MYX_BASE_CONFIG_HPP_

View File

@ -37,7 +37,6 @@ add_format_sources(${TRGT} ${TRGT_cpp} ${TRGT_headers})
target_include_directories(${TRGT} SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS})
target_include_directories(${TRGT} SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/src)
target_include_directories(${TRGT} PRIVATE ${CMAKE_BINARY_DIR}/include)
cotire(${TRGT})

View File

@ -44,9 +44,7 @@ add_pvs_check(${TRGT})
# Создание цели для автоматического форматирования кода
add_format_sources(${TRGT} ${TRGT_sources} ${TRGT_headers})
target_include_directories(${TRGT} SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS})
target_include_directories(${TRGT} SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/src)
target_include_directories(${TRGT} PRIVATE ${CMAKE_BINARY_DIR}/include)
cotire(${TRGT})

View File

@ -43,7 +43,6 @@ add_format_sources(${TRGT} ${TRGT_cpp} ${TRGT_headers})
target_include_directories(${TRGT} SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS})
target_include_directories(${TRGT} SYSTEM PUBLIC ${Qt5Network_INCLUDE_DIRS})
target_include_directories(${TRGT} SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/src)
target_include_directories(${TRGT} PRIVATE ${CMAKE_BINARY_DIR}/include)
cotire(${TRGT})

View File

@ -9,6 +9,6 @@
// #define MYX_REDIS_EXPORT Q_DECL_IMPORT
// #endif
#include "config_flags.hpp"
#include <myx/base/config_flags.hpp>
#endif // MYX_REDIS_CONFIG_HPP_