2014-07-02 16:58:40 +00:00
|
|
|
# Copyright 2014 Google Inc. All rights reserved.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
# license that can be found in the LICENSE file or at
|
|
|
|
# https://developers.google.com/open-source/licenses/bsd
|
|
|
|
#
|
|
|
|
# This file contains common settings for building packager components.
|
|
|
|
|
|
|
|
{
|
|
|
|
'variables': {
|
2017-12-06 23:08:40 +00:00
|
|
|
'variables': {
|
|
|
|
'shaka_code%': 0,
|
2018-08-15 00:21:29 +00:00
|
|
|
# musl is a lightweight C standard library used in Alpine Linux.
|
|
|
|
'musl%': 0,
|
2017-12-06 23:08:40 +00:00
|
|
|
},
|
|
|
|
'shaka_code%': '<(shaka_code)',
|
2018-08-15 00:21:29 +00:00
|
|
|
'musl%': '<(musl)',
|
2017-05-23 02:41:26 +00:00
|
|
|
'libpackager_type%': 'static_library',
|
2017-12-06 23:08:40 +00:00
|
|
|
'conditions': [
|
|
|
|
['shaka_code==1', {
|
|
|
|
# This enable warnings and warnings-as-errors.
|
|
|
|
'chromium_code': 1,
|
|
|
|
}],
|
|
|
|
],
|
2014-07-02 16:58:40 +00:00
|
|
|
},
|
|
|
|
'target_defaults': {
|
|
|
|
'conditions': [
|
2017-12-06 23:08:40 +00:00
|
|
|
['shaka_code==1', {
|
|
|
|
'include_dirs': [
|
|
|
|
'.',
|
|
|
|
'..',
|
2015-07-22 23:40:45 +00:00
|
|
|
],
|
2018-01-04 06:02:19 +00:00
|
|
|
'variables': {
|
|
|
|
'clang_warning_flags': [
|
|
|
|
'-Wimplicit-fallthrough',
|
|
|
|
],
|
|
|
|
# Revert the relevant settings in Chromium's common.gypi.
|
|
|
|
'clang_warning_flags_unset': [
|
|
|
|
'-Wno-char-subscripts',
|
|
|
|
'-Wno-unneeded-internal-declaration',
|
|
|
|
'-Wno-covered-switch-default',
|
2014-07-02 16:58:40 +00:00
|
|
|
|
2018-01-04 06:02:19 +00:00
|
|
|
# C++11-related flags:
|
|
|
|
'-Wno-c++11-narrowing',
|
|
|
|
'-Wno-reserved-user-defined-literal',
|
|
|
|
],
|
|
|
|
},
|
2018-07-04 05:12:37 +00:00
|
|
|
# TODO(kqyang): Fix these msvs warnings.
|
|
|
|
'msvs_disabled_warnings': [
|
|
|
|
4125, # Decimal digit terminates octal escape sequence, e.g. "\709".
|
|
|
|
4819, # The file contains a character that cannot be represented in
|
|
|
|
# the current code page. It typically happens when compiling
|
|
|
|
# the code in CJK environment if there is non-ASCII characters
|
|
|
|
# in the file.
|
2021-06-14 22:31:44 +00:00
|
|
|
4251, # Warnings about private std::string in Status in a shared
|
|
|
|
# library config on Windows.
|
2017-12-06 23:08:40 +00:00
|
|
|
],
|
|
|
|
}, {
|
2018-01-04 06:02:19 +00:00
|
|
|
# We do not have control over non-shaka code. Disable some warnings to
|
|
|
|
# make build pass.
|
|
|
|
'variables': {
|
|
|
|
'clang_warning_flags': [
|
|
|
|
'-Wno-tautological-constant-compare',
|
|
|
|
'-Wno-unguarded-availability',
|
|
|
|
],
|
|
|
|
},
|
2018-07-04 05:12:37 +00:00
|
|
|
'msvs_disabled_warnings': [
|
|
|
|
4819, # The file contains a character that cannot be represented in
|
|
|
|
# the current code page. It typically happens when compiling
|
|
|
|
# the code in CJK environment if there is non-ASCII characters
|
|
|
|
# in the file.
|
|
|
|
],
|
2020-06-11 22:13:42 +00:00
|
|
|
'cflags': [
|
|
|
|
# TODO(modmaker): Remove once Chromium base is removed.
|
|
|
|
'-Wno-deprecated-declarations',
|
|
|
|
],
|
2017-12-06 23:08:40 +00:00
|
|
|
'conditions': [
|
|
|
|
['clang==0', {
|
|
|
|
'cflags': [
|
|
|
|
'-Wno-dangling-else',
|
|
|
|
'-Wno-deprecated-declarations',
|
|
|
|
'-Wno-unused-function',
|
|
|
|
],
|
|
|
|
}],
|
2014-07-02 16:58:40 +00:00
|
|
|
],
|
2016-08-14 22:28:21 +00:00
|
|
|
}],
|
2018-08-15 00:21:29 +00:00
|
|
|
['musl==1', {
|
|
|
|
'defines': [
|
|
|
|
# musl is not uClibc but is similar to uClibc that a minimal feature
|
|
|
|
# set is supported. One of Shaka Packager's dependencies, Chromium
|
|
|
|
# base uses __UCLIBC__ flag to disable some features, which needs to
|
|
|
|
# be disabled for musl too.
|
|
|
|
'__UCLIBC__',
|
|
|
|
],
|
|
|
|
'cflags!': [
|
|
|
|
# Do not treat warnings as errors on musl as there is a hard-coded
|
|
|
|
# warning in musl's sys/errno.h.
|
|
|
|
'-Werror',
|
|
|
|
],
|
|
|
|
}]
|
2014-07-02 16:58:40 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
}
|