Skip to content

Commit 67e530c

Browse files
committed
cmake: avoid cross-build ui helper target collision
1 parent f40e123 commit 67e530c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tools/ui/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,16 @@ if(CMAKE_CROSSCOMPILING)
5656
COMMENT "Building llama-ui-embed (host)"
5757
VERBATIM
5858
)
59-
add_custom_target(llama-ui-embed DEPENDS "${LLAMA_UI_EMBED_EXE}")
59+
add_custom_target(llama-ui-embed-host DEPENDS "${LLAMA_UI_EMBED_EXE}")
60+
set(LLAMA_UI_EMBED_TARGET llama-ui-embed-host)
6061
else()
6162
add_executable(llama-ui-embed embed.cpp)
6263
target_compile_features(llama-ui-embed PRIVATE cxx_std_17)
6364
set_target_properties(llama-ui-embed PROPERTIES
6465
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
6566
)
6667
set(LLAMA_UI_EMBED_EXE "$<TARGET_FILE:llama-ui-embed>")
68+
set(LLAMA_UI_EMBED_TARGET llama-ui-embed)
6769
endif()
6870

6971
# Run the provisioning script every build so source changes in tools/ui/ are
@@ -85,7 +87,7 @@ add_custom_target(llama-ui-assets ALL
8587
VERBATIM
8688
)
8789

88-
add_dependencies(llama-ui-assets llama-ui-embed)
90+
add_dependencies(llama-ui-assets ${LLAMA_UI_EMBED_TARGET})
8991

9092
set_source_files_properties(${UI_CPP} ${UI_H} PROPERTIES GENERATED TRUE)
9193

0 commit comments

Comments
 (0)