Skip to content

Commit bf715a9

Browse files
authored
Subject: cmake: Allow one to select python3 from env (#1946)
This will be useful for next debian release shipping python3 Version can be specified as cmake option using: CMAKE_OPTIONS=-DPYTHON="python3" Bug: #1945 Bug-Debian: https://bugs.debian.org/936738 Forwarded: #1946 Change-Id: Ie3a9e8ea9152247efa85a4e87bd121016a466795 Origin: https://github.com/TizenTeam/iotjs/tree/sandbox/rzr/python/review/master Relate-to: https://travis-ci.org/github/TizenTeam/iotjs/builds/712336077 IoT.js-DCO-1.0-Signed-off-by: Philippe Coval [email protected]
1 parent 4ec6746 commit bf715a9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/iotjs.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
cmake_minimum_required(VERSION 2.8)
1616

17+
if(NOT DEFINED PYTHON)
18+
set(PYTHON "python")
19+
endif()
20+
1721
include(${CMAKE_CURRENT_LIST_DIR}/JSONParser.cmake)
1822

1923
set(IOTJS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src)
@@ -378,7 +382,7 @@ add_custom_command(
378382
COMMAND ${CMAKE_C_COMPILER} ${JS2C_PREPROCESS_ARGS} ${IOTJS_MODULE_DEFINES}
379383
${IOTJS_SOURCE_DIR}/iotjs_magic_strings.h
380384
> ${IOTJS_SOURCE_DIR}/iotjs_magic_strings.in
381-
COMMAND python ${ROOT_DIR}/tools/js2c.py
385+
COMMAND ${PYTHON} ${ROOT_DIR}/tools/js2c.py
382386
ARGS --buildtype=${JS2C_RUN_MODE}
383387
--modules "${IOTJS_JS_MODULES_STR}"
384388
${JS2C_SNAPSHOT_ARG}

0 commit comments

Comments
 (0)