[PATCH][CMAKE] llvm_add_library: enable explicit OBJECT "library" target

Axel Naumann via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 4 05:28:43 PST 2016


Hi,

Re-using llvm_add_library and trying to build a shared lib from a set of
static libs' .o-s I ran into a small limitation: I cannot tell
llvm_add_library to generate the OBJECT target. I really don't want to
build SHARED (which would be a work-around).

The attached, tiny patch allows me to write

add_clang_library(clingUtils WITHOBJECT
  AST.cpp
)

and in libcling.so's CMakeLists.txt:

set(SOURCES
  $<TARGET_OBJECTS:obj.clingInterpreter>
  $<TARGET_OBJECTS:obj.clingMetaProcessor>
  $<TARGET_OBJECTS:obj.clingUtils>
  )

Is this patch okay? (I might still have commit perms.)

Cheers, Axel.

--
ROOT - http://root.cern.ch
PH-SFT, CERN, 1211 Geneve 23, Switzerland
Tel: +41 22 7678225


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake_modules_AddLLVM_WITHOBJECT.diff
Type: text/x-patch
Size: 1020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160104/e840e4ba/attachment.bin>


More information about the llvm-commits mailing list