[PATCH] [CMake] Fix installation without CLANG_BUILD_EXAMPLES

Brad King brad.king at kitware.com
Thu Feb 20 09:35:14 PST 2014


On 02/20/2014 12:06 PM, Jordan Rose wrote:
> Nice catch. What made you decide to do this rather than change AddLLVM.cmake?

AFAICT this approach uses the AddLLVM APIs as designed.  They already
know not to install targets when EXCLUDE_FROM_ALL is enabled but were
not told about the setting in this case within Clang.

Those APIs test for a variable setting:

 if( EXCLUDE_FROM_ALL )

Some of them set it using hard-coded knowledge of internal LLVM
options:

  if( NOT LLVM_BUILD_EXAMPLES )
    set(EXCLUDE_FROM_ALL ON)
  endif()

to avoid requiring call sites inside LLVM's own code to set it.
Since LLVM APIs cannot encode knowledge of all consumers, such as
CLANG_BUILD_EXAMPLES, the consumers need to set EXCLUDE_FROM_ALL
instead.

-Brad




More information about the cfe-commits mailing list