Skip to content

Commit 582ed6d

Browse files
committed
add cmake option to enable pch
1 parent cf4d0c8 commit 582ed6d

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ option(QL_INSTALL_EXAMPLES "Install examples" ON)
6161
option(QL_INSTALL_TEST_SUITE "Install test suite" ON)
6262
option(QL_TAGGED_LAYOUT "Library names use layout tags" ${MSVC})
6363
option(QL_USE_CLANG_TIDY "Use clang-tidy when building" OFF)
64+
option(QL_USE_PCH "Use precompiled headers" OFF)
6465
# Deleted from QL 1.27
6566
option(QL_USE_DISPOSABLE "Use the Disposable class template. Not needed for C++11" OFF)
6667
option(QL_USE_INDEXED_COUPON "Use indexed coupons instead of par coupons" OFF)

ql/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,6 +2357,24 @@ set_target_properties(ql_library PROPERTIES
23572357
VERSION ${QUANTLIB_VERSION}
23582358
SOVERSION ${QUANTLIB_VERSION_MAJOR})
23592359

2360+
if (QL_USE_PCH)
2361+
target_precompile_headers(ql_library
2362+
PUBLIC
2363+
<ql/any.hpp>
2364+
<ql/errors.hpp>
2365+
<ql/index.hpp>
2366+
<ql/indexes/indexmanager.hpp>
2367+
<ql/instrument.hpp>
2368+
<ql/indexes/interestrateindex.hpp>
2369+
<ql/math/array.hpp>
2370+
<ql/math/interpolations/cubicinterpolation.hpp>
2371+
<ql/math/matrix.hpp>
2372+
<ql/methods/finitedifferences/operators/fdmlinearop.hpp>
2373+
<ql/patterns/observable.hpp>
2374+
<ql/qldefines.hpp>
2375+
<ql/termstructure.hpp>)
2376+
endif()
2377+
23602378
target_compile_definitions(ql_library PRIVATE
23612379
QL_COMPILATION)
23622380

0 commit comments

Comments
 (0)