[llvm] r275008 - [cmake] Change lli-child-target to use add_llvm_utility instead of add_llvm_executable.

Michael Gottesman via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 9 19:43:50 PDT 2016


Author: mgottesman
Date: Sat Jul  9 21:43:50 2016
New Revision: 275008

URL: http://llvm.org/viewvc/llvm-project?rev=275008&view=rev
Log:
[cmake] Change lli-child-target to use add_llvm_utility instead of add_llvm_executable.

We are currently using add_llvm_utility for executable targets that:

1. Are built by default.
2. Used for testing.
3. Are not installed by default.

Originally, lli-child-target used add_llvm_tool instead of add_llvm_executable
directly. This was changed so that lli-child-target would not be installed. This
was good since this is only used for testing and should never be installed for
users. This also had the unfortunate side effect that one can never turn off the
building of lli-child-target by default, a regression for projects that by
default do not want to compile any LLVM tools beyond tablegen/llvm-config.

This patch changes lli-child-target to use add_llvm_utility. This makes sense
since:

1. lli-child-target matches the semantics of executables created with
add_llvm_utility.
2. We fix the regression since now one can use the flag LLVM_BUILD_UTILS to
eliminate default compilation.

Modified:
    llvm/trunk/tools/lli/CMakeLists.txt
    llvm/trunk/tools/lli/ChildTarget/CMakeLists.txt

Modified: llvm/trunk/tools/lli/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/CMakeLists.txt?rev=275008&r1=275007&r2=275008&view=diff
==============================================================================
--- llvm/trunk/tools/lli/CMakeLists.txt (original)
+++ llvm/trunk/tools/lli/CMakeLists.txt Sat Jul  9 21:43:50 2016
@@ -1,4 +1,6 @@
-add_subdirectory(ChildTarget)
+if ( LLVM_INCLUDE_UTILS )
+  add_subdirectory(ChildTarget)
+endif()
 
 set(LLVM_LINK_COMPONENTS
   CodeGen

Modified: llvm/trunk/tools/lli/ChildTarget/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/ChildTarget/CMakeLists.txt?rev=275008&r1=275007&r2=275008&view=diff
==============================================================================
--- llvm/trunk/tools/lli/ChildTarget/CMakeLists.txt (original)
+++ llvm/trunk/tools/lli/ChildTarget/CMakeLists.txt Sat Jul  9 21:43:50 2016
@@ -4,8 +4,7 @@ set(LLVM_LINK_COMPONENTS
   Support
   )
 
-add_llvm_executable(lli-child-target
+add_llvm_utility(lli-child-target
   ChildTarget.cpp
 )
 
-set_target_properties(lli-child-target PROPERTIES FOLDER "Misc")




More information about the llvm-commits mailing list