Skip to content

Commit 7b4ca1e

Browse files
committed
rewrite generate_offload_arch script in Python
The change is required to make the script run on Windows. There is no bash shell on Windows. The alternatives (like MSYS2, Cygwin, etc.) pollute the build environment with GNU tools and libraries, which are picked up automatically, making native Windows build impossible.
1 parent 5f0b8ea commit 7b4ca1e

File tree

4 files changed

+194
-665
lines changed

4 files changed

+194
-665
lines changed

llvm/lib/OffloadArch/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
find_package(Python3 REQUIRED COMPONENTS Interpreter)
2+
13
add_custom_command(
24
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated_offload_arch.h
3-
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/make_generated_offload_arch_h.sh ${CMAKE_CURRENT_SOURCE_DIR}
5+
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/make_generated_offload_arch_h.py ${CMAKE_CURRENT_SOURCE_DIR}
46
DEPENDS
5-
${CMAKE_CURRENT_SOURCE_DIR}/make_generated_offload_arch_h.sh
7+
${CMAKE_CURRENT_SOURCE_DIR}/make_generated_offload_arch_h.py
68
${CMAKE_CURRENT_SOURCE_DIR}/amdgpu/pciid2codename.txt
79
${CMAKE_CURRENT_SOURCE_DIR}/amdgpu/codename2offloadarch.txt
810
${CMAKE_CURRENT_SOURCE_DIR}/nvidia/pciid2codename.txt

0 commit comments

Comments
 (0)