Is there a way to generate JuceHeader.h during the configuration stage?

I want to run clang-tidy without having to build. Everything should be there from the CMake configuration step except JuceHeader.h is generated during the build step.

Any tips how to generate it without having to start the build process and cancel it in some hacky way once the header has been generated?

To answer your question directly, I don’t know, when @reuk is in he may have some other suggestions.

How difficult would it be to include the module headers and not generate the JUCE header at all?

You could add a custom target that only depends on your custom header (or headers):

add_custom_target(host_header DEPENDS
    $<TARGET_PROPERTY:my_target,JUCE_GENERATED_SOURCES_DIRECTORY>/JuceHeader.h
    ...
    )

Then, building this target will just generate all of the specified headers.

3 Likes

That’s an idea, thanks. I’ll give it a go.

That works nicely. Thanks again.