config.gypi 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. # This Source Code Form is subject to the terms of the Mozilla Public
  2. # License, v. 2.0. If a copy of the MPL was not distributed with this
  3. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  4. {
  5. 'variables': {
  6. 'module%': '',
  7. 'variables': {
  8. 'variables': {
  9. 'variables': {
  10. 'python%': 'python',
  11. },
  12. # chromium uses pymod_do_main, but gyp doesn't set a sensible
  13. # Python sys.path (gyp_chromium does).
  14. 'python%': '<(python)',
  15. 'host_arch%': '<!(<(python) <(DEPTH)/coreconf/detect_host_arch.py)',
  16. },
  17. 'python%': '<(python)',
  18. 'host_arch%': '<(host_arch)',
  19. 'conditions': [
  20. ['OS=="android"', {
  21. 'target_arch%': 'arm',
  22. }, 'OS=="ios"', {
  23. 'target_arch%': 'arm64',
  24. }, {
  25. # Default architecture we're building for is the architecture we're
  26. # building on.
  27. 'target_arch%': '<(host_arch)',
  28. }],
  29. ['OS=="linux"', {
  30. # FIPS-140 LOWHASH
  31. 'freebl_name': 'freeblpriv3',
  32. }, {
  33. 'freebl_name': 'freebl3',
  34. }],
  35. ['OS=="mac"', {
  36. 'use_system_sqlite%': 1,
  37. },{
  38. 'use_system_sqlite%': 0,
  39. }],
  40. ['OS=="mac" or OS=="ios" or OS=="win"', {
  41. 'cc_use_gnu_ld%': 0,
  42. }, {
  43. 'cc_use_gnu_ld%': 1,
  44. }],
  45. ['OS=="win"', {
  46. 'use_system_zlib%': 0,
  47. 'nspr_libs%': ['libnspr4.lib', 'libplc4.lib', 'libplds4.lib'],
  48. 'zlib_libs%': [],
  49. #TODO
  50. 'moz_debug_flags%': '',
  51. 'dll_prefix': '',
  52. 'dll_suffix': 'dll',
  53. }, {
  54. 'use_system_zlib%': 1,
  55. 'nspr_libs%': ['-lplds4', '-lplc4', '-lnspr4'],
  56. 'zlib_libs%': ['-lz'],
  57. 'dll_prefix': 'lib',
  58. 'conditions': [
  59. ['OS=="mac" or OS=="ios"', {
  60. 'moz_debug_flags%': '-gdwarf-2 -gfull',
  61. 'dll_suffix': 'dylib',
  62. }, {
  63. 'moz_debug_flags%': '-gdwarf-2',
  64. 'dll_suffix': 'so',
  65. }],
  66. ],
  67. }],
  68. ['"<(GENERATOR)"=="ninja"', {
  69. 'cc_is_clang%': '<!(<(python) <(DEPTH)/coreconf/check_cc.py clang)',
  70. }, {
  71. 'cc_is_clang%': '0',
  72. }],
  73. ['"<(GENERATOR)"=="ninja"', {
  74. 'cc_is_gcc%': '<!(<(python) <(DEPTH)/coreconf/check_cc.py gcc)',
  75. }, {
  76. 'cc_is_gcc%': '0',
  77. }],
  78. ],
  79. },
  80. # Copy conditionally-set variables out one scope.
  81. 'python%': '<(python)',
  82. 'host_arch%': '<(host_arch)',
  83. 'target_arch%': '<(target_arch)',
  84. 'use_system_zlib%': '<(use_system_zlib)',
  85. 'zlib_libs%': ['<@(zlib_libs)'],
  86. 'moz_debug_flags%': '<(moz_debug_flags)',
  87. 'nspr_libs%': ['<@(nspr_libs)'],
  88. 'nspr_lib_dir%': '<(nspr_lib_dir)',
  89. 'nspr_include_dir%': '<(nspr_include_dir)',
  90. 'use_system_sqlite%': '<(use_system_sqlite)',
  91. 'sqlite_libs%': ['-lsqlite3'],
  92. 'dll_prefix': '<(dll_prefix)',
  93. 'dll_suffix': '<(dll_suffix)',
  94. 'freebl_name': '<(freebl_name)',
  95. 'cc_is_clang%': '<(cc_is_clang)',
  96. 'cc_is_gcc%': '<(cc_is_gcc)',
  97. 'cc_use_gnu_ld%': '<(cc_use_gnu_ld)',
  98. # Some defaults
  99. 'disable_arm_hw_aes%': 0,
  100. 'disable_tests%': 0,
  101. 'disable_chachapoly%': 0,
  102. 'disable_dbm%': 1,
  103. 'disable_libpkix%': 1,
  104. 'disable_werror%': 0,
  105. 'disable_altivec%': 0,
  106. 'disable_arm32_neon%': 0,
  107. 'mozilla_client%': 0,
  108. 'comm_client%': 0,
  109. 'moz_fold_libs%': 0,
  110. 'moz_folded_library_name%': '',
  111. 'sanitizer_flags%': 0,
  112. 'static_libs%': 0,
  113. 'no_zdefs%': 0,
  114. 'fuzz%': 0,
  115. 'fuzz_tls%': 0,
  116. 'fuzz_oss%': 0,
  117. 'sign_libs%': 1,
  118. 'use_pprof%': 0,
  119. 'ct_verif%': 0,
  120. 'emit_llvm%': 0,
  121. 'nss_public_dist_dir%': '<(nss_dist_dir)/public',
  122. 'nss_private_dist_dir%': '<(nss_dist_dir)/private',
  123. # This is only needed when building with --mozpkix-only and might not work
  124. # on all machines.
  125. 'nss_include_dir%': '/usr/include/nss',
  126. 'only_dev_random%': 1,
  127. 'disable_fips%': 1,
  128. 'mozpkix_only%': 0,
  129. 'coverage%': 0,
  130. 'softfp_cflags%': '',
  131. },
  132. 'target_defaults': {
  133. # Settings specific to targets should go here.
  134. # This is mostly for linking to libraries.
  135. 'variables': {
  136. 'mapfile%': '',
  137. 'static_libs%': 0,
  138. 'debug_optimization_level%': '0',
  139. 'release_optimization_level%': '2',
  140. },
  141. 'standalone_static_library': 0,
  142. 'include_dirs': [
  143. '<(nspr_include_dir)',
  144. '<(nss_dist_dir)/private/<(module)',
  145. ],
  146. 'conditions': [
  147. [ 'mozpkix_only==1 and OS=="linux"', {
  148. 'include_dirs': [
  149. '<(nss_include_dir)',
  150. ],
  151. }],
  152. [ 'disable_fips==1', {
  153. 'defines': [
  154. 'NSS_FIPS_DISABLED',
  155. 'NSS_NO_INIT_SUPPORT',
  156. ],
  157. }],
  158. [ 'OS!="android" and OS!="mac" and OS!="ios" and OS!="win"', {
  159. 'libraries': [
  160. '-lpthread',
  161. ],
  162. }],
  163. [ 'OS=="linux"', {
  164. 'libraries': [
  165. '-ldl',
  166. '-lc',
  167. ],
  168. }],
  169. [ 'OS=="android"', {
  170. 'libraries': [
  171. '-llog',
  172. ],
  173. }],
  174. [ 'fuzz==1', {
  175. 'variables': {
  176. 'debug_optimization_level%': '1',
  177. },
  178. }],
  179. [ 'target_arch=="ia32" or target_arch=="x64"', {
  180. 'defines': [
  181. 'NSS_X86_OR_X64',
  182. ],
  183. # For Windows.
  184. 'msvs_settings': {
  185. 'VCCLCompilerTool': {
  186. 'PreprocessorDefinitions': [
  187. 'NSS_X86_OR_X64',
  188. ],
  189. },
  190. },
  191. }],
  192. [ 'target_arch=="ia32"', {
  193. 'defines': [
  194. 'NSS_X86',
  195. ],
  196. # For Windows.
  197. 'msvs_settings': {
  198. 'VCCLCompilerTool': {
  199. 'PreprocessorDefinitions': [
  200. 'NSS_X86',
  201. ],
  202. },
  203. },
  204. }],
  205. [ 'target_arch=="arm64" or target_arch=="aarch64" or target_arch=="sparc64" or target_arch=="ppc64" or target_arch=="ppc64le" or target_arch=="s390x" or target_arch=="mips64"', {
  206. 'defines': [
  207. 'NSS_USE_64',
  208. ],
  209. }],
  210. [ 'target_arch=="x64"', {
  211. 'defines': [
  212. 'NSS_X64',
  213. 'NSS_USE_64',
  214. ],
  215. # For Windows.
  216. 'msvs_settings': {
  217. 'VCCLCompilerTool': {
  218. 'PreprocessorDefinitions': [
  219. 'NSS_X64',
  220. 'NSS_USE_64',
  221. ],
  222. },
  223. },
  224. }],
  225. ],
  226. 'target_conditions': [
  227. # If we want to properly export a static library, and copy it to lib,
  228. # we need to mark it as a 'standalone_static_library'. Otherwise,
  229. # the relative paths in the thin archive will break linking.
  230. [ '_type=="shared_library"', {
  231. 'product_dir': '<(nss_dist_obj_dir)/lib'
  232. }, '_type=="executable"', {
  233. 'product_dir': '<(nss_dist_obj_dir)/bin'
  234. }, 'static_libs==1 or _standalone_static_library==1', {
  235. 'product_dir': '<(nss_dist_obj_dir)/lib'
  236. }],
  237. # mapfile handling
  238. [ 'mapfile!=""', {
  239. # Work around a gyp bug. Fixed upstream but not in Ubuntu packages:
  240. # https://chromium.googlesource.com/external/gyp/+/b85ad3e578da830377dbc1843aa4fbc5af17a192%5E%21/
  241. 'sources': [
  242. '<(DEPTH)/coreconf/empty.c',
  243. ],
  244. 'xcode_settings': {
  245. 'OTHER_LDFLAGS': [
  246. '-exported_symbols_list',
  247. '<(INTERMEDIATE_DIR)/out.>(mapfile)',
  248. ],
  249. },
  250. 'conditions': [
  251. [ 'cc_use_gnu_ld==1', {
  252. 'ldflags': [
  253. '-Wl,--version-script,<(INTERMEDIATE_DIR)/out.>(mapfile)',
  254. ],
  255. }],
  256. [ 'cc_use_gnu_ld!=1 and OS=="win"', {
  257. # On Windows, .def files are used directly as sources.
  258. 'sources': [
  259. '>(mapfile)',
  260. ],
  261. }, {
  262. # On other platforms, .def files need processing.
  263. 'sources': [
  264. '<(INTERMEDIATE_DIR)/out.>(mapfile)',
  265. ],
  266. 'actions': [{
  267. 'action_name': 'generate_mapfile',
  268. 'inputs': [
  269. '>(mapfile)',
  270. ],
  271. 'outputs': [
  272. '<(INTERMEDIATE_DIR)/out.>(mapfile)',
  273. ],
  274. 'action': ['<@(process_map_file)'],
  275. }],
  276. }]
  277. ],
  278. }, 'static_libs==1 and _type=="shared_library"', {
  279. # When linking a shared lib against a static one, XCode doesn't
  280. # export the latter's symbols by default. -all_load fixes that.
  281. 'xcode_settings': {
  282. 'OTHER_LDFLAGS': [
  283. '-all_load',
  284. ],
  285. },
  286. }],
  287. [ '_type=="shared_library" or _type=="executable"', {
  288. 'libraries': [
  289. '<@(nspr_libs)',
  290. ],
  291. 'library_dirs': [
  292. '<(nspr_lib_dir)',
  293. ],
  294. }],
  295. # Shared library specific settings.
  296. [ '_type=="shared_library"', {
  297. 'conditions': [
  298. [ 'cc_use_gnu_ld==1', {
  299. 'ldflags': [
  300. '-Wl,--gc-sections',
  301. ],
  302. 'conditions': [
  303. ['no_zdefs==0', {
  304. 'ldflags': [
  305. '-Wl,-z,defs',
  306. ],
  307. }],
  308. ],
  309. }],
  310. ],
  311. 'xcode_settings': {
  312. 'DYLIB_INSTALL_NAME_BASE': '@executable_path',
  313. 'DYLIB_COMPATIBILITY_VERSION': '1',
  314. 'DYLIB_CURRENT_VERSION': '1',
  315. 'OTHER_LDFLAGS': [
  316. '-headerpad_max_install_names',
  317. ],
  318. },
  319. 'msvs_settings': {
  320. 'VCLinkerTool': {
  321. 'SubSystem': '2',
  322. },
  323. },
  324. }],
  325. [ '_type=="static_library" and static_libs==1', {
  326. 'standalone_static_library': 1,
  327. }],
  328. ],
  329. 'default_configuration': 'Debug',
  330. 'configurations': {
  331. # Common settings for Debug+Release should go here.
  332. 'Common': {
  333. 'abstract': 1,
  334. 'defines': [
  335. 'USE_UTIL_DIRECTLY',
  336. 'NO_NSPR_10_SUPPORT',
  337. 'SSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES',
  338. ],
  339. 'msvs_configuration_attributes': {
  340. 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
  341. 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
  342. },
  343. 'msvs_settings': {
  344. 'VCCLCompilerTool': {
  345. 'AdditionalIncludeDirectories': ['<(nspr_include_dir)'],
  346. },
  347. },
  348. 'xcode_settings': {
  349. 'CLANG_CXX_LANGUAGE_STANDARD': 'c++0x',
  350. 'OTHER_CFLAGS': [
  351. '-fPIC',
  352. '-fno-common',
  353. '-pipe',
  354. ],
  355. },
  356. 'conditions': [
  357. [ 'OS=="linux" or OS=="android"', {
  358. 'defines': [
  359. 'LINUX2_1',
  360. 'LINUX',
  361. 'linux',
  362. '_DEFAULT_SOURCE', # for <endian.h> functions, strdup, realpath, and getentropy
  363. '_BSD_SOURCE', # for the above in glibc <= 2.19
  364. '_POSIX_SOURCE', # for <signal.h>
  365. 'SQL_MEASURE_USE_TEMP_DIR', # use tmpdir for the access calls
  366. ],
  367. }],
  368. [ 'OS=="dragonfly" or OS=="freebsd"', {
  369. 'defines': [
  370. 'FREEBSD',
  371. ],
  372. }],
  373. [ 'OS=="netbsd"', {
  374. 'defines': [
  375. 'NETBSD',
  376. ],
  377. }],
  378. [ 'OS=="openbsd"', {
  379. 'defines': [
  380. 'OPENBSD',
  381. ],
  382. }],
  383. ['OS=="mac" or OS=="ios" or OS=="dragonfly" or OS=="freebsd" or OS=="netbsd" or OS=="openbsd"', {
  384. 'defines': [
  385. 'HAVE_BSD_FLOCK',
  386. ],
  387. }],
  388. [ 'OS!="win"', {
  389. 'defines': [
  390. 'HAVE_STRERROR',
  391. 'XP_UNIX',
  392. '_REENTRANT',
  393. ],
  394. }],
  395. [ 'OS!="mac" and OS!="ios" and OS!="win"', {
  396. 'cflags': [
  397. '-fPIC',
  398. '-pipe',
  399. '-ffunction-sections',
  400. '-fdata-sections',
  401. ],
  402. 'cflags_c': [
  403. '-std=c99',
  404. ],
  405. 'cflags_cc': [
  406. '-std=c++11',
  407. ],
  408. 'ldflags': [
  409. '-z', 'noexecstack',
  410. ],
  411. 'conditions': [
  412. [ 'target_arch=="ia32"', {
  413. 'cflags': ['-m32'],
  414. 'ldflags': ['-m32'],
  415. }],
  416. [ 'target_arch=="x64"', {
  417. 'cflags': ['-m64'],
  418. 'ldflags': ['-m64'],
  419. }],
  420. ],
  421. }],
  422. [ 'use_pprof==1 and OS!="android" and OS!="win"', {
  423. 'conditions': [
  424. [ 'OS=="mac" or OS=="ios"', {
  425. 'xcode_settings': {
  426. 'OTHER_LDFLAGS': [ '-lprofiler' ],
  427. },
  428. }, {
  429. 'ldflags': [ '-lprofiler' ],
  430. }],
  431. [ 'OS!="linux"', {
  432. 'library_dirs': [
  433. '/usr/local/lib/',
  434. ],
  435. }],
  436. ],
  437. }],
  438. [ 'disable_werror==0 and OS!="android" and OS!="win"', {
  439. 'cflags': [
  440. '<!@(<(python) <(DEPTH)/coreconf/werror.py)',
  441. ],
  442. 'xcode_settings': {
  443. 'OTHER_CFLAGS': [
  444. '<!@(<(python) <(DEPTH)/coreconf/werror.py)',
  445. ],
  446. },
  447. }],
  448. [ 'fuzz_tls==1', {
  449. 'cflags': [
  450. '-Wno-unused-function',
  451. '-Wno-unused-variable',
  452. ],
  453. 'xcode_settings': {
  454. 'OTHER_CFLAGS': [
  455. '-Wno-unused-function',
  456. '-Wno-unused-variable',
  457. ],
  458. },
  459. }],
  460. [ 'sanitizer_flags!=0', {
  461. 'cflags': ['<@(sanitizer_flags)'],
  462. 'ldflags': ['<@(sanitizer_flags)'],
  463. 'xcode_settings': {
  464. 'OTHER_CFLAGS': ['<@(sanitizer_flags)'],
  465. # We want to pass -fsanitize=... to our final link call,
  466. # but not to libtool. OTHER_LDFLAGS is passed to both.
  467. # To trick GYP into doing what we want, we'll piggyback on
  468. # LIBRARY_SEARCH_PATHS, producing "-L/usr/lib -fsanitize=...".
  469. # The -L/usr/lib is redundant but innocuous: it's a default path.
  470. 'LIBRARY_SEARCH_PATHS': ['/usr/lib <(sanitizer_flags)'],
  471. },
  472. }],
  473. [ 'emit_llvm==1', {
  474. 'cflags': ['-flto'],
  475. 'ldflags': ['-flto', '-fuse-ld=gold', '-Wl,-plugin-opt=save-temps'],
  476. }],
  477. [ 'OS=="android" and mozilla_client==0', {
  478. 'defines': [
  479. 'NO_SYSINFO',
  480. 'NO_FORK_CHECK',
  481. 'ANDROID',
  482. ],
  483. }],
  484. [ 'OS=="mac" or OS=="ios"', {
  485. 'defines': [
  486. 'DARWIN',
  487. ],
  488. 'conditions': [
  489. [ 'target_arch=="ia32"', {
  490. 'xcode_settings': {
  491. 'ARCHS': ['i386'],
  492. },
  493. }],
  494. [ 'target_arch=="x64"', {
  495. 'xcode_settings': {
  496. 'ARCHS': ['x86_64'],
  497. },
  498. }],
  499. [ 'target_arch=="arm64"', {
  500. 'xcode_settings': {
  501. 'ARCHS': ['arm64'],
  502. },
  503. }],
  504. ],
  505. }],
  506. [ 'OS=="ios"', {
  507. 'xcode_settings': {
  508. 'IPHONEOS_DEPLOYMENT_TARGET': '<(iphone_deployment_target)',
  509. },
  510. }],
  511. [ 'OS=="win"', {
  512. 'defines': [
  513. '_WINDOWS',
  514. 'WIN95',
  515. '_CRT_SECURE_NO_WARNINGS',
  516. '_CRT_NONSTDC_NO_WARNINGS',
  517. ],
  518. 'cflags': [
  519. '-W3',
  520. '-w44267', # Disable C4267: conversion from 'size_t' to 'type', possible loss of data
  521. '-w44244', # Disable C4244: conversion from 'type1' to 'type2', possible loss of data
  522. '-w44018', # Disable C4018: 'expression' : signed/unsigned mismatch
  523. '-w44312', # Disable C4312: 'type cast': conversion from 'type1' to 'type2' of greater size
  524. ],
  525. 'conditions': [
  526. [ 'disable_werror==0', {
  527. 'cflags': ['-WX']
  528. }],
  529. [ 'target_arch=="ia32"', {
  530. 'msvs_configuration_platform': 'Win32',
  531. 'msvs_settings': {
  532. 'VCLinkerTool': {
  533. 'MinimumRequiredVersion': '5.01', # XP.
  534. 'TargetMachine': '1',
  535. 'ImageHasSafeExceptionHandlers': 'false',
  536. },
  537. 'VCCLCompilerTool': {
  538. 'PreprocessorDefinitions': [
  539. 'WIN32',
  540. ],
  541. 'AdditionalOptions': [ '/EHsc' ],
  542. },
  543. },
  544. }],
  545. [ 'target_arch=="x64"', {
  546. 'msvs_configuration_platform': 'x64',
  547. 'msvs_settings': {
  548. 'VCLinkerTool': {
  549. 'TargetMachine': '17', # x86-64
  550. },
  551. 'VCCLCompilerTool': {
  552. 'PreprocessorDefinitions': [
  553. 'WIN64',
  554. '_AMD64_',
  555. ],
  556. 'AdditionalOptions': [ '/EHsc' ],
  557. },
  558. },
  559. }],
  560. ],
  561. }],
  562. [ 'disable_dbm==1', {
  563. 'defines': [
  564. 'NSS_DISABLE_DBM',
  565. ],
  566. }],
  567. [ 'disable_libpkix==1', {
  568. 'defines': [
  569. 'NSS_DISABLE_LIBPKIX',
  570. ],
  571. }],
  572. ],
  573. },
  574. # Common settings for debug should go here.
  575. 'Debug': {
  576. 'inherit_from': ['Common'],
  577. 'conditions': [
  578. [ 'OS!="mac" and OS!="ios" and OS!="win"', {
  579. 'cflags': [
  580. '-g',
  581. '<(moz_debug_flags)',
  582. ],
  583. }]
  584. ],
  585. #TODO: DEBUG_$USER
  586. 'defines': ['DEBUG'],
  587. 'cflags': [ '-O<(debug_optimization_level)' ],
  588. 'xcode_settings': {
  589. 'COPY_PHASE_STRIP': 'NO',
  590. 'GCC_OPTIMIZATION_LEVEL': '<(debug_optimization_level)',
  591. 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES',
  592. },
  593. 'msvs_settings': {
  594. 'VCCLCompilerTool': {
  595. 'Optimization': '<(debug_optimization_level)',
  596. 'BasicRuntimeChecks': '3',
  597. 'RuntimeLibrary': '2', # /MD
  598. 'DebugInformationFormat': '3',
  599. },
  600. 'VCLinkerTool': {
  601. 'LinkIncremental': '1',
  602. 'GenerateDebugInformation' : 'true',
  603. },
  604. 'VCResourceCompilerTool': {
  605. 'PreprocessorDefinitions': ['DEBUG'],
  606. },
  607. },
  608. },
  609. # Common settings for release should go here.
  610. 'Release': {
  611. 'inherit_from': ['Common'],
  612. 'defines': ['NDEBUG'],
  613. 'cflags': [ '-O<(release_optimization_level)' ],
  614. 'xcode_settings': {
  615. 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
  616. 'GCC_OPTIMIZATION_LEVEL': '<(release_optimization_level)',
  617. },
  618. 'msvs_settings': {
  619. 'VCCLCompilerTool': {
  620. 'Optimization': '<(release_optimization_level)',
  621. 'RuntimeLibrary': '2', # /MD
  622. },
  623. 'VCLinkerTool': {
  624. 'LinkIncremental': '1',
  625. },
  626. },
  627. },
  628. 'conditions': [
  629. [ 'OS=="win"', {
  630. # The gyp ninja backend requires these.
  631. # TODO: either we should support building both 32/64-bit as
  632. # configurations from the same gyp build, or we should fix
  633. # upstream gyp to not require these.
  634. 'Debug_x64': {
  635. 'inherit_from': ['Debug'],
  636. },
  637. 'Release_x64': {
  638. 'inherit_from': ['Release'],
  639. },
  640. }],
  641. ],
  642. },
  643. },
  644. 'conditions': [
  645. [ 'cc_use_gnu_ld==1', {
  646. 'variables': {
  647. 'process_map_file': ['/bin/sh', '-c', '/usr/bin/env grep -v ";-" >(mapfile) | sed -e "s,;+,," -e "s; DATA ;;" -e "s,;;,," -e "s,;.*,;," > >@(_outputs)'],
  648. },
  649. }],
  650. [ 'OS=="mac" or OS=="ios"', {
  651. 'variables': {
  652. 'process_map_file': ['/bin/sh', '-c', '/usr/bin/grep -v ";+" >(mapfile) | grep -v ";-" | sed -e "s; DATA ;;" -e "s,;;,," -e "s,;.*,," -e "s,^,_," > >@(_outputs)'],
  653. },
  654. }],
  655. ],
  656. }