Skip to content

Commit 637457b

Browse files
committed
fix(cmake): use INTERFACE linkage for header-only utils
2 parents 94da4aa + 8e6bd15 commit 637457b

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,19 @@ if (NOT _VIX_FMT_TARGET)
201201
)
202202
endif()
203203

204-
target_link_libraries(vix_utils
205-
PUBLIC
206-
${_VIX_SPDLOG_TARGET}
207-
${_VIX_FMT_TARGET}
208-
)
204+
if (VIX_HEADER_ONLY)
205+
target_link_libraries(vix_utils
206+
INTERFACE
207+
${_VIX_SPDLOG_TARGET}
208+
${_VIX_FMT_TARGET}
209+
)
210+
else()
211+
target_link_libraries(vix_utils
212+
PUBLIC
213+
${_VIX_SPDLOG_TARGET}
214+
${_VIX_FMT_TARGET}
215+
)
216+
endif()
209217

210218
if (VIX_HEADER_ONLY)
211219
target_compile_definitions(vix_utils INTERFACE SPDLOG_FMT_EXTERNAL=1)

0 commit comments

Comments
 (0)