Can't Find juce_recommended_warning_flags

Hey! –

I’m using CMake – unfortunately if I enable this option I get about 6k trivial warnings about casting and missing override declarations and extra semicolons in places.

I’d like to fix it overtime – but definitely not on one shot. The issue is without this, there aren’t the original warning levels which were the default in projucer.

Is there a way to get the CMake warning levels to match the default projucer levels?

Aside from that – I can’t seem to find juce_recommended_warning_flags – searching this in the JUCE CMake folders seem to produce no results somehow?

Where are these defined?

If you want custom flags, I’d recommend defining your own ‘warning flags’ target.

The JUCE flags targets can be found in extras/Build/CMake/JUCEHelperTargets.cmake. The warning_flags target there may serve as a good starting point for your own flags target.

Thank you! Any tip on where the basic ones the projucer provides originally are? I’d just like to create a target which matches those for now

I’m guessing the original ones come from XcodeProjectExporter::getProjectSettings, although those are specified as Xcode setting strings rather than as compiler flags.

You might have better luck just doing a build with a Projucer-generated project, taking note of the compiler flags, and copying those over to your target.

1 Like

I ran into a similar issue migrating from Projucer to CMake. In my Linux Makefile these are the default Projucer flags:

JUCE_CFLAGS_VST3 := -fPIC -fvisibility=hidden
JUCE_LDFLAGS_VST3 := -shared -Wl,--no-undefined

Much more minimal than the CMake flags! For Debug version there are additional -g and -ggdb flags.