Skip to content

Commit 1538bb7

Browse files
committed
Fix python build by linking fmt when KOMPUTE_OPT_LOG_LEVEL_DISABLED
Signed-off-by: Zachary Ferguson <zach.ferguson@clo3d.com>
1 parent 7b37a7b commit 1538bb7

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ else()
169169
endif()
170170

171171
# Spdlog
172-
if(KOMPUTE_OPT_USE_SPDLOG)
172+
if(NOT KOMPUTE_OPT_LOG_LEVEL_DISABLED AND KOMPUTE_OPT_USE_SPDLOG)
173173
add_compile_definitions(KOMPUTE_OPT_USE_SPDLOG=1)
174174

175175
if(KOMPUTE_OPT_USE_BUILT_IN_SPDLOG)

src/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ else()
7474
kp_shader)
7575
endif()
7676

77+
# If OPT_LOG_LEVEL is disabled, kp_logger wont link against fmt::fmt, but we
78+
# still need it for non-logging utilities. Therefore, explicitly link fmt::fmt
79+
# to kompute target.
80+
if(KOMPUTE_OPT_LOG_LEVEL_DISABLED)
81+
if(KOMPUTE_OPT_USE_SPDLOG)
82+
message(FATAL_ERROR "KOMPUTE_OPT_LOG_LEVEL_DISABLED is incompatible with KOMPUTE_OPT_USE_SPDLOG. To continue set either one option to 'OFF'.")
83+
else()
84+
target_link_libraries(kompute PUBLIC fmt::fmt)
85+
endif()
86+
endif()
87+
7788
if(KOMPUTE_OPT_BUILD_PYTHON)
7889
include_directories(${PYTHON_INCLUDE_DIRS})
7990

0 commit comments

Comments
 (0)