Skip to content

Circular dependency in include files #15

@MathiasMagnus

Description

@MathiasMagnus

I'm trying to compile the library using CMake and Ninja instead of the Visual Studio generators. I was aware that IntelliSense is smarter when used in tandem with MSBuild, as it picks up global information of the build and doesn't operate solely based on translation units. When building with Ninja, after realizing that PCH isn't a build acceleration method but is actually a hard requirement of the build, I added target_precompiled_header invocation and realized that the project still doesn't build. I started adding #includes directives to the headers to please the compiler, but ultimately engaged in cyclic include directives. A lot of headers arrive to including DeviceChild.hpp which in turn requires ImmediateContext.hpp which in turn requires Resource.hpp which then requires DeviceChild.hpp again. Removing any of these includes results in undefined types when compiling the very same pch.hpp the build otherwise relies on.

Can anyone comment on how to untie this knot?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions