# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
config("unrar_warnings") {
cflags = [
# unrar frequently drops parentheses around logical ops
"-Wno-logical-op-parentheses",
# unrar frequently has dangling elses
"-Wno-dangling-else",
# unrar has several non-exhaustive switch statements
"-Wno-switch",
# unrar has several unused functions
"-Wno-unused-function",
# unrar has missing braces for initialization in rarvm.cpp
"-Wno-missing-braces",
]
}
static_library("unrar") {
sources = [
"google/unrar_wrapper.cc",
"google/unrar_wrapper.h",
"src/archive.cpp",
"src/arcread.cpp",
"src/blake2s.cpp",
"src/cmddata.cpp",
"src/consio.cpp",
"src/crc.cpp",
"src/crypt.cpp",
"src/encname.cpp",
"src/errhnd.cpp",
"src/extinfo.cpp",
"src/extract.cpp",
"src/filcreat.cpp",
"src/file.cpp",
"src/filefn.cpp",
"src/filestr.cpp",
"src/find.cpp",
"src/getbits.cpp",
"src/global.cpp",
"src/hash.cpp",
"src/headers.cpp",
"src/list.cpp",
"src/match.cpp",
"src/options.cpp",
"src/pathfn.cpp",
"src/qopen.cpp",
"src/rarvm.cpp",
"src/rawread.cpp",
"src/rdwrfn.cpp",
"src/recvol.cpp",
"src/resource.cpp",
"src/rijndael.cpp",
"src/rs.cpp",
"src/rs16.cpp",
"src/scantree.cpp",
"src/secpassword.cpp",
"src/sha1.cpp",
"src/sha256.cpp",
"src/smallfn.cpp",
"src/strfn.cpp",
"src/strlist.cpp",
"src/system.cpp",
"src/threadpool.cpp",
"src/timefn.cpp",
"src/ui.cpp",
"src/unicode.cpp",
"src/unpack.cpp",
"src/volume.cpp",
]
if (is_win) {
sources += [ "src/isnt.cpp" ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
# This must be after no_chromium_code for warning flags to be ordered
# correctly.
":unrar_warnings",
]
defines = [
"_FILE_OFFSET_BITS=64",
"LARGEFILE_SOURCE",
"RAR_SMP",
"SILENT",
"NOVOLUME",
# The following is set to disable certain macro definitions in the unrar
# source code.
"CHROMIUM_UNRAR",
# Disables exceptions in unrar, replaces them with process termination.
"UNRAR_NO_EXCEPTIONS",
]
deps = [ "//base" ]
}