File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -28,22 +28,22 @@ using Args = std::vector<const char*>;
2828
2929void * createInterpreter (const Args &ExtraArgs = {}) {
3030 Args ClangArgs = {/* "-xc++"*/ " -v" };
31- #ifndef EMSCRIPTEN
3231 if (std::find_if (ExtraArgs.begin (), ExtraArgs.end (), [](const std::string& s) {
3332 return s == " -resource-dir" ;}) == ExtraArgs.end ()) {
3433 std::string resource_dir = Cpp::DetectResourceDir ();
35- if (resource_dir.empty ())
36- std::cerr << " Failed to detect the resource-dir\n " ;
37- ClangArgs.push_back (" -resource-dir" );
38- ClangArgs.push_back (resource_dir.c_str ());
34+ if (!resource_dir.empty ()) {
35+ ClangArgs.push_back (" -resource-dir" );
36+ ClangArgs.push_back (resource_dir.c_str ());
37+ } else {
38+ std::cerr << " Failed to detect the resource-dir\n " ;
39+ }
3940 }
4041 std::vector<std::string> CxxSystemIncludes;
4142 Cpp::DetectSystemCompilerIncludePaths (CxxSystemIncludes);
4243 for (const std::string& CxxInclude : CxxSystemIncludes) {
4344 ClangArgs.push_back (" -isystem" );
4445 ClangArgs.push_back (CxxInclude.c_str ());
4546 }
46- #endif
4747 ClangArgs.insert (ClangArgs.end (), ExtraArgs.begin (), ExtraArgs.end ());
4848 // FIXME: We should process the kernel input options and conditionally pass
4949 // the gpu args here.
You can’t perform that action at this time.
0 commit comments