Skip to content

Commit

Permalink
testing: for CI only, trim PWD from the oslc -M output
Browse files Browse the repository at this point in the history
Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz committed Jan 16, 2025
1 parent 13d4edc commit ce34a5e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/liboslcomp/oslcomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,24 @@ OSLCompilerImpl::write_dependency_file(string_view filename)
: OIIO::Filesystem::fopen(m_deps_filename, "w"));
if (depfile) {
OSL::print(depfile, "{}: {}", target, filename);
for (const auto& dep : m_file_dependencies) {
for (ustring dep : m_file_dependencies) {
if (OIIO::Strutil::ends_with(dep, "stdosl.h")
&& !m_generate_system_deps)
continue; // skip system headers if so instructed
if (OIIO::Strutil::starts_with(dep, "<"))
continue; // skip pseudo files
if (dep == filename)
continue; // skip this file, since we already put it first
#if defined(_WIN32) && defined(OSL_CI)
// Special behavior for CI on Windows: remove the directory paths
// for the dependencies, or else it won't match the reference
// output.
std::string cwd = OIIO::Filesystem::current_path() + "/";
auto d = OIIO::Strutil::replace::replace(dep, "\\\\", "/", true);
d = OIIO::Strutil::replace::replace(d, cwd, "");
dep = ustring(d);
OSL::print(depfile, " \\\n ({})", cwd);
#endif
OSL::print(depfile, " \\\n {}", dep);
}
OSL::print(depfile, "\n");
Expand Down

0 comments on commit ce34a5e

Please sign in to comment.