llvmpipe: Use mkdir instead of std::filesystem::create_directory on Android

libc++fs symbols are not available to vendor modules up to Android 15
this patch allows to build llvmpipe as module for Android 14 and older

Backport-to: 25.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35208>
This commit is contained in:
Mauro Rossi 2025-06-03 19:16:06 +02:00 committed by Marge Bot
parent 4aafb5fcc3
commit 9fd6bae3c4

View file

@ -43,6 +43,7 @@
#include <llvm/Support/Host.h>
#endif
#include "util/detect_os.h"
#include "util/u_math.h"
#include "util/u_debug.h"
@ -56,7 +57,9 @@
#include <llvm/BinaryFormat/Dwarf.h>
#if !DETECT_OS_ANDROID
#include <filesystem>
#endif
/**
* Check alignment.
@ -376,7 +379,11 @@ lp_function_add_debug_info(gallivm_state *gallivm, LLVMValueRef func, LLVMTypeRe
if (!gallivm->file) {
uint32_t shader_index = p_atomic_add_return(&global_shader_index, 1);
#if !DETECT_OS_ANDROID
std::filesystem::create_directory(LP_NIR_SHADER_DUMP_DIR);
#else
mkdir(LP_NIR_SHADER_DUMP_DIR, 0755);
#endif
asprintf(&gallivm->file_name, "%s/%u.nir", LP_NIR_SHADER_DUMP_DIR, shader_index);