customizing gyp and gypi files of chromium source code to add a new file

chromium, google-chrome

Solution

By convention, included files have the suffix .gypi (gyp include). One single .gyp file may include multiple .gypi files in its includes field. like here:

  'includes': [
    '../build/win/precompile.gypi',
    '../build/features.gypi',
    '../build/scripts/scripts.gypi',
    '../modules/modules.gypi',
    '../bindings/bindings.gypi',
    'core.gypi',
  ],

to find out which code is getting compiled for your platform you can check your code for conditionals like these:

    ['OS=="win"', {
      # In generated bindings code: 'switch contains default but no case'.
      # Disable c4267 warnings until we fix size_t to int truncations.
      'msvs_disabled_warnings': [ 4065, 4267 ],

    'include_dirs': [
      '<@(webcore_include_dirs)',
      '<(DEPTH)/gpu',
      '<(angle_path)/include',
    ],

Problem

I am new to chromium source code. I have few doubt regarding chromium source code make files(gyp, gypi). 1) what is the difference between `.gyp` and `.gypi` files? ``` ./Source/WebCore/WebCore.gyp/WebCore.gyp ./Source/WebCore/WebCore.gyp/gyp/WebCore.gypi ``` 2) How can i check which file is compiling for linux/mac/windows chromium code. Because when i check the file in `.gyp` file i show that it list almost all the files of webcore for mac/linux/android/ etc. above doubt is killing me:(

Original source