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

Aaron Puchert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 13:32:45 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG1c1a81055807: libclc: Use find_package to find Python 3 and require it (authored by aaronpuchert).

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.295664.patch
Type: text/x-patch
Size: 983 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201001/09a2ff6b/attachment.bin>


More information about the llvm-commits mailing list