Skip to content

Commit 4f37872

Browse files
authored
Fix Python (google#1401)
1 parent f50d674 commit 4f37872

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

CMakeLists.txt

+4-8
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,18 @@ if (COMPILER_SUPPORTS_EXTRA_SEMI_WARNING)
9191
add_compile_options("-Wextra-semi")
9292
endif()
9393

94-
if(${CMAKE_VERSION} VERSION_LESS_EQUAL "3.12")
95-
find_package(PythonInterp 3 REQUIRED)
96-
else ()
97-
find_package(Python COMPONENTS Interpreter REQUIRED)
98-
endif ()
94+
find_package(Python COMPONENTS Interpreter REQUIRED)
9995

10096
if (SHADERC_ENABLE_COPYRIGHT_CHECK)
10197
add_custom_target(check-copyright ALL
102-
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/utils/add_copyright.py
98+
${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/utils/add_copyright.py
10399
--check
104100
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
105101
COMMENT "Check copyright")
106102
endif()
107103

108104
add_custom_target(add-copyright
109-
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/utils/add_copyright.py
105+
${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/utils/add_copyright.py
110106
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
111107
COMMENT "Add copyright")
112108

@@ -134,7 +130,7 @@ if(${SHADERC_ENABLE_EXAMPLES})
134130
endif()
135131

136132
add_custom_target(build-version
137-
${PYTHON_EXECUTABLE}
133+
${Python_EXECUTABLE}
138134
${CMAKE_CURRENT_SOURCE_DIR}/utils/update_build_version.py
139135
${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/build-version.inc
140136
COMMENT "Update build-version.inc in the Shaderc build directory (if necessary).")

cmake/setup_build.cmake

+1-5
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ if (ANDROID)
4949
find_host_package(PythonInterp 3 REQUIRED)
5050
find_host_package(BISON)
5151
else()
52-
if(${CMAKE_VERSION} VERSION_LESS_EQUAL "3.12")
53-
find_package(PythonInterp 3 REQUIRED)
54-
else ()
55-
find_package(Python COMPONENTS Interpreter REQUIRED)
56-
endif ()
52+
find_package(Python COMPONENTS Interpreter REQUIRED)
5753
endif()
5854

5955
option(DISABLE_RTTI "Disable RTTI in builds")

glslc/test/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
# limitations under the License.
1414

1515
add_test(NAME shaderc_expect_unittests
16-
COMMAND ${PYTHON_EXECUTABLE} -m unittest expect_unittest.py
16+
COMMAND ${Python_EXECUTABLE} -m unittest expect_unittest.py
1717
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
1818
add_test(NAME shaderc_glslc_test_framework_unittests
19-
COMMAND ${PYTHON_EXECUTABLE} -m unittest glslc_test_framework_unittest.py
19+
COMMAND ${Python_EXECUTABLE} -m unittest glslc_test_framework_unittest.py
2020
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
2121

2222
if(${SHADERC_ENABLE_TESTS})
2323
add_test(NAME glslc_tests
24-
COMMAND ${PYTHON_EXECUTABLE}
24+
COMMAND ${Python_EXECUTABLE}
2525
${CMAKE_CURRENT_SOURCE_DIR}/glslc_test_framework.py
2626
$<TARGET_FILE:glslc_exe> $<TARGET_FILE:spirv-dis>
2727
--test-dir ${CMAKE_CURRENT_SOURCE_DIR})

0 commit comments

Comments
 (0)