[llvm] r257459 - Explicitly enable OBJECT library "target".
Axel Naumann via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 11 23:44:59 PST 2016
Author: axel
Date: Tue Jan 12 01:44:58 2016
New Revision: 257459
URL: http://llvm.org/viewvc/llvm-project?rev=257459&view=rev
Log:
Explicitly enable OBJECT library "target".
With this, one can build a lib from the objects of other libs:
set(SOURCES
$<TARGET_OBJECTS:obj.clingInterpreter>
$<TARGET_OBJECTS:obj.clingMetaProcessor>
$<TARGET_OBJECTS:obj.clingUtils>
)
Reviewed by Chris Bieneman - thanks!
Modified:
llvm/trunk/cmake/modules/AddLLVM.cmake
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=257459&r1=257458&r2=257459&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Tue Jan 12 01:44:58 2016
@@ -308,6 +308,8 @@ endfunction(set_windows_version_resource
# SHARED;STATIC
# STATIC by default w/o BUILD_SHARED_LIBS.
# SHARED by default w/ BUILD_SHARED_LIBS.
+# OBJECT
+# Also create an OBJECT library target. Default if STATIC && SHARED.
# MODULE
# Target ${name} might not be created on unsupported platforms.
# Check with "if(TARGET ${name})".
@@ -329,7 +331,7 @@ endfunction(set_windows_version_resource
# )
function(llvm_add_library name)
cmake_parse_arguments(ARG
- "MODULE;SHARED;STATIC;DISABLE_LLVM_LINK_LLVM_DYLIB;SONAME"
+ "MODULE;SHARED;STATIC;OBJECT;DISABLE_LLVM_LINK_LLVM_DYLIB;SONAME"
"OUTPUT_NAME"
"ADDITIONAL_HEADERS;DEPENDS;LINK_COMPONENTS;LINK_LIBS;OBJLIBS"
${ARGN})
@@ -362,7 +364,7 @@ function(llvm_add_library name)
endif()
# Generate objlib
- if(ARG_SHARED AND ARG_STATIC)
+ if((ARG_SHARED AND ARG_STATIC) OR ARG_OBJECT)
# Generate an obj library for both targets.
set(obj_name "obj.${name}")
add_library(${obj_name} OBJECT EXCLUDE_FROM_ALL
More information about the llvm-commits
mailing list