Skip to content

Commit 591f515

Browse files
committed
cmake: clean up generated files pre build
1 parent e116f59 commit 591f515

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

examples/server/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ endforeach()
3434
add_executable(${TARGET} ${TARGET_SRCS})
3535
install(TARGETS ${TARGET} RUNTIME)
3636

37+
# clean up generated files in pre-build step
38+
foreach(asset ${PUBLIC_ASSETS})
39+
set(output "${CMAKE_CURRENT_BINARY_DIR}/${asset}.hpp")
40+
add_custom_command(TARGET ${TARGET} PRE_BUILD
41+
COMMAND "${CMAKE_COMMAND}" -E remove -f "${output}"
42+
)
43+
endforeach()
44+
3745
target_link_libraries(${TARGET} PRIVATE common ${CMAKE_THREAD_LIBS_INIT})
3846

3947
if (LLAMA_SERVER_SSL)

0 commit comments

Comments
 (0)