Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to use precompiled headers for faster builds #100

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ OPTION(APPLE_ACC_SINGLE_PREC "Fix Apple Accelerate single prec" ON)
OPTION(BUILD_LIB "Build python block2.so" OFF)
OPTION(BUILD_CLIB "Build C++ block2.so" OFF)
OPTION(FORCE_LIB_ABS_PATH "Using absolute path when linking libraries" ON)
OPTION(USE_PCH "Use precompiled headers for faster builds" OFF)

IF (NOT ${USE_DMRG})
SET(USE_BIG_SITE OFF)
Expand Down Expand Up @@ -642,6 +643,12 @@ TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PUBLIC
$<INSTALL_INTERFACE:include>
${MKL_INCLUDE_DIR} ${SCI_INCLUDE_DIR})

IF(${USE_PCH})
# these will be precompiled if USE_PCH is ON
FILE(GLOB COREHDRS src/instantiation/*.hpp)
TARGET_PRECOMPILE_HEADERS(${PROJECT_NAME} PRIVATE ${COREHDRS})
ENDIF()

IF ((NOT APPLE) AND (NOT WIN32))
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PRIVATE rt)
ENDIF()
Expand Down
Loading