Use a precompiled header for many std includes.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-09-25 11:06:55 +02:00
parent 87706ffae0
commit 51c7ba1c50
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
13 changed files with 24 additions and 34 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
project(Arbutils)
# Enable all warnings, and make them error when occurring.
@ -30,6 +30,7 @@ endif()
# Grab all cpp and hpp files in our source directories.
file(GLOB_RECURSE SRC_FILES "src/*.cpp" "src/*.hpp" "CInterface/*.cpp" "CInterface/*.hpp")
add_library(Arbutils ${LIBTYPE} ${SRC_FILES})
target_precompile_headers(Arbutils PUBLIC src/Precompiled.hxx)
# If we are building for Windows we need to set some specific variables.
if (WINDOWS)

View File

@ -1,7 +1,4 @@
/** @file */
#include <sstream>
#include <stdexcept>
#include <string.h>
#include "Exception.hpp"
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)

View File

@ -1,7 +1,5 @@
#ifndef ARBUTILS_DICTIONARY_HPP
#define ARBUTILS_DICTIONARY_HPP
#include <cstdint>
#include <unordered_map>
#include "../Assert.hpp"
namespace ArbUt {

View File

@ -1,9 +1,5 @@
#ifndef ARBUTILS_LIST_HPP
#define ARBUTILS_LIST_HPP
#include <algorithm>
#include <sstream>
#include <stdexcept>
#include <vector>
#include "../Exception.hpp"
namespace ArbUt {

View File

@ -1,9 +1,3 @@
#include <algorithm>
#include <cmath>
#include <sstream>
#include <stdexcept>
#include <variant>
#include <vector>
#include "MacroUtils.hpp"
#include "StringView.hpp"

View File

@ -1,10 +1,6 @@
#ifndef ARBUTILS_EXCEPTION_HPP
#define ARBUTILS_EXCEPTION_HPP
#include <exception>
#include <sstream>
#include <string>
#include <utility>
#if !WINDOWS
#if PRETTYTRACES
#define BACKWARD_HAS_DW 1

View File

@ -1,7 +1,6 @@
#ifndef ARBUTILS_BORROWEDPTR_HPP
#define ARBUTILS_BORROWEDPTR_HPP
#include <memory>
#include "../Assert.hpp"
namespace ArbUt {

View File

@ -1,10 +1,6 @@
#ifndef ARBUTILS_UNIQUEPTRLIST_HPP
#define ARBUTILS_UNIQUEPTRLIST_HPP
#include <algorithm>
#include <sstream>
#include <stdexcept>
#include <vector>
#include "BorrowedPtr.hpp"
namespace ArbUt {

21
src/Precompiled.hxx Normal file
View File

@ -0,0 +1,21 @@
#ifndef ARBUTILS_PRECOMPILED_HXX
#define ARBUTILS_PRECOMPILED_HXX
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <exception>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <string>
#include <string_view>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <variant>
#include <vector>
#endif // ARBUTILS_PRECOMPILED_HXX

View File

@ -1,7 +1,6 @@
#ifndef ARBUTILS_BASICSTRINGVIEW_HPP
#define ARBUTILS_BASICSTRINGVIEW_HPP
#include <iostream>
#include <string>
/// \defgroup Strings Strings
/// \brief Group of non-editable strings with faster hashing.

View File

@ -1,5 +1,4 @@
#include "StringView.hpp"
#include <memory>
namespace ArbUt {
std::shared_ptr<__ConstStringCharHolder> StringView::__emptyString =

View File

@ -1,11 +1,6 @@
#ifndef ARBUTILS_STRINGVIEW_HPP
#define ARBUTILS_STRINGVIEW_HPP
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <memory>
#include <string_view>
#include "BasicStringView.hpp"
#if WINDOWS

View File

@ -1,7 +1,6 @@
#ifndef ARBUTILS_STRINGVIEWLITERAL_HPP
#define ARBUTILS_STRINGVIEWLITERAL_HPP
#include <cstdint>
#include "BasicStringView.hpp"
#include "StringView.hpp"