Skip to content

Commit 86f479f

Browse files
Added precompiled headers
1 parent c7beb60 commit 86f479f

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/application/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ target_link_libraries(application
9494
)
9595

9696

97+
# Precompiled header support
98+
option(LIBRUM_BUILD_USING_PCH "Build using pre-compile header support" ON)
99+
if (LIBRUM_BUILD_USING_PCH)
100+
message("Compiling using pre-compiled headers")
101+
target_precompile_headers(application PUBLIC librum_application_pch.hpp) # PUBLIC - every linking target gets the same PCHs
102+
set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON)
103+
else()
104+
message(STATUS "Precompiled headers are disabled")
105+
endif()
106+
107+
97108
# Remove 'address sanitizer' from 'application' target when compiling with anything but GCC.
98109
# Okular core has some ODR violations, which lead to 'address sanitizer' failing on startup.
99110
# It works well with GCC though, so just remove it when compiling with any other compiler.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// A file for headers to pre-compile
2+
#pragma once
3+
4+
#include <QObject>
5+
#include <memory>

0 commit comments

Comments
 (0)