From ef0e1e771ee57612a836840c15b586a910cac139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Insaurralde=20Avalos?= Date: Mon, 17 Jul 2023 22:28:54 -0400 Subject: [PATCH] Add FREEECAD_USE_CCACHE cmake option Defaults to ON except for conda compilation on windows --- CMakeLists.txt | 8 +++++--- cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c42dbeea3..87b1f16c90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,9 +10,11 @@ if (POLICY CMP0072) set(OpenGL_GL_PREFERENCE LEGACY) endif(POLICY CMP0072) -find_program(CCACHE_PROGRAM ccache) #This check should occur before project() -if(CCACHE_PROGRAM) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") +if(FREECAD_USE_CCACHE) + find_program(CCACHE_PROGRAM ccache) #This check should occur before project() + if(CCACHE_PROGRAM) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") + endif() endif() project(FreeCAD) diff --git a/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake b/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake index 91ffb54f66..2558c5a65f 100644 --- a/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake +++ b/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake @@ -20,6 +20,11 @@ macro(InitializeFreeCADBuildOptions) else() option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." ON) 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 ========== if(MSVC)