Skip to content

Commit

Permalink
Deduplicate definition of the list of object libraries to link.
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-tsirpanis committed Nov 2, 2023
1 parent c7568a3 commit 2032a6f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions tiledb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -411,16 +411,22 @@ add_library(TILEDB_CORE_OBJECTS OBJECT
${TILEDB_EXTERNALS_SOURCES}
)

# List of libraries to be linked to TILEDB_CORE_OBJECTS and TILEDB_CORE_OBJECTS_STATIC.
set(TILEDB_CORE_OBJECTS_LIBS
baseline
)

list(TRANSFORM TILEDB_CORE_OBJECTS_LIBS PREPEND "$<TARGET_OBJECTS:" OUTPUT_VARIABLE TILEDB_CORE_OBJECTS_LIBS_SOURCES)
list(TRANSFORM TILEDB_CORE_OBJECTS_LIBS_SOURCES APPEND ">" OUTPUT_VARIABLE TILEDB_CORE_OBJECTS_LIBS_SOURCES)

target_sources(TILEDB_CORE_OBJECTS
PUBLIC
$<TARGET_OBJECTS:baseline>
${TILEDB_CORE_OBJECTS_LIBS_SOURCES}
)

target_link_libraries(TILEDB_CORE_OBJECTS
PRIVATE
common
PUBLIC
baseline
${TILEDB_CORE_OBJECTS_LIBS}
)

target_link_libraries(TILEDB_CORE_OBJECTS INTERFACE object_store_definitions)
Expand Down Expand Up @@ -475,11 +481,12 @@ if (WIN32 AND TILEDB_STATIC)

target_sources(TILEDB_CORE_OBJECTS_STATIC
PUBLIC
$<TARGET_OBJECTS:baseline>)
${TILEDB_CORE_OBJECTS_LIBS_SOURCES}
)

target_link_libraries(TILEDB_CORE_OBJECTS_STATIC
PUBLIC
baseline
${TILEDB_CORE_OBJECTS_LIBS}
)

target_compile_definitions(TILEDB_CORE_OBJECTS_STATIC
Expand Down

0 comments on commit 2032a6f

Please sign in to comment.