wangyu5 / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

Rules for '.cc', '.cpp', '.c', '.cxx', '.h', '.hxx', '.rc', and '.idl' are not handled on Visual C++ 2010 #244

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a 'none' target with rules for some well-known extensions such as 
"cc" or "h".
2. Generate VS 2010 project from it
3. Build the project

What is the expected output? What do you see instead?
Files with these kinds of extensions should be handled by rules.
No action will be executed actually.

What version of the product are you using? On what operating system?
gyp r1115, Visual C++ 2010 SP1, Windows 7 x64

Please provide any additional information below.
Only Visual C++ 2010 generator seems to have this issue. Visual C++ 2008 
generator works fine.

Here is an example of gyp file:
# Test that the case where the target type is 'none' and input extensions are
# well-known names (such as 'cc' or 'h').
{
  'targets': [
    {
      'target_name': 'files_well_known_ext',
      'type': 'none',
      'msvs_cygwin_shell': 0,
      'sources': [
        'file.h',
        'main.cc',
      ],
      'rules': [
        {
          'rule_name': 'copy_file4',
          'extension': 'cc',
          'inputs': [
            '../copy-file.py',
          ],
          'outputs': [
            '<(RULE_INPUT_ROOT).txt',
          ],
          'action': [
            'python', '<(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
          ],
          'process_outputs_as_sources': 1,
        },
        {
          'rule_name': 'copy_file5',
          'extension': 'h',
          'inputs': [
            '../copy-file.py',
          ],
          'outputs': [
            '<(RULE_INPUT_ROOT).txt',
          ],
          'action': [
            'python', '<(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
          ],
          'process_outputs_as_sources': 1,
        },
      ],
    },
  ],
}

As far as I've investigated, _MapFileToMsBuildSourceType checks well extensions 
specified for rules too late.
http://code.google.com/p/gyp/source/browse/trunk/pylib/gyp/generator/msvs.py?r=1
115#1865
I believe we can check extensions specified for rules first.

Original issue reported on code.google.com by yukawa@google.com on 21 Dec 2011 at 7:59

GoogleCodeExporter commented 9 years ago
Fixed in r1164.
Many thanks for your anticipated help!

Original comment by yukawa@google.com on 18 Jan 2012 at 2:39

GoogleCodeExporter commented 9 years ago
Commit: 447cdee7682311759a75dba44d84cb473fe78ef7
 Email: bradnelson@google.com@78cadc50-ecff-11dd-a971-7dbc132099af

Clone of: http://codereview.chromium.org/9108002/

Submitted for yukawa.

Description:
Currently MSVS 2010 generator ignores rules for some
well-known extensions such as '.h' or '.cc'.
This change set fixes above issue.

This issue is specific to MSVS 2010 generator.
MSVS 2008 generator and generators on other platforms are working fine.

BUG=gyp:244

R=yukawa@google.com
Review URL: https://chromiumcodereview.appspot.com/9178023

git-svn-id: http://gyp.googlecode.com/svn/trunk@1164 
78cadc50-ecff-11dd-a971-7dbc132099af

M   pylib/gyp/generator/msvs.py

Original comment by bugdroid1@chromium.org on 18 Jan 2012 at 5:42

GoogleCodeExporter commented 9 years ago

Original comment by Yuk...@chromium.org on 20 Dec 2012 at 5:01