Hi all,
I’ve got a project that works very fine using CMake. However, I lately concentrated on code quality, and set the warning flags as high as possible. I also consider warnings as errors. However, with GCC, JUCE raises some warnings that prevent the compilation from working.
Here is how I declare my warnings on the top CMakeLists.txt:
set(WARNING_FLAGS
-Wall -Wextra -pedantic -pedantic-errors
-Werror -Wsign-conversion -Wcast-align
#JUCE doesn't like the following line!
-Wconversion -Wnoexcept -Wundef -Wold-style-cast -Wcast-qual -Wlogical-op
-Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2
-Winit-self -Wmissing-include-dirs -Woverloaded-virtual
-Wredundant-decls -Wshadow -Wstrict-null-sentinel -Wstrict-overflow=5
-Wno-unused -Wno-variadic-macros -Wno-parentheses -fdiagnostics-show-option
)
set(NO_WARNING_FLAGS -w)
And then declare what projects need what warnings:
target_compile_options(MainSoftware PRIVATE ${WARNING_FLAGS})
target_compile_options(TestUnits PRIVATE ${WARNING_FLAGS})
target_compile_options(ThirdParty PRIVATE ${NO_WARNING_FLAGS})
My “third party” project uses lax compilation flags. My question is, how can I do that with Juce?
I tried “wrapping” Juce in its own project and link it to my “main software” and “test units” projects, but it didn’t work, since they use Juce macro (juce_add_gui_app
, etc.), which already declare Juce.
Thanks!