brightray.gypi 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. {
  2. 'includes': [
  3. '../vendor/download/libchromiumcontent/filenames.gypi',
  4. ],
  5. 'variables': {
  6. 'libchromiumcontent_component%': 1,
  7. 'pkg-config%': 'pkg-config',
  8. 'conditions': [
  9. # The "libchromiumcontent_component" is defined when calling "gyp".
  10. ['libchromiumcontent_component', {
  11. 'libchromiumcontent_dir%': '<(libchromiumcontent_shared_libraries_dir)',
  12. 'libchromiumcontent_libraries%': '<(libchromiumcontent_shared_libraries)',
  13. 'libchromiumcontent_v8_libraries%': '<(libchromiumcontent_shared_v8_libraries)',
  14. }, {
  15. 'libchromiumcontent_dir%': '<(libchromiumcontent_static_libraries_dir)',
  16. 'libchromiumcontent_libraries%': '<(libchromiumcontent_static_libraries)',
  17. 'libchromiumcontent_v8_libraries%': '<(libchromiumcontent_static_v8_libraries)',
  18. }],
  19. ],
  20. },
  21. 'target_defaults': {
  22. 'includes': [
  23. # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
  24. 'filename_rules.gypi',
  25. ],
  26. # Putting this in "configurations" will make overrides not working.
  27. 'xcode_settings': {
  28. 'ALWAYS_SEARCH_USER_PATHS': 'NO',
  29. 'ARCHS': ['x86_64'],
  30. 'COMBINE_HIDPI_IMAGES': 'YES',
  31. 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
  32. 'GCC_ENABLE_CPP_RTTI': 'NO',
  33. 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',
  34. 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
  35. 'MACOSX_DEPLOYMENT_TARGET': '10.9',
  36. 'RUN_CLANG_STATIC_ANALYZER': 'YES',
  37. 'USE_HEADER_MAP': 'NO',
  38. },
  39. 'msvs_configuration_attributes': {
  40. 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
  41. 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
  42. 'CharacterSet': '1',
  43. },
  44. 'msvs_system_include_dirs': [
  45. '$(VSInstallDir)/VC/atlmfc/include',
  46. ],
  47. 'msvs_settings': {
  48. 'VCCLCompilerTool': {
  49. 'AdditionalOptions': ['/MP'],
  50. 'MinimalRebuild': 'false',
  51. 'BufferSecurityCheck': 'true',
  52. 'EnableFunctionLevelLinking': 'true',
  53. 'RuntimeTypeInfo': 'false',
  54. 'WarningLevel': '4',
  55. 'WarnAsError': 'true',
  56. 'DebugInformationFormat': '3',
  57. # Programs that use the Standard C++ library must be compiled with
  58. # C++
  59. # exception handling enabled.
  60. # http://support.microsoft.com/kb/154419
  61. 'ExceptionHandling': 1,
  62. },
  63. 'VCLinkerTool': {
  64. 'GenerateDebugInformation': 'true',
  65. 'MapFileName': '$(OutDir)\\$(TargetName).map',
  66. 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
  67. 'LargeAddressAware': '2',
  68. 'AdditionalOptions': [
  69. # ATL 8.0 included in WDK 7.1 makes the linker to generate
  70. # following
  71. # warnings:
  72. # - warning LNK4254: section 'ATL' (50000040) merged into
  73. # '.rdata' (40000040) with different attributes
  74. # - warning LNK4078: multiple 'ATL' sections found with
  75. # different attributes
  76. '/ignore:4254',
  77. '/ignore:4078',
  78. # views_chromiumcontent.lib generates this warning because it's
  79. # symobls are defined as dllexport but used as static library:
  80. # - warning LNK4217: locally defined symbol imported in function
  81. # - warning LNK4049: locally defined symbol imported
  82. '/ignore:4217',
  83. '/ignore:4049',
  84. ],
  85. },
  86. },
  87. 'configurations': {
  88. # The "Debug" and "Release" configurations are not actually used.
  89. 'Debug': {},
  90. 'Release': {},
  91. 'Common_Base': {
  92. 'abstract': 1,
  93. 'defines': [
  94. # We are using Release version libchromiumcontent:
  95. 'NDEBUG',
  96. # Needed by gin:
  97. 'V8_USE_EXTERNAL_STARTUP_DATA',
  98. # From skia_for_chromium_defines.gypi:
  99. 'SK_SUPPORT_LEGACY_GETTOPDEVICE',
  100. 'SK_SUPPORT_LEGACY_BITMAP_CONFIG',
  101. 'SK_SUPPORT_LEGACY_DEVICE_VIRTUAL_ISOPAQUE',
  102. 'SK_SUPPORT_LEGACY_N32_NAME',
  103. 'SK_SUPPORT_LEGACY_SETCONFIG',
  104. 'SK_IGNORE_ETC1_SUPPORT',
  105. 'SK_IGNORE_GPU_DITHER',
  106. # NACL is not enabled:
  107. 'DISABLE_NACL',
  108. ],
  109. 'conditions': [
  110. ['OS!="mac"', {
  111. 'defines': [
  112. 'TOOLKIT_VIEWS',
  113. 'USE_AURA',
  114. ],
  115. }],
  116. ['OS in ["mac", "win"]', {
  117. 'defines': [
  118. 'USE_OPENSSL',
  119. ],
  120. }, {
  121. 'defines': [
  122. 'USE_X11',
  123. # "use_nss_certs" is set to 1 in libchromiumcontent.
  124. 'USE_NSS_CERTS',
  125. 'USE_NSS', # deprecated after Chrome 45.
  126. ],
  127. }],
  128. ['OS=="linux"', {
  129. 'defines': [
  130. '_LARGEFILE_SOURCE',
  131. '_LARGEFILE64_SOURCE',
  132. '_FILE_OFFSET_BITS=64',
  133. ],
  134. 'cflags_cc': [
  135. '-D__STRICT_ANSI__',
  136. '-fno-rtti',
  137. ],
  138. }], # OS=="linux"
  139. ['OS=="mac"', {
  140. 'defines': [
  141. # The usage of "webrtc/modules/desktop_capture/desktop_capture_options.h"
  142. # is required to see this macro.
  143. 'WEBRTC_MAC',
  144. ],
  145. }], # OS=="mac"
  146. ['OS=="win"', {
  147. 'include_dirs': [
  148. '<(libchromiumcontent_src_dir)/third_party/wtl/include',
  149. ],
  150. 'defines': [
  151. '_WIN32_WINNT=0x0602',
  152. 'WINVER=0x0602',
  153. 'WIN32',
  154. '_WINDOWS',
  155. 'NOMINMAX',
  156. 'PSAPI_VERSION=1',
  157. '_CRT_RAND_S',
  158. 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
  159. 'WIN32_LEAN_AND_MEAN',
  160. '_ATL_NO_OPENGL',
  161. '_SECURE_ATL',
  162. # The usage of "webrtc/modules/desktop_capture/desktop_capture_options.h"
  163. # is required to see this macro.
  164. 'WEBRTC_WIN',
  165. ],
  166. 'conditions': [
  167. ['target_arch=="x64"', {
  168. 'msvs_configuration_platform': 'x64',
  169. 'msvs_settings': {
  170. 'VCLinkerTool': {
  171. 'MinimumRequiredVersion': '5.02', # Server 2003.
  172. 'TargetMachine': '17', # x86 - 64
  173. # Doesn't exist x64 SDK. Should use oleaut32 in any case.
  174. 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
  175. },
  176. 'VCLibrarianTool': {
  177. 'TargetMachine': '17', # x64
  178. },
  179. },
  180. }],
  181. ],
  182. }], # OS=="win"
  183. ],
  184. }, # Common_Base
  185. 'Debug_Base': {
  186. 'abstract': 1,
  187. 'defines': [
  188. # Use this instead of "NDEBUG" to determine whether we are in
  189. # Debug build, because "NDEBUG" is already used by Chromium.
  190. 'DEBUG',
  191. # Require when using libchromiumcontent.
  192. 'COMPONENT_BUILD',
  193. 'GURL_DLL',
  194. 'SKIA_DLL',
  195. 'USING_V8_SHARED',
  196. 'WEBKIT_DLL',
  197. ],
  198. 'msvs_settings': {
  199. 'VCCLCompilerTool': {
  200. 'RuntimeLibrary': '2', # /MD (nondebug DLL)
  201. 'Optimization': '0', # 0 = /Od
  202. # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
  203. 'BasicRuntimeChecks': '3', # 3 = all checks enabled, 0 = off
  204. },
  205. },
  206. }, # Debug_Base
  207. 'Release_Base': {
  208. 'abstract': 1,
  209. 'msvs_settings': {
  210. 'VCCLCompilerTool': {
  211. 'RuntimeLibrary': '2', # /MD (nondebug DLL)
  212. # 1, optimizeMinSpace, Minimize Size (/O1)
  213. 'Optimization': '1',
  214. # 2, favorSize - Favor small code (/Os)
  215. 'FavorSizeOrSpeed': '2',
  216. # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
  217. 'InlineFunctionExpansion': '2', # 2 = max
  218. # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
  219. 'OmitFramePointers': 'false',
  220. # The above is not sufficient (http://crbug.com/106711): it
  221. # simply eliminates an explicit "/Oy", but both /O2 and /Ox
  222. # perform FPO regardless, so we must explicitly disable.
  223. # We still want the false setting above to avoid having
  224. # "/Oy /Oy-" and warnings about overriding.
  225. 'AdditionalOptions': ['/Oy-'],
  226. },
  227. 'VCLinkerTool': {
  228. # Turn off incremental linking to save binary size.
  229. 'LinkIncremental': '1', # /INCREMENTAL:NO
  230. },
  231. },
  232. 'conditions': [
  233. ['OS=="linux"', {
  234. 'cflags': [
  235. '-O2',
  236. # Generate symbols, will be stripped later.
  237. '-g',
  238. # Don't emit the GCC version ident directives, they just end up
  239. # in the .comment section taking up binary size.
  240. '-fno-ident',
  241. # Put data and code in their own sections, so that unused symbols
  242. # can be removed at link time with --gc-sections.
  243. '-fdata-sections',
  244. '-ffunction-sections',
  245. ],
  246. 'ldflags': [
  247. # Specifically tell the linker to perform optimizations.
  248. # See http://lwn.net/Articles/192624/ .
  249. '-Wl,-O1',
  250. '-Wl,--as-needed',
  251. '-Wl,--gc-sections',
  252. ],
  253. }], # OS=="linux"
  254. ],
  255. }, # Release_Base
  256. 'conditions': [
  257. ['libchromiumcontent_component', {
  258. 'D': {
  259. 'inherit_from': ['Common_Base', 'Debug_Base'],
  260. }, # D (Debug)
  261. }, {
  262. 'R': {
  263. 'inherit_from': ['Common_Base', 'Release_Base'],
  264. }, # R (Release)
  265. }], # libchromiumcontent_component
  266. ['OS=="win"', {
  267. 'conditions': [
  268. # gyp always assumes "_x64" targets on Windows.
  269. ['libchromiumcontent_component', {
  270. 'D_x64': {
  271. 'inherit_from': ['Common_Base', 'Debug_Base'],
  272. }, # D_x64
  273. }, {
  274. 'R_x64': {
  275. 'inherit_from': ['Common_Base', 'Release_Base'],
  276. }, # R_x64
  277. }], # libchromiumcontent_component
  278. ],
  279. }], # OS=="win"
  280. ],
  281. }, # configurations
  282. 'target_conditions': [
  283. # Putting this under "configurations" doesn't work.
  284. ['libchromiumcontent_component', {
  285. 'xcode_settings': {
  286. 'GCC_OPTIMIZATION_LEVEL': '0',
  287. },
  288. }, { # "Debug_Base"
  289. 'xcode_settings': {
  290. 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
  291. 'GCC_OPTIMIZATION_LEVEL': '2',
  292. 'OTHER_CFLAGS': [
  293. '-fno-inline',
  294. '-fno-omit-frame-pointer',
  295. '-fno-builtin',
  296. '-fno-optimize-sibling-calls',
  297. ],
  298. },
  299. }], # "Release_Base"
  300. ['OS=="mac" and libchromiumcontent_component==0 and _type in ["executable", "shared_library"]', {
  301. 'xcode_settings': {
  302. # Generates symbols and strip the binary.
  303. 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
  304. 'DEPLOYMENT_POSTPROCESSING': 'YES',
  305. 'STRIP_INSTALLED_PRODUCT': 'YES',
  306. 'STRIPFLAGS': '-x',
  307. },
  308. }], # OS=="mac" and libchromiumcontent_component==0 and _type in ["executable", "shared_library"]
  309. ['OS=="linux" and target_arch=="ia32" and _toolset=="target"', {
  310. 'ldflags': [
  311. # Workaround for linker OOM.
  312. '-Wl,--no-keep-memory',
  313. ],
  314. }],
  315. ], # target_conditions
  316. # Ignored compiler warnings of Chromium.
  317. 'conditions': [
  318. ['OS=="mac"', {
  319. 'xcode_settings': {
  320. 'WARNING_CFLAGS': [
  321. '-Wall',
  322. '-Wextra',
  323. '-Wno-unused-parameter',
  324. '-Wno-missing-field-initializers',
  325. '-Wno-deprecated-declarations',
  326. '-Wno-undefined-var-template', # https://crbug.com/604888
  327. '-Wno-unneeded-internal-declaration',
  328. '-Wno-inconsistent-missing-override',
  329. ],
  330. },
  331. }],
  332. ['OS=="linux"', {
  333. 'cflags': [
  334. '-Wno-inconsistent-missing-override',
  335. '-Wno-undefined-var-template', # https://crbug.com/604888
  336. ],
  337. }],
  338. ['OS=="win"', {
  339. 'msvs_disabled_warnings': [
  340. 4100, # unreferenced formal parameter
  341. 4121, # alignment of a member was sensitive to packing
  342. 4127, # conditional expression is constant
  343. 4189, # local variable is initialized but not referenced
  344. 4244, # 'initializing' : conversion from 'double' to 'size_t', possible loss of data
  345. 4245, # 'initializing' : conversion from 'int' to 'const net::QuicVersionTag', signed/unsigned mismatch
  346. 4251, # class 'std::xx' needs to have dll-interface.
  347. 4310, # cast truncates constant value
  348. 4355, # 'this' : used in base member initializer list
  349. 4480, # nonstandard extension used: specifying underlying type for enum
  350. 4481, # nonstandard extension used: override specifier 'override'
  351. 4510, # default constructor could not be generated
  352. 4512, # assignment operator could not be generated
  353. 4610, # user defined constructor required
  354. 4702, # unreachable code
  355. 4819, # The file contains a character that cannot be represented in the current code page
  356. ],
  357. }],
  358. ], # conditions
  359. }, # target_defaults
  360. }