Skip to content

Commit

Permalink
Extract ocloc binary name
Browse files Browse the repository at this point in the history
At some point ocloc was renamed, also fix tools substitution
  • Loading branch information
fveselov authored and igcbot committed Jul 16, 2024
1 parent 3ad9e4a commit bdd9896
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion IGC/ocloc_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#=========================== begin_copyright_notice ============================
#
# Copyright (C) 2023 Intel Corporation
# Copyright (C) 2023-2024 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
Expand All @@ -18,6 +18,7 @@ endif()
set(IGC_OCLOC_TEST_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(IGC_OCLOC_TEST_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

set(IGC_OCLOC_BINARY_NAME "$<$<TARGET_EXISTS:ocloc>:$<TARGET_FILE_BASE_NAME:ocloc>>")
set(IGC_OCLOC_BINARY_DIR "$<$<TARGET_EXISTS:ocloc>:$<TARGET_FILE_DIR:ocloc>>")
set(IGC_BUILD__PROJ__ocloc "$<$<TARGET_EXISTS:ocloc>:ocloc>")
set(IGC_OCLOC_LIBRARY_DIR "$<$<TARGET_EXISTS:ocloc_lib>:$<TARGET_FILE_DIR:ocloc_lib>>")
Expand Down
6 changes: 3 additions & 3 deletions IGC/ocloc_tests/lit.cfg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ========================== begin_copyright_notice ============================
#
# Copyright (C) 2023 Intel Corporation
# Copyright (C) 2023-2024 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
Expand Down Expand Up @@ -42,10 +42,10 @@

tool_dirs = [config.ocloc_dir, config.llvm_tools_dir, config.spirv_as_dir, config.llvm_spirv_dir]

if llvm_config.add_tool_substitutions([ToolSubst('ocloc', unresolved='break')], tool_dirs) :
if llvm_config.add_tool_substitutions([ToolSubst('ocloc', command=FindTool(config.ocloc_name), unresolved='break')], tool_dirs) :
ocloc_path = llvm_config.config.substitutions[-1][1]
else :
lit_config.note('Did not find ocloc in %s, ocloc will be used from system paths' % tool_dirs)
lit_config.note('Did not find %s in %s, ocloc will be used from system paths' % (config.ocloc_name, tool_dirs))
ocloc_path = 'ocloc'

llvm_config.add_tool_substitutions([ToolSubst('llvm-dwarfdump')], tool_dirs)
Expand Down
3 changes: 2 additions & 1 deletion IGC/ocloc_tests/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ========================== begin_copyright_notice ============================
#
# Copyright (C) 2023 Intel Corporation
# Copyright (C) 2023-2024 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
Expand All @@ -17,6 +17,7 @@ config.target_triple = "@TARGET_TRIPLE@"
config.host_arch = "@HOST_ARCH@"
config.python_executable = "@PYTHON_EXECUTABLE@"
config.test_run_dir = "@CMAKE_CURRENT_BINARY_DIR@"
config.ocloc_name = "@IGC_OCLOC_BINARY_NAME@"
config.ocloc_dir = "@IGC_OCLOC_BINARY_DIR@"
config.ocloc_lib_dir = "@IGC_OCLOC_LIBRARY_DIR@"
config.igc_lib_dir = "@IGC_LIBRARY_DIR@"
Expand Down

0 comments on commit bdd9896

Please sign in to comment.