mirror of
https://github.com/fraillt/bitsery.git
synced 2026-06-08 08:13:56 +00:00
Add Missing header (#82)
* add missing header to develop * add test to check include files * fix missing includes * improve test target names Co-authored-by: arch <arch@local>
This commit is contained in:
committed by
Mindaugas Vinkelis
parent
4ff80c6426
commit
bcd03b4d68
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@ build/
|
||||
cmake-build-*
|
||||
CTestConfig.cmake
|
||||
Testing/
|
||||
*.gch
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
#ifndef BITSERY_ADAPTER_MEASURE_SIZE_H
|
||||
#define BITSERY_ADAPTER_MEASURE_SIZE_H
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
#include "../details/adapter_common.h"
|
||||
|
||||
namespace bitsery {
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "../details/adapter_common.h"
|
||||
#include "../traits/array.h"
|
||||
#include <ios>
|
||||
#include <limits>
|
||||
|
||||
namespace bitsery {
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#define BITSERY_BRIEF_SYNTAX_TYPE_STD_MAP_H
|
||||
|
||||
#include <map>
|
||||
#include <limits>
|
||||
#include "../ext/std_map.h"
|
||||
|
||||
namespace bitsery {
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#define BITSERY_BRIEF_SYNTAX_TYPE_STD_QUEUE_H
|
||||
|
||||
#include "../ext/std_queue.h"
|
||||
#include <limits>
|
||||
|
||||
namespace bitsery {
|
||||
template<typename S, typename T, typename C>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#define BITSERY_BRIEF_SYNTAX_TYPE_STD_SET_H
|
||||
|
||||
#include <set>
|
||||
#include <limits>
|
||||
#include "../ext/std_set.h"
|
||||
|
||||
namespace bitsery {
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#ifndef BITSERY_BRIEF_SYNTAX_TYPE_STD_STACK_H
|
||||
#define BITSERY_BRIEF_SYNTAX_TYPE_STD_STACK_H
|
||||
|
||||
#include <limits>
|
||||
#include "../ext/std_stack.h"
|
||||
|
||||
namespace bitsery {
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#define BITSERY_BRIEF_SYNTAX_TYPE_STD_UNORDERED_MAP_H
|
||||
|
||||
#include <unordered_map>
|
||||
#include <limits>
|
||||
#include "../ext/std_map.h"
|
||||
|
||||
namespace bitsery {
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#ifndef BITSERY_BRIEF_SYNTAX_TYPE_STD_UNORDERED_SET_H
|
||||
#define BITSERY_BRIEF_SYNTAX_TYPE_STD_UNORDERED_SET_H
|
||||
|
||||
#include <limits>
|
||||
#include <unordered_set>
|
||||
#include "../ext/std_set.h"
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#define BITSERY_DETAILS_BRIEF_SYNTAX_COMMON_H
|
||||
|
||||
#include "../traits/core/traits.h"
|
||||
#include "serialization_common.h"
|
||||
#include <limits>
|
||||
|
||||
namespace bitsery {
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "details/serialization_common.h"
|
||||
#include "details/adapter_common.h"
|
||||
#include <cassert>
|
||||
#include <limits>
|
||||
|
||||
namespace bitsery {
|
||||
|
||||
|
||||
@@ -63,3 +63,30 @@ if (ParentDir)
|
||||
target_sources(bitsery.dummy_for_ide PRIVATE ${HeadersForIDE} serialization_test_utils.h)
|
||||
target_link_libraries(bitsery.dummy_for_ide PRIVATE GTest::Main Bitsery::bitsery)
|
||||
endif()
|
||||
|
||||
# Check missing includes for each header file in include/bitsery
|
||||
# We compile each header files individually to check if each header contains all required includes
|
||||
# Code adopted from `https://stackoverflow.com/questions/57885042`
|
||||
# Usage:
|
||||
# run from repo root directory
|
||||
# > mkdir -p build && cd build
|
||||
# > cmake -D BITSERY_BUILD_TESTS=1 ..
|
||||
# > make check_includes
|
||||
add_custom_target(check_includes)
|
||||
get_directory_property(ParentDir PARENT_DIRECTORY)
|
||||
if (ParentDir)
|
||||
message("add header include test, run test with 'make check_includes'")
|
||||
file(GLOB_RECURSE HeaderFiles "${ParentDir}/include/bitsery/*.h")
|
||||
FOREACH (HeaderFile ${HeaderFiles})
|
||||
SET(CHK_TARGET_NAME "${HeaderFile}.chk")
|
||||
STRING(REPLACE "${ParentDir}/include/bitsery/" "" CHK_TARGET_NAME ${CHK_TARGET_NAME})
|
||||
STRING(REGEX REPLACE "/" "_" CHK_TARGET_NAME ${CHK_TARGET_NAME})
|
||||
STRING(REGEX REPLACE "\\\\" "_" CHK_TARGET_NAME ${CHK_TARGET_NAME})
|
||||
add_custom_target(
|
||||
${CHK_TARGET_NAME}
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -c ${HeaderFile}
|
||||
VERBATIM
|
||||
)
|
||||
add_dependencies(check_includes ${CHK_TARGET_NAME})
|
||||
ENDFOREACH ()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user