File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ include(GNUInstallDirs)
66
77enable_language (C CXX)
88
9+ option (ANDROID_BUILD_TOOLS_DEV_MODE "Enable dev mode to ease upstreaming of patches to Google" OFF )
10+
911# Use C11 with GNU extensions.
1012set (CMAKE_C_STANDARD 11)
1113set (CMAKE_C_EXTENSIONS ON )
Original file line number Diff line number Diff line change @@ -22,11 +22,23 @@ if(ANDROID_BUILD_TOOLS_PATCH_VENDOR AND EXISTS "${ANDROID_PATCH_DIR}/")
2222 file (GLOB patches ${ANDROID_PATCH_DIR} /${v} /*.patch)
2323 if (patches)
2424 message (STATUS "Applying patches for: ${v} " )
25- execute_process (COMMAND git -C
26- ${CMAKE_CURRENT_SOURCE_DIR} /${v} am ${patches}
27- RESULT_VARIABLE ret)
28- if (NOT "${ret} " STREQUAL "0" )
29- message (FATAL_ERROR "Couldn't apply patches for ${v} " )
25+
26+ if (ANDROID_BUILD_TOOLS_DEV_MODE)
27+ foreach (patch ${patches} )
28+ execute_process (COMMAND patch -d
29+ ${CMAKE_CURRENT_SOURCE_DIR} /${v} -p1 -i ${patch}
30+ RESULT_VARIABLE ret)
31+ if (NOT "${ret} " STREQUAL "0" )
32+ message (FATAL_ERROR "Couldn't apply patch ${patch} for ${v} " )
33+ endif ()
34+ endforeach (patch)
35+ else ()
36+ execute_process (COMMAND git -C
37+ ${CMAKE_CURRENT_SOURCE_DIR} /${v} am ${patches}
38+ RESULT_VARIABLE ret)
39+ if (NOT "${ret} " STREQUAL "0" )
40+ message (FATAL_ERROR "Couldn't apply patches for ${v} " )
41+ endif ()
3042 endif ()
3143 endif (patches)
3244 endforeach (v)
You can’t perform that action at this time.
0 commit comments