mirror of
https://github.com/google/benchmark.git
synced 2024-12-26 12:30:14 +08:00
Do not depend on unversioned python binary (#1496)
Some linux distributions no longer provide `python` binary and require usage of `python3` instead. This changes the scripts here and uses cmake `find_package(Python3` when running python. Co-authored-by: Dominic Hamon <dominichamon@users.noreply.github.com>
This commit is contained in:
parent
12e0d70a43
commit
229bc5a937
@ -332,6 +332,7 @@ include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||
add_subdirectory(src)
|
||||
|
||||
if (BENCHMARK_ENABLE_TESTING)
|
||||
find_package(Python3 3.6 REQUIRED COMPONENTS Interpreter)
|
||||
enable_testing()
|
||||
if (BENCHMARK_ENABLE_GTEST_TESTS AND
|
||||
NOT (TARGET gtest AND TARGET gtest_main AND
|
||||
|
@ -47,7 +47,7 @@ macro(add_filecheck_test name)
|
||||
set_target_properties(${name} PROPERTIES COMPILE_FLAGS "-S ${ASM_TEST_FLAGS}")
|
||||
set(ASM_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${name}.s")
|
||||
add_custom_target(copy_${name} ALL
|
||||
COMMAND ${PROJECT_SOURCE_DIR}/tools/strip_asm.py
|
||||
COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/strip_asm.py
|
||||
$<TARGET_OBJECTS:${name}>
|
||||
${ASM_OUTPUT_FILE}
|
||||
BYPRODUCTS ${ASM_OUTPUT_FILE})
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import unittest
|
||||
"""
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
strip_asm.py - Cleanup ASM output for the specified file
|
||||
|
Loading…
Reference in New Issue
Block a user