Avoid intermediate object library
Object libraries are weird, and producing a library by using the target objects from them doesn't automatically import the interface properties of the linked targets. These object libraries only have single uses, so just directly create the final library from the sources. Leaves libelf as an object library, since there seems to be some cmake oddity when trying to link an unexported target to an exported one. Change-Id: Ic379612c89340c40085c9862cfe111fa4bbff425
This commit is contained in:
zatwierdzone przez
Matthew Arsenault
rodzic
2963d0d454
commit
cba7a4d20e
@@ -6,9 +6,7 @@ file(GLOB sources
|
||||
)
|
||||
|
||||
add_library(oclelf_obj OBJECT ${sources})
|
||||
add_library(oclelf STATIC $<TARGET_OBJECTS:oclelf_obj>)
|
||||
set_target_properties(oclelf_obj PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
set_target_properties(oclelf PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
target_include_directories(oclelf_obj
|
||||
PRIVATE
|
||||
@@ -18,8 +16,4 @@ target_include_directories(oclelf_obj
|
||||
|
||||
target_compile_definitions(oclelf_obj
|
||||
PUBLIC
|
||||
BSD_LIBELF USE_MEMFILE)
|
||||
|
||||
target_compile_definitions(oclelf
|
||||
PUBLIC
|
||||
BSD_LIBELF USE_MEMFILE)
|
||||
BSD_LIBELF USE_MEMFILE)
|
||||
|
||||
Reference in New Issue
Block a user