Skip to content

Commit 97b34aa

Browse files
authored
Patch nanopb CMakeLists.txt to look for python 3.7 instead of python 2.7 (#9947)
1 parent 2264982 commit 97b34aa

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

cmake/external/nanopb.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ ExternalProject_Add(
3434
BUILD_COMMAND ""
3535
INSTALL_COMMAND ""
3636
TEST_COMMAND ""
37+
PATCH_COMMAND patch -Np1 --binary -i ${CMAKE_CURRENT_LIST_DIR}/nanopb.patch
3738
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
3839
)

cmake/external/nanopb.patch

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -Naur nanopb/CMakeLists.txt nanopb-fix/CMakeLists.txt
2+
--- nanopb/CMakeLists.txt 2021-03-22 08:50:07.000000000 -0400
3+
+++ nanopb-fix/CMakeLists.txt 2022-06-24 16:17:09.130783413 -0400
4+
@@ -41,7 +41,7 @@
5+
if(nanopb_BUILD_GENERATOR)
6+
set(generator_protos nanopb plugin)
7+
8+
- find_package(PythonInterp 2.7 REQUIRED)
9+
+ find_package(PythonInterp 3.7 REQUIRED)
10+
execute_process(
11+
COMMAND ${PYTHON_EXECUTABLE} -c
12+
"from distutils import sysconfig; print(sysconfig.get_python_lib(prefix=''))"

scripts/check_whitespace.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ options=(
2626
)
2727

2828
git grep "${options[@]}" -- \
29+
':(exclude)cmake/external/nanopb.patch' \
2930
':(exclude)cmake/external/snappy.patch' \
3031
':(exclude)Crashlytics/ProtoSupport' \
3132
':(exclude)Crashlytics/UnitTests/Data' \

0 commit comments

Comments
 (0)