Skip to content

Commit

Permalink
Add pyAMReX_CCACHE Option (AMReX-Codes#247)
Browse files Browse the repository at this point in the history
Cleaner way to disable CCache in package managers.
  • Loading branch information
ax3l authored Feb 1, 2024
1 parent e8a6c04 commit 64e1c06
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ set_cxx17_superbuild()
# this is an optional tool that stores compiled object files; allows fast
# re-builds even with "make clean" in between. Mainly used to store AMReX
# objects
set_ccache()
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set(pyAMReX_CCACHE_DEFAULT ON)
else()
set(pyAMReX_CCACHE_DEFAULT OFF) # we are a subproject in a superbuild
endif()
option(pyAMReX_CCACHE "Enable ccache for faster rebuilds" ${pyAMReX_CCACHE_DEFAULT})
if(pyAMReX_CCACHE)
set_ccache()
endif()


# Output (build) Directories ##################################################
Expand Down
2 changes: 1 addition & 1 deletion docs/source/install/cmake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ By default, the most important dependencies of pyAMReX are automatically downloa
CMake Option Default & Values Description
============================= ============================================== ===========================================================
``BUILD_SHARED_LIBS`` ON/**OFF** Build shared libraries for dependencies
``CCACHE_PROGRAM`` First found ``ccache`` executable. Set to ``-DCCACHE_PROGRAM=NO`` to disable CCache.
``pyAMReX_CCACHE`` **ON**/OFF Search and use CCache to speed up rebuilds.
``pyAMReX_amrex_src`` *None* Path to AMReX source directory (preferred if set)
``pyAMReX_amrex_repo`` ``https://github.com/AMReX-Codes/amrex.git`` Repository URI to pull and build AMReX from
``pyAMReX_amrex_branch`` *we set and maintain a compatible commit* Repository branch for ``pyAMReX_amrex_repo``
Expand Down

0 comments on commit 64e1c06

Please sign in to comment.