Skip to content

Commit ee9808d

Browse files
committed
[CMake] Fix installation without CLANG_BUILD_EXAMPLES
When CLANG_BUILD_EXAMPLES is not on we set the EXCLUDE_FROM_ALL directory property for the examples/ directory to tell CMake not to build them by default. The AddLLVM.cmake APIs are not aware of this and try to install targets that are not built. This does not cause an install-time error because CMake excludes the directory from the default installation. However, now that installation attaches targets to the LLVMExports export set CMake-based applications that find_package(LLVM) fail because the example plugin binary is not available. Tell the AddLLVM.cmake APIs to exclude the examples from installation by setting the EXCLUDE_FROM_ALL variable they check. Patch by Brad King! llvm-svn: 201799
1 parent e9391a5 commit ee9808d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/examples/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
if(NOT CLANG_BUILD_EXAMPLES)
22
set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL ON)
3+
set(EXCLUDE_FROM_ALL ON)
34
endif()
45

56
if(CLANG_ENABLE_STATIC_ANALYZER)

0 commit comments

Comments
 (0)