diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index 20276a034d50..89f584c5dcea 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -560,7 +560,12 @@ add_subdirectory(tools) add_subdirectory(runtime) option(CLANG_BUILD_EXAMPLES "Build CLANG example programs by default." OFF) -add_subdirectory(examples) +option(CLANG_INCLUDE_EXAMPLES + "Generate build targets for the Clang examples." + ${LLVM_INCLUDE_EXAMPLES}) +if (CLANG_INCLUDE_EXAMPLES) + add_subdirectory(examples) +endif() if(APPLE) # this line is needed as a cleanup to ensure that any CMakeCaches with the old