Add FREEECAD_USE_CCACHE cmake option

Defaults to ON except for conda compilation on windows
This commit is contained in:
Adrián Insaurralde Avalos
2023-07-17 22:28:54 -04:00
committed by Adrián Insaurralde Avalos
parent 77805b5373
commit 1d7fb46f89
2 changed files with 10 additions and 3 deletions

View File

@@ -10,9 +10,11 @@ if (POLICY CMP0072)
set(OpenGL_GL_PREFERENCE LEGACY) set(OpenGL_GL_PREFERENCE LEGACY)
endif(POLICY CMP0072) endif(POLICY CMP0072)
find_program(CCACHE_PROGRAM ccache) #This check should occur before project() if(FREECAD_USE_CCACHE)
if(CCACHE_PROGRAM) find_program(CCACHE_PROGRAM ccache) #This check should occur before project()
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") if(CCACHE_PROGRAM)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif()
endif() endif()
project(FreeCAD) project(FreeCAD)

View File

@@ -20,6 +20,11 @@ macro(InitializeFreeCADBuildOptions)
else() else()
option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." ON) option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." ON)
endif() endif()
if (BUILD_WITH_CONDA AND WIN32)
option(FREECAD_USE_CCACHE "Auto detect and use ccache during compilation" OFF)
else()
option(FREECAD_USE_CCACHE "Auto detect and use ccache during compilation" ON)
endif()
# == Win32 is default behaviour use the LibPack copied in Source tree ========== # == Win32 is default behaviour use the LibPack copied in Source tree ==========
if(MSVC) if(MSVC)