build system: avoid warnings about files without symbols on macOS

This commit is contained in:
Moritz Bunkus 2021-03-13 22:54:51 +01:00
parent 4e717815c7
commit 76f7246087
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
2 changed files with 5 additions and 2 deletions

View File

@ -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]

View File

@ -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