Summary:
Since these files depend on the built python modules, they need to use
the right python binary to run them. So use configure_file
to set the right shebang line.
Patch By: cbiesinger (Christian Biesinger)
Reviewers: chandlerc, beanz, anemet
Reviewed By: anemet
Subscribers: compnerd, JDevlieghere, mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65983
llvm-svn: 369486
message(FATAL_ERROR "Python 2.7 or newer is required")
endif()
+get_filename_component(PYTHON_BASENAME ${PYTHON_EXECUTABLE} NAME)
+
######
# LLVMBuild Integration
#
set (files
+ "optpmap.py"
+ "style.css")
+
+set (generated_files
"opt-diff.py"
"opt-stats.py"
"opt-viewer.py"
- "optpmap.py"
- "optrecord.py"
- "style.css")
+ "optrecord.py")
+
+foreach (file ${generated_files})
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/${file}.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${file})
+endforeach (file)
foreach (file ${files})
install(PROGRAMS ${file}
DESTINATION share/opt-viewer
COMPONENT opt-viewer)
endforeach (file)
+
+
+foreach (file ${generated_files})
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${file}
+ DESTINATION share/opt-viewer
+ COMPONENT opt-viewer)
+endforeach (file)
-#!/usr/bin/env python
+#!/usr/bin/env @PYTHON_BASENAME@
from __future__ import print_function
-#!/usr/bin/env python
+#!/usr/bin/env @PYTHON_BASENAME@
from __future__ import print_function
-#!/usr/bin/env python
+#!/usr/bin/env @PYTHON_BASENAME@
from __future__ import print_function
-#!/usr/bin/env python
+#!/usr/bin/env @PYTHON_BASENAME@
from __future__ import print_function