Skip to content

[UR] Add generated lit files to the LLVM_LIT_CONFIG_FILES list #18776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions unified-runtime/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,17 @@ enable_testing()
# It is found here for use in `lit.site.cfg.py.in`, which is inherited by said testing.
find_program(VALGRIND valgrind)

function(ur_configure_file input output main_file)
configure_file(${input} ${output} @ONLY)
if(NOT UR_STANDALONE_BUILD)
get_property(LLVM_LIT_CONFIG_FILES GLOBAL PROPERTY LLVM_LIT_CONFIG_FILES)
list(APPEND LLVM_LIT_CONFIG_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${main_file}" "${CMAKE_CURRENT_BINARY_DIR}/${output}")
set_property(GLOBAL PROPERTY LLVM_LIT_CONFIG_FILES ${LLVM_LIT_CONFIG_FILES})
endif()
endfunction()

# Set up the root `check-unified-runtime` target
configure_file(lit.site.cfg.py.in lit.site.cfg.py)
ur_configure_file(lit.site.cfg.py.in lit.site.cfg.py lit.cfg.py)
add_custom_target(deps_check-unified-runtime)
if(UR_STANDALONE_BUILD)
add_custom_target(check-unified-runtime
Expand Down Expand Up @@ -60,7 +69,7 @@ function(add_ur_lit_testsuite suite)
set(TARGET "check-unified-runtime-${suite}")

if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in)
configure_file(lit.site.cfg.py.in lit.site.cfg.py)
ur_configure_file(lit.site.cfg.py.in lit.site.cfg.py lit.cfg.py)
endif()

if(UR_STANDALONE_BUILD)
Expand Down