mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-03-14 20:27:24 +00:00
Support static builds of nvbench with nvml enabled.
To do this we need to ensure that the nvml init handler is both contained in the library/executable that uses nvbench. The original implementation fails since the singleton can be dropped since it has no usages. So instead we move to a function static which we ensure will always be used.
This commit is contained in:
@@ -21,6 +21,18 @@ macro(nvbench_generate_exports)
|
||||
)
|
||||
endif()
|
||||
|
||||
if (TARGET nvbench_json)
|
||||
set(nvbench_json_code_block
|
||||
[=[
|
||||
add_library(nvbench_json INTERFACE IMPORTED)
|
||||
if (TARGET nlohmann_json::nlohmann_json)
|
||||
target_link_libraries(nvbench_json INTERFACE nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
]=])
|
||||
string(APPEND nvbench_build_export_code_block ${nvbench_json_code_block})
|
||||
string(APPEND nvbench_install_export_code_block ${nvbench_json_code_block})
|
||||
endif()
|
||||
|
||||
rapids_export(BUILD NVBench
|
||||
EXPORT_SET nvbench-targets
|
||||
NAMESPACE "nvbench::"
|
||||
|
||||
Reference in New Issue
Block a user