[PATCH] D88366: libclc: Use find_package to find python and require it

Aaron Puchert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 13:59:56 PDT 2020


aaronpuchert updated this revision to Diff 295403.
aaronpuchert added a comment.

Use FindPython3 and remove shebang. The script didn't have an executable bit anyway.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88366/new/

https://reviews.llvm.org/D88366

Files:
  libclc/CMakeLists.txt
  libclc/generic/lib/gen_convert.py


Index: libclc/generic/lib/gen_convert.py
===================================================================
--- libclc/generic/lib/gen_convert.py
+++ libclc/generic/lib/gen_convert.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
 # OpenCL built-in library: type conversion functions
 #
 # Copyright (c) 2013 Victor Oliveira <victormatheus at gmail.com>
Index: libclc/CMakeLists.txt
===================================================================
--- libclc/CMakeLists.txt
+++ libclc/CMakeLists.txt
@@ -184,11 +184,11 @@
 		DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
 endif()
 
-find_program( PYTHON python )
+find_package( Python3 REQUIRED COMPONENTS Interpreter )
 file( TO_CMAKE_PATH ${CMAKE_SOURCE_DIR}/generic/lib/gen_convert.py script_loc )
 add_custom_command(
 	OUTPUT convert.cl
-	COMMAND ${PYTHON} ${script_loc} > convert.cl
+	COMMAND ${Python3_EXECUTABLE} ${script_loc} > convert.cl
 	DEPENDS ${script_loc} )
 add_custom_target( "generate_convert.cl" DEPENDS convert.cl )
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88366.295403.patch
Type: text/x-patch
Size: 983 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200930/2244c463/attachment.bin>


More information about the llvm-commits mailing list