From d4b78134fe73338193ecd3ee8b50183d7e6ff991 Mon Sep 17 00:00:00 2001 From: Anutosh Bhat <87052487+anutosh491@users.noreply.github.com> Date: Fri, 8 Nov 2024 19:28:01 +0530 Subject: [PATCH] Fix finding Resource Dir (#171) * Fix finding Resource Dir * Update src/xinterpreter.cpp Co-authored-by: Vassil Vassilev * Update src/xinterpreter.cpp Co-authored-by: Vassil Vassilev --------- Co-authored-by: Vassil Vassilev --- src/xinterpreter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xinterpreter.cpp b/src/xinterpreter.cpp index 507a7bde..2a8084f8 100644 --- a/src/xinterpreter.cpp +++ b/src/xinterpreter.cpp @@ -37,7 +37,8 @@ using Args = std::vector; void* createInterpreter(const Args &ExtraArgs = {}) { Args ClangArgs = {/*"-xc++"*/"-v"}; // ? {"-Xclang", "-emit-llvm-only", "-Xclang", "-diagnostic-log-file", "-Xclang", "-", "-xc++"}; - if (std::find(ExtraArgs.begin(), ExtraArgs.end(), "-resource-dir") == ExtraArgs.end()) { + if (std::find_if(ExtraArgs.begin(), ExtraArgs.end(), [](const std::string& s) { + return s == "-resource-dir";}) == ExtraArgs.end()) { std::string resource_dir = Cpp::DetectResourceDir(); if (resource_dir.empty()) std::cerr << "Failed to detect the resource-dir\n";