shaderc metal "error" fix

This commit is contained in:
Phillip Stephens 2019-07-01 01:26:42 -07:00
parent cfd365bebe
commit efa7463a9a
1 changed files with 2 additions and 2 deletions

View File

@ -124,7 +124,7 @@ struct ShaderCompiler<PlatformType::Metal> {
pid_t pid = fork();
if (!pid) {
execlp("xcrun", "xcrun", "-sdk", "macosx", "metal", NULL);
execlp("xcrun", "xcrun", "-sdk", "macosx", "metal", "--version", NULL);
/* xcrun returns 72 if metal command not found;
* emulate that if xcrun not found */
exit(72);
@ -134,7 +134,7 @@ struct ShaderCompiler<PlatformType::Metal> {
while ((ret = waitpid(pid, &status, 0)) < 0 && errno == EINTR) {}
if (ret < 0)
return false;
return WEXITSTATUS(status) == 1;
return WEXITSTATUS(status) == 0;
}
template <typename S>