diff --git a/interpreter/cling/tools/plugins/clad/CMakeLists.txt b/interpreter/cling/tools/plugins/clad/CMakeLists.txt index 48aea31eec7b2..3f5d1b275fad8 100644 --- a/interpreter/cling/tools/plugins/clad/CMakeLists.txt +++ b/interpreter/cling/tools/plugins/clad/CMakeLists.txt @@ -100,14 +100,17 @@ endif() # list(APPEND _clad_patches_list "patch1.patch" "patch2.patch") #list(APPEND _clad_patches_list "nullptr_dereference_fix.patch" "windows_build_fix.patch") list(APPEND _clad_patches_list "lld_lookup_no_default_path.patch") -if (_clad_patches_list) +# An external clad source directory is used as is: it is expected to be +# already patched if necessary, and it might be read-only or not a git +# repository, so the patches cannot be applied to it anyway. +if (_clad_patches_list AND NOT DEFINED CLAD_SOURCE_DIR) set(_clad_patch_command ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/interpreter/cling/tools/plugins/clad/patches && git checkout -q && git apply --ignore-space-change --ignore-whitespace ${_clad_patches_list} ) -endif(_clad_patches_list) +endif(_clad_patches_list AND NOT DEFINED CLAD_SOURCE_DIR) ExternalProject_Add( clad