@@ -28,6 +28,7 @@ class Sunshine < Formula
2828
2929 depends_on "cmake" => :build
3030 depends_on "doxygen" => :build
31+ depends_on "gcc@14" => [ :build , :test ]
3132 depends_on "graphviz" => :build
3233 depends_on "node" => :build
3334 depends_on "pkgconf" => :build
@@ -44,7 +45,6 @@ class Sunshine < Formula
4445 end
4546
4647 on_linux do
47- depends_on "gcc@14" => [ :build , :test ]
4848 depends_on "avahi"
4949 depends_on "gnu-which"
5050 depends_on "libayatana-appindicator"
@@ -82,12 +82,10 @@ def install
8282 ENV [ "BUILD_VERSION" ] = "@BUILD_VERSION@"
8383 ENV [ "COMMIT" ] = "@GITHUB_COMMIT@"
8484
85- # Ensure we use GCC 14 consistently on Linux
86- if OS . linux?
87- gcc14 = Formula [ "gcc@14" ]
88- ENV [ "CC" ] = "#{ gcc14 . opt_bin } /gcc-14"
89- ENV [ "CXX" ] = "#{ gcc14 . opt_bin } /g++-14"
90- end
85+ # Use GCC because gcov from llvm cannot handle our paths
86+ gcc14 = Formula [ "gcc@14" ]
87+ ENV [ "CC" ] = "#{ gcc14 . opt_bin } /gcc-14"
88+ ENV [ "CXX" ] = "#{ gcc14 . opt_bin } /g++-14"
9189
9290 args = %W[
9391 -DBUILD_WERROR=ON
@@ -191,22 +189,17 @@ def caveats
191189
192190 # Change to the source directory for gcovr to work properly
193191 cd "#{ buildpath } /build" do
194- # Use the same GCC version that was used for compilation
195- gcov_executable = "#{ Formula [ "llvm" ] . opt_bin } /llvm-cov gcov"
196-
197- if OS . linux?
198- # Use GCC 14 to match what was used during compilation
199- gcc14 = Formula [ "gcc@14" ]
200- gcov_executable = "#{ gcc14 . opt_bin } /gcov-14"
201- end
192+ # Use GCC 14 to match what was used during compilation
193+ gcc14 = Formula [ "gcc@14" ]
194+ gcov_executable = "#{ gcc14 . opt_bin } /gcov-14"
202195
203196 system "gcovr" , "." ,
204197 "-r" , "../src" ,
205198 "--gcov-executable" , gcov_executable ,
206199 "--exclude-noncode-lines" ,
207200 "--exclude-throw-branches" ,
208201 "--exclude-unreachable-branches" ,
209- "--verbose" , # TODO: remove verbose once working
202+ "--verbose" , # TODO: remove verbose once working
210203 "--xml-pretty" ,
211204 "-o=#{ testpath } /coverage.xml"
212205 end
0 commit comments