New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input file with absolute path should not disable -working-directory option #115
Conversation
|
||
shader = FileShader('void main() {}', '.vert') | ||
environment = Directory('.', [ | ||
Directory('subdir', []), | ||
]) | ||
glslc_args = ['-c', '-working-directory=subdir', shader] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous test expect to find the output file in the same directory with the input shader file. But we should expect the output file in 'subdir'.
8b53d63
to
82defb8
Compare
if (!needs_linking_ && !workdir_.empty()) { | ||
if (shaderc_util::IsAbsolutePath(output_file)) { | ||
// Get the file name from the absolute path of the input file. | ||
output_file = GetBaseNameFromAbsolutePath(output_file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems really confusing.
Seems the blurb at GetOutputFileName is very underspecified. The glslc/README.asciidoc also leaves some holes. |
Here's my attempt at spelling out exactly how to compute the output file name. |
if (!needs_linking_ && !workdir_.empty() && | ||
!shaderc_util::IsAbsolutePath(input_filename)) { | ||
if (!needs_linking_ && !workdir_.empty()) { | ||
if (shaderc_util::IsAbsolutePath(output_file)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems wrong. Shouldn't it be ! ... IsAbsolutePath?
Please see proposed comment in #119 for how I'd like it to all work. |
82defb8
to
5cfcd3b
Compare
…vior when input file names are represented in absolute paths.
5cfcd3b
to
634b815
Compare
We've removed -working-directory, so this PR should be reworked or dropped. :-) |
Working directory has been removed from glslc in commit: 7b94f85. So this PR is closed. |
Previous glslc ignore -working-directory when the input files are passed with absolute paths, the output files are placed with the input files. But clang actually respects working-directory in the same cases.