summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Kent <wjk011@gmail.com>2022-12-13 13:27:24 -0500
committerGitHub <noreply@github.com>2022-12-13 19:27:24 +0100
commit089927e0a7082887304a8d8ed8c122e8615d9cf1 (patch)
tree833a389387aafd780d4dbff71484c76897396337
parentc6e002d86d6657f18dd772c8138454291becf885 (diff)
downloadninja-089927e0a7082887304a8d8ed8c122e8615d9cf1.tar.gz
Add overridable parameter for name of Python binary (#2224)
* Add overridable parameter for name of Python binary On macOS, python is not an available command any more. python3 is. * Use option() as requested * Store variable in different way
-rw-r--r--CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76bfb62..98f7948 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -90,6 +90,8 @@ function(check_platform_supports_browse_mode RESULT)
endfunction()
+set(NINJA_PYTHON "python" CACHE STRING "Python interpreter to use for the browse tool")
+
check_platform_supports_browse_mode(platform_supports_ninja_browse)
# Core source files all build into ninja library.
@@ -195,7 +197,7 @@ if(platform_supports_ninja_browse)
PROPERTIES
OBJECT_DEPENDS "${PROJECT_BINARY_DIR}/build/browse_py.h"
INCLUDE_DIRECTORIES "${PROJECT_BINARY_DIR}"
- COMPILE_DEFINITIONS NINJA_PYTHON="python"
+ COMPILE_DEFINITIONS NINJA_PYTHON="${NINJA_PYTHON}"
)
endif()