From 76f7246087cd9d4712ca80cd22feefe1a3b48bf3 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sat, 13 Mar 2021 22:54:51 +0100 Subject: [PATCH] build system: avoid warnings about files without symbols on macOS --- Rakefile | 3 +++ rake.d/library.rb | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index efbdd08d2..9c185c9f1 100644 --- a/Rakefile +++ b/Rakefile @@ -181,12 +181,15 @@ def setup_globals mocflags = $building_for[:macos] ? "-DSYS_APPLE" : $building_for[:windows] ? "-DSYS_WINDOWS" : "" + ranlibflags = $building_for[:macos] ? "-no_warning_for_no_symbols" : "" + $flags = { :cflags => cflags, :cxxflags => cxxflags, :ldflags => ldflags, :windres => windres, :moc => mocflags, + :ranlib => ranlibflags, } setup_macos_specifics if $building_for[:macos] diff --git a/rake.d/library.rb b/rake.d/library.rb index affac6560..6bb959b75 100644 --- a/rake.d/library.rb +++ b/rake.d/library.rb @@ -13,8 +13,8 @@ class Library < Target def create_specific_static file "#{@target}.a" => @objects do |t| FileUtils.rm_f t.name - runq "ar", t.name, "#{c(:AR)} rc #{t.name} #{@objects.join(" ")}" - runq "ranlib", t.name, "#{c(:RANLIB)} #{t.name}" + runq "ar", t.name, "#{c(:AR)} crS #{t.name} #{@objects.join(" ")}" + runq "ranlib", t.name, "#{c(:RANLIB)} #{$flags[:ranlib]} #{t.name}" end end