Skip to content

Commit

Permalink
Merge pull request #100 from chillenb/cmaketargets
Browse files Browse the repository at this point in the history
add option to use precompiled headers for faster builds
  • Loading branch information
hczhai authored Jul 5, 2024
2 parents a5e1e84 + 416db3e commit dbe1ff6
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit dbe1ff6

Please sign in to comment.