Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/liboslcomp/oslcomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,14 +590,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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit lite, but I'm not sure this actually works right now? There's an OSL_CI environment variable, but no compile definition that I can see.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like many such things, it's expressed as ${PROJ_NAME}_CI to preserve a big block of cmake script that I maintain in parallel between OIIO and OSL and this makes it a lot easier to diff and port improvements from one project to the other.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I missed that.

// Special behavior for CI on Windows: remove the directory paths
// for the dependencies, or else it won't match the reference
// output.
using OIIO::Strutil::replace;
std::string cwd = replace(OIIO::Filesystem::current_path() + "/",
"/", "\\", true);
auto d = replace(dep, "\\\\", "\\", true);
dep = ustring(replace(d, cwd, ""));
#endif
OSL::print(depfile, " \\\n {}", dep);
}
OSL::print(depfile, "\n");
Expand Down
Loading