Skip to content

Commit abd38a8

Browse files
[NFC][CMake] Create libsycl-devicelib-host archive only as needed (#7886)
Use an add_custom_target/command pair to avoid re-running llvm-ar repeatedly on incremental builds.
1 parent a46efa0 commit abd38a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libdevice/cmake/modules/SYCLLibdevice.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ add_custom_target(imf_fp32_host_obj DEPENDS ${obj_binary_dir}/imf-fp32-host.${li
300300
add_custom_target(imf_fp64_host_obj DEPENDS ${obj_binary_dir}/imf-fp64-host.${lib-suffix})
301301
add_custom_target(imf_bf16_host_obj DEPENDS ${obj_binary_dir}/imf-bf16-host.${lib-suffix})
302302

303-
add_custom_target(imf_host_obj
303+
add_custom_target(imf_host_obj DEPENDS ${obj_binary_dir}/${devicelib_host_static})
304+
add_custom_command(OUTPUT ${obj_binary_dir}/${devicelib_host_static}
304305
COMMAND ${llvm-ar} rcs ${obj_binary_dir}/${devicelib_host_static}
305306
${obj_binary_dir}/imf-fp32-host.${lib-suffix}
306307
${obj_binary_dir}/fallback-imf-fp32-host.${lib-suffix}

0 commit comments

Comments
 (0)