set(PP_ANDROID_VENDOR_PATCH_DIR "${CMAKE_CURRENT_LIST_DIR}")

function(pp_apply_android_nanort_patch)
	set(nanort_header "${PP_ANDROID_VENDOR_PATCH_DIR}/../../libs/nanort/nanort.h")
	file(READ "${nanort_header}" nanort_contents)

	set(nanort_before "  const size_t vertex_stride_bytes_;")
	set(nanort_after "  size_t vertex_stride_bytes_;")

	if(nanort_contents MATCHES "${nanort_before}")
		string(REPLACE
			"${nanort_before}"
			"${nanort_after}"
			nanort_contents
			"${nanort_contents}")
		file(WRITE "${nanort_header}" "${nanort_contents}")
	elseif(NOT nanort_contents MATCHES "${nanort_after}")
		message(FATAL_ERROR "Unexpected nanort.h layout; Android nanort patch could not be applied")
	endif()
endfunction()
