Add build option CLANG_INCLUDE_EXAMPLES (#187317)

Adds a new build option for clang, CLANG_INCLUDE_EXAMPLES, which
controls if the examples directory is included in the build. It defaults
to the value for LLVM_INCLUDE_EXAMPLES (same as CLANG_INCLUDE_DOCS and
CLANG_INCLUDE_TESTS)

Signed-off-by: Jade Abraham <jademabraham17@gmail.com>
This commit is contained in:
Jade Abraham 2026-07-10 19:27:34 -07:00 committed by GitHub
parent 43ef833f39
commit a1feacb3e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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