Skip to content

Commit

Permalink
CMake: Build gammaray_common_internal and gammaray_lz4 as OBJECTs
Browse files Browse the repository at this point in the history
This allows avoid installation and export of these intermediate
libraries when building the STATIC probe.
  • Loading branch information
Kentzo authored and redstrate committed Mar 21, 2024
1 parent 123abd4 commit 3fb14e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ configure_file(
)

add_library(
gammaray_lz4 STATIC
gammaray_lz4 OBJECT
${CMAKE_SOURCE_DIR}/3rdparty/lz4/lz4.c
)
set_target_properties(gammaray_lz4 PROPERTIES POSITION_INDEPENDENT_CODE ON)
Expand Down Expand Up @@ -101,7 +101,7 @@ target_link_libraries(
)
target_link_libraries(
gammaray_common
PRIVATE gammaray_lz4 gammaray_kitemmodels ${CMAKE_DL_LIBS}
PRIVATE $<BUILD_INTERFACE:gammaray_lz4> gammaray_kitemmodels ${CMAKE_DL_LIBS}
)
gammaray_set_rpath(gammaray_common ${LIB_INSTALL_DIR})
if(GAMMARAY_USE_PCH)
Expand Down Expand Up @@ -144,7 +144,7 @@ set(gammaray_common_internal_srcs
)

add_library(
gammaray_common_internal STATIC
gammaray_common_internal OBJECT
${gammaray_common_internal_srcs}
)
set_target_properties(gammaray_common_internal PROPERTIES POSITION_INDEPENDENT_CODE ON)
Expand Down
2 changes: 1 addition & 1 deletion core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ target_include_directories(
target_link_libraries(
gammaray_core
PUBLIC gammaray_common
PRIVATE gammaray_common_internal
PRIVATE $<BUILD_INTERFACE:gammaray_common_internal>
gammaray_kitemmodels
${CMAKE_DL_LIBS}
Qt::CorePrivate
Expand Down
4 changes: 2 additions & 2 deletions ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ target_include_directories(
target_link_libraries(
gammaray_ui
PUBLIC Qt::Core Qt::Gui Qt::Widgets gammaray_common
PRIVATE gammaray_common_internal gammaray_kitemmodels Qt::WidgetsPrivate
PRIVATE $<BUILD_INTERFACE:gammaray_common_internal> gammaray_kitemmodels Qt::WidgetsPrivate
)
if(TARGET KF${QtCore_VERSION_MAJOR}::SyntaxHighlighting)
target_link_libraries(gammaray_ui PRIVATE KF${QtCore_VERSION_MAJOR}::SyntaxHighlighting)
Expand Down Expand Up @@ -226,7 +226,7 @@ target_link_libraries(
Qt::Gui
Qt::Widgets
Qt::GuiPrivate
gammaray_common_internal
$<BUILD_INTERFACE:gammaray_common_internal>
gammaray_ui
gammaray_kitemmodels
)
Expand Down

0 comments on commit 3fb14e9

Please sign in to comment.