llvm.org GIT mirror llvm / 76b8ab5
[cmake] Create the LLVM_BUILD_UTILS option. This option is the equivalent option to LLVM_BUILD_TOOLS but for executables created via add_llvm_utility. This is a useful tool for improving compile time in situations where LLVM is used as a library and no testing tools are needed. It follows the exact same implemention model as LLVM_BUILD_TOOLS. Since the option is by default set to on, no behavior is changed unless one sets it from the command line to be false. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275007 91177308-0d34-0410-b5e6-96231b3b80d8 Michael Gottesman 4 years ago
2 changed file(s) with 9 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
390390 "Build the LLVM tools. If OFF, just generate build targets." ON)
391391
392392 option(LLVM_INCLUDE_UTILS "Generate build targets for the LLVM utils." ON)
393 option(LLVM_BUILD_UTILS
394 "Build LLVM utility binaries. If OFF, just generate build targets." ON)
393395
394396 option(LLVM_BUILD_RUNTIME
395397 "Build the LLVM runtime libraries." ON)
799799 set_target_properties(${name} PROPERTIES FOLDER "Examples")
800800 endmacro(add_llvm_example name)
801801
802
802 # This is a macro that is used to create targets for executables that are needed
803 # for development, but that are not intended to be installed by default.
803804 macro(add_llvm_utility name)
805 if ( NOT LLVM_BUILD_UTILS )
806 set(EXCLUDE_FROM_ALL ON)
807 endif()
808
804809 add_llvm_executable(${name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN})
805810 set_target_properties(${name} PROPERTIES FOLDER "Utils")
806 if( LLVM_INSTALL_UTILS )
811 if( LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS )
807812 install (TARGETS ${name}
808813 RUNTIME DESTINATION bin
809814 COMPONENT ${name})