Skip to content

Commit a2016e4

Browse files
committed
wip
1 parent 858a64d commit a2016e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+51
-210
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ out/
4949
# Precompiled Headers
5050
*.gch
5151
*.pch
52+
pch/pch.cpp
5253

5354
# Compiled Dynamic libraries
5455
*.so

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,20 @@ endif ()
4242

4343
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
4444

45+
file(GENERATE OUTPUT ${ark_SOURCE_DIR}/pch/pch.cpp CONTENT "")
46+
add_library(PCH OBJECT ${ark_SOURCE_DIR}/pch/pch.cpp)
47+
target_precompile_headers(PCH PRIVATE ${ark_SOURCE_DIR}/pch/pch.hpp)
48+
target_include_directories(PCH PRIVATE ${ark_SOURCE_DIR}/pch)
49+
target_compile_features(PCH PRIVATE cxx_std_20)
50+
4551
# files needed for the library ArkReactor
4652
file(GLOB_RECURSE SOURCE_FILES
4753
${ark_SOURCE_DIR}/src/arkreactor/*.cpp
4854
${ark_SOURCE_DIR}/lib/fmt/src/format.cc)
4955

5056
add_library(ArkReactor SHARED ${SOURCE_FILES})
5157
enable_lto(ArkReactor)
58+
target_precompile_headers(ArkReactor REUSE_FROM PCH)
5259
target_include_directories(ArkReactor
5360
PUBLIC
5461
${ark_SOURCE_DIR}/include)
@@ -192,6 +199,7 @@ if (ARK_TESTS)
192199
${ark_SOURCE_DIR}/src/arkscript/JsonCompiler.cpp
193200
${ark_SOURCE_DIR}/src/arkscript/REPL/Utils.cpp)
194201
add_executable(unittests ${SOURCES})
202+
target_precompile_headers(unittests REUSE_FROM PCH)
195203
target_include_directories(unittests PUBLIC ${ark_SOURCE_DIR}/tests/unittests)
196204

197205
target_include_directories(unittests SYSTEM PUBLIC ${ark_SOURCE_DIR}/lib/dtl/dtl)
@@ -261,6 +269,7 @@ if (ARK_BUILD_EXE)
261269

262270
add_subdirectory("${ark_SOURCE_DIR}/lib/clipp" EXCLUDE_FROM_ALL)
263271

272+
target_precompile_headers(arkscript REUSE_FROM PCH)
264273
target_include_directories(arkscript SYSTEM PUBLIC "${ark_SOURCE_DIR}/lib/clipp/include")
265274
target_link_libraries(arkscript PUBLIC ArkReactor replxx clipp)
266275
target_compile_features(arkscript PRIVATE cxx_std_20)

include/Ark/Builtins/Builtins.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#ifndef ARK_BUILTINS_BUILTINS_HPP
1212
#define ARK_BUILTINS_BUILTINS_HPP
1313

14-
#include <vector>
15-
1614
#include <Ark/VM/Value.hpp>
1715
#include <Ark/Exceptions.hpp>
1816

include/Ark/Compiler/AST/BaseParser.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#ifndef SRC_BASEPARSER_HPP
22
#define SRC_BASEPARSER_HPP
33

4-
#include <string>
5-
#include <vector>
6-
#include <initializer_list>
7-
84
#include <Ark/Platform.hpp>
95
#include <Ark/Compiler/AST/Predicates.hpp>
106
#include <Ark/Compiler/AST/utf8_char.hpp>

include/Ark/Compiler/AST/Import.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#ifndef ARK_COMPILER_AST_IMPORT_HPP
22
#define ARK_COMPILER_AST_IMPORT_HPP
33

4-
#include <vector>
5-
#include <string>
6-
#include <numeric>
7-
84
#include <Ark/Platform.hpp>
95

106
namespace Ark::internal

include/Ark/Compiler/AST/Namespace.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#ifndef ARK_COMPILER_AST_NAMESPACE_HPP
22
#define ARK_COMPILER_AST_NAMESPACE_HPP
33

4-
#include <string>
5-
#include <vector>
6-
#include <memory>
7-
84
namespace Ark::internal
95
{
106
class Node;

include/Ark/Compiler/AST/Node.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
#ifndef COMPILER_AST_NODE_HPP
1212
#define COMPILER_AST_NODE_HPP
1313

14-
#include <variant>
15-
#include <ostream>
16-
#include <string>
17-
#include <vector>
18-
1914
#include <Ark/Compiler/AST/Namespace.hpp>
2015
#include <Ark/Compiler/Common.hpp>
2116
#include <Ark/Platform.hpp>

include/Ark/Compiler/AST/Optimizer.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
#ifndef COMPILER_AST_OPTIMIZER_HPP
1212
#define COMPILER_AST_OPTIMIZER_HPP
1313

14-
#include <functional>
15-
#include <unordered_map>
16-
#include <string>
17-
1814
#include <Ark/Platform.hpp>
1915
#include <Ark/Compiler/Pass.hpp>
2016
#include <Ark/Compiler/AST/Node.hpp>

include/Ark/Compiler/AST/Parser.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
#include <Ark/Utils.hpp>
1919
#include <Ark/Platform.hpp>
2020

21-
#include <string>
22-
#include <optional>
23-
#include <vector>
24-
2521
#include <utf8.hpp>
2622

2723
namespace Ark::internal

include/Ark/Compiler/AST/Predicates.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#ifndef SRC_PREDICATES_HPP
22
#define SRC_PREDICATES_HPP
33

4-
#include <string>
5-
#include <cctype>
6-
74
#include <Ark/Compiler/AST/utf8_char.hpp>
85

96
namespace Ark::internal

0 commit comments

Comments
 (0)