# Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary # source code may only be used and distributed under the Widevine Master # License Agreement. { # Here you can override global gyp variables with platform-specific values. # See cdm.gyp for a complete list of settings you can override. 'variables': { 'asm_target_arch': 'x86-64', }, # end variables # Here you can set platform-specific compiler settings. 'target_defaults': { # These are flags passed to the compiler for all C & C++ files. 'cflags': [ '-fPIC', '-fvisibility=hidden', ], # These are flags passed to the compiler for plain C only. 'cflags_c': [ # Compile using the C11 standard with POSIX extensions '-std=c11', '-D_POSIX_C_SOURCE=200809L', # Warn on bad function casts '-Wbad-function-cast', ], # These are flags passed to the compiler for C++ only. 'cflags_cc': [ # Compile using the C++11 standard. '-std=c++11', # Disable unused C++ features that are expensive. '-fno-rtti', '-fno-exceptions', # Enable all warnings, and treat warnings as errors. '-Wall', '-Werror', '-Wextra', '-Wunused', '-Wcast-qual', '-Wno-long-long', '-Wno-variadic-macros', '-Wno-inline', '-Wformat=2', '-Wno-format-nonliteral', '-Wshadow', '-Wnon-virtual-dtor', #'-Woverloaded-virtual', #'-Wctor-dtor-privacy', '-Wcast-align', '-Wno-conversion', '-Wignored-qualifiers', '-Wreturn-type', #'-Wstrict-null-sentinel', #'-Wuseless-cast', '-Wno-unused-parameter', # repeated in protobufs triggers this '-Wno-unused-local-typedefs', # metrics requires this '-Wno-inconsistent-missing-override', #'-Wno-maybe-uninitialized', '-Wno-unknown-warning-option', '-Wno-dangling-else', # Allowed by Google C++ Style ], # These are flags passed to the linker. 'ldflags': [ ], # These are macros set by the compiler. 'defines': [ #'EXAMPLE_MACRO_WITH_NO_VALUE', #'EXAMPLE_KEY=EXAMPLE_VALUE', ], # These are additional include paths to search for headers. 'include_dirs': [ #'/usr/local/include', ], 'target_conditions': [ ['_toolset == "host"', { # These are settings specifically for the host toolchain. # The extra equals sign in the key name instructs gyp to replace # the generic settings above rather than append to them. 'cflags=': [ ], 'cflags_c=': [ ], 'cflags_cc=': [ '-Wcast-qual', # '-Wextra', '-Wno-unused', '-Wno-long-long', '-Wno-variadic-macros', '-Wno-inline', '-Wformat=2', '-Wno-format-nonliteral', '-Wnon-virtual-dtor', #'-Woverloaded-virtual', #'-Wctor-dtor-privacy', '-Wcast-align', '-Wno-ignored-qualifiers', '-Wno-return-type', ], 'ldflags=': [ ], 'defines=': [ ], 'include_dirs=': [ ], }], # end _toolset == "host" condition ], # end target_conditions 'configurations': { # These are additional settings per build configuration. # You may specify any of the keys above in this section # (cflags, cflags_c, cflags_cc, ldflags, defines, include_dirs). 'Debug': { 'cflags': [ '-O0', '-g', ], 'defines': [ '_DEBUG', ], 'ldflags': [ '-g', ], }, 'Release': { 'cflags': [ '-O2', '-g0', ], 'ldflags': [ '-flto', ], 'defines': [ 'NDEBUG', ], }, }, # end configurations }, # end target_defaults }