Skip to content

Commit 65a1c2e

Browse files
committed
copy_cmake_assets.rb should insert JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE
1 parent 9ebfb5a commit 65a1c2e

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

copy_cmake_assets.rb

+12-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Note, this needs to be run from your PROJECT directory, not the module's directory
44
# e.g.
55
# modules/melatonin_inspector/copy_cmake_assets.rb
6-
#
6+
#
77
# You can run it over and over without worry...
88

99
require 'fileutils'
@@ -22,31 +22,34 @@
2222
if !File.directory? source_dir
2323
puts "source_dir not found, check the build_dir: " + source_dir
2424
elsif !File.directory? target_cpp_dir
25-
puts "target_cpp_dir not found, check it: " + target_cpp_dir
25+
puts "target_cpp_dir not found, check it: " + target_cpp_dir
2626
else
27-
27+
2828
puts "Removing existing *.cpp and InspectorBinaryData.h"
2929
FileUtils.rm_rf Dir.glob "#{target_cpp_dir}/*.cpp"
3030
FileUtils.rm_f target_h_file
31-
31+
3232
puts "Copying over the newly generated assets"
3333
FileUtils.cp Dir["#{source_dir}/*.cpp"], "#{target_cpp_dir}/"
34-
34+
3535
puts "Coping over InspectorBinaryData.h"
3636
FileUtils.cp "#{source_dir}/InspectorBinaryData.h", target_h_file
37-
37+
3838
puts "Rewriting #{mela_cpp_file} with new includes"
3939
cpp_file = File.open mela_cpp_file, 'w'
4040
cpp_file.write "// WARNING! This file is automatically written by copy_cmake_assets.rb\n\n"
4141
cpp_file.write "// As recommended by the JUCE MODULE API, these cpp files are included by the main module cpp\n"
4242
cpp_file.write "// See https://github.com/juce-framework/JUCE/blob/master/docs/JUCE%20Module%20Format.md#module-cpp-files\n\n"
43+
cpp_file.write "#include <juce_core/juce_core.h>\n"
44+
cpp_file.write "JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE(\"-Wredundant-decls\")\n"
4345
cpp_file.write "// NOLINTBEGIN(bugprone-suspicious-include)\n"
44-
46+
4547
Dir["#{target_cpp_dir}/*.cpp"].each do |file|
4648
cpp_file.write "#include \"LatestCompiledAssets/#{File.basename(file)}\"\n"
4749
end
48-
cpp_file.write "// NOLINTEND(bugprone-suspicious-include)\n\n"
50+
cpp_file.write "// NOLINTEND(bugprone-suspicious-include)\n"
51+
cpp_file.write "JUCE_END_IGNORE_WARNINGS_GCC_LIKE\n"
4952
cpp_file.close
5053
end
5154

52-
puts "All done."
55+
puts "All done."

melatonin_inspector.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// As recommended by the JUCE MODULE API, these cpp files are included by the main module cpp
44
// See https://github.com/juce-framework/JUCE/blob/master/docs/JUCE%20Module%20Format.md#module-cpp-files
55

6+
#include <juce_core/juce_core.h>
7+
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE("-Wredundant-decls")
68
// NOLINTBEGIN(bugprone-suspicious-include)
79
#include "LatestCompiledAssets/BinaryData1.cpp"
810
#include "LatestCompiledAssets/BinaryData10.cpp"
@@ -25,4 +27,4 @@
2527
#include "LatestCompiledAssets/BinaryData8.cpp"
2628
#include "LatestCompiledAssets/BinaryData9.cpp"
2729
// NOLINTEND(bugprone-suspicious-include)
28-
30+
JUCE_END_IGNORE_WARNINGS_GCC_LIKE

0 commit comments

Comments
 (0)