Anas Nashif | 3ae5262 | 2019-04-06 09:08:09 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | |
Carles Cufi | 1630292 | 2019-07-25 11:37:32 +0200 | [diff] [blame] | 3 | # On Windows, instruct Python to output UTF-8 even when not |
| 4 | # interacting with a terminal. This is required since Python scripts |
| 5 | # are invoked by CMake code and, on Windows, standard I/O encoding defaults |
| 6 | # to the current code page if not connected to a terminal, which is often |
| 7 | # not what we want. |
| 8 | if (WIN32) |
| 9 | set(ENV{PYTHONIOENCODING} "utf-8") |
| 10 | endif() |
| 11 | |
Mark Ruvald Pedersen | 55d6b4c | 2018-11-26 23:39:51 +0100 | [diff] [blame] | 12 | # The 'FindPythonInterp' that is distributed with CMake 3.8 has a bug |
| 13 | # that we need to work around until we upgrade to 3.13. Until then we |
| 14 | # maintain a patched copy in our repo. Bug: |
| 15 | # https://github.com/zephyrproject-rtos/zephyr/issues/11103 |
Martí Bolívar | 77502545 | 2019-12-05 10:20:08 -0800 | [diff] [blame] | 16 | set(PythonInterp_FIND_VERSION 3.6) |
Mark Ruvald Pedersen | 55d6b4c | 2018-11-26 23:39:51 +0100 | [diff] [blame] | 17 | set(PythonInterp_FIND_VERSION_COUNT 2) |
| 18 | set(PythonInterp_FIND_VERSION_MAJOR 3) |
Martí Bolívar | 77502545 | 2019-12-05 10:20:08 -0800 | [diff] [blame] | 19 | set(PythonInterp_FIND_VERSION_MINOR 6) |
Mark Ruvald Pedersen | 55d6b4c | 2018-11-26 23:39:51 +0100 | [diff] [blame] | 20 | set(PythonInterp_FIND_VERSION_EXACT 0) |
| 21 | set(PythonInterp_FIND_REQUIRED 1) |
| 22 | include(${ZEPHYR_BASE}/cmake/backports/FindPythonInterp.cmake) |