CMake warnings from JUCE with "--warn-uninitialized"

Hi,

Here’s a minor feature request. I like to run CMake with --warn-uninitialized to catch spelling errors and other silly mistakes in my build scripts. When building JUCE, this results in a few warnings:

zsh 11662 [130] % cmake -Bout . -GXcode --warn-uninitialized
Warn about uninitialized values.
CMake Warning (dev) at JUCE/extras/Build/CMake/JUCEModuleSupport.cmake:427 (set):
  uninitialized variable 'module_osxframeworks'
Call Stack (most recent call first):
  JUCE/extras/Build/CMake/JUCEModuleSupport.cmake:578 (_juce_remove_empty_list_elements)
  JUCE/extras/Build/CMake/JUCEModuleSupport.cmake:660 (juce_add_module)
  JUCE/modules/CMakeLists.txt:33 (juce_add_modules)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at JUCE/extras/Build/CMake/JUCEModuleSupport.cmake:427 (set):
  uninitialized variable 'module_weakosxframeworks'
Call Stack (most recent call first):
  JUCE/extras/Build/CMake/JUCEModuleSupport.cmake:585 (_juce_remove_empty_list_elements)
  JUCE/extras/Build/CMake/JUCEModuleSupport.cmake:660 (juce_add_module)
  JUCE/modules/CMakeLists.txt:33 (juce_add_modules)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at JUCE/extras/Build/CMake/JUCEModuleSupport.cmake:473 (_juce_add_interface_library):
  uninitialized variable 'all_module_sources'
Call Stack (most recent call first):
  JUCE/extras/Build/CMake/JUCEModuleSupport.cmake:660 (juce_add_module)
  JUCE/modules/CMakeLists.txt:33 (juce_add_modules)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at JUCE/extras/Build/CMake/JUCEModuleSupport.cmake:427 (set):
  uninitialized variable 'module_osxframeworks'
Call Stack (most recent call first):
  JUCE/extras/Build/CMake/JUCEModuleSupport.cmake:578 (_juce_remove_empty_list_elements)
  JUCE/extras/Build/CMakeLists.txt:33 (juce_add_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at JUCE/extras/Build/CMake/JUCEModuleSupport.cmake:427 (set):
  uninitialized variable 'module_weakosxframeworks'
Call Stack (most recent call first):
  JUCE/extras/Build/CMake/JUCEModuleSupport.cmake:585 (_juce_remove_empty_list_elements)
  JUCE/extras/Build/CMakeLists.txt:33 (juce_add_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring juceaide
CMake Warning (dev) at JUCE/extras/Build/juceaide/CMakeLists.txt:115 (execute_process):
  uninitialized variable 'extra_compiler_flag_arguments'
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Building juceaide
-- Exporting juceaide
-- Testing juceaide
-- Finished setting up juceaide
CMake Warning (dev) at JUCE/CMakeLists.txt:136 (write_basic_package_version_file):
  uninitialized variable 'extra_version_arg'
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done (1.3s)
-- Generating done (0.1s)

Would it be possible to update the JUCE build scripts to remove these warnings?

Polite bump –– any inputs from the JUCE team?

Thanks for reporting. We’ve pushed some fixes for these warnings on the develop branch:

1 Like

Awesome, thanks! I just tested the develop branch in my project and all the warnings are gone.