yujiahui / gyp

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

Msvs and ninja generators produce different compilation settings with same gyp setup #361

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This bug of course concerns using gyp in chromium project.

1. Add this to <user>/.gyp/include.gypi:

{
  'target_defaults': {
    'configurations': {
      'Release_Base': {
        'variables': {
          'buildtype': 'Official',
        },
      },
    },
  },
}

2. Invoke commands:

  set GYP_GENERATORS=ninja
  ninja -C out/Release ffmpegsumo

Expected that target builds and links successfully but it fails at linking.

Doing this on the other hand works fine:

  set GYP_GENERATORS=msvs
  Build ffmpegsumo in VS in Release mode.

third_party/ffmpeg/ffmpeg.gyp even explicitly forces:
  'release_optimize': '2'
which does not seem to be respected (/O2 is not added to the compilation flags).

These are the compilation flags for ffmpegsumo with included contents of the 
include.gypi (fails):

cflags = /wd4351 /wd4355 /wd4396 /wd4503 /wd4819 /wd4100 /wd4121 /wd4125 $
    /wd4127 /wd4130 /wd4131 /wd4189 /wd4201 /wd4238 /wd4244 /wd4245 /wd4310 $
    /wd4428 /wd4481 /wd4505 /wd4510 /wd4512 /wd4530 /wd4610 /wd4611 /wd4701 $
    /wd4702 /wd4706 /wd4996 /wd4018 /wd4090 /wd4305 /wd4133 /wd4146 /wd4554 $
    /wd4028 /wd4334 /wd4101 /wd4102 /wd4116 /wd4307 /wd4273 /wd4800 /Ob2 $
    /GF /GT /Oy- /Oi /W3 /WX /Zi /GR- /Gy /GS /MT /Oy-

and this is without it (works):

cflags = /wd4351 /wd4355 /wd4396 /wd4503 /wd4819 /wd4100 /wd4121 /wd4125 $
    /wd4127 /wd4130 /wd4131 /wd4189 /wd4201 /wd4238 /wd4244 /wd4245 /wd4310 $
    /wd4428 /wd4481 /wd4505 /wd4510 /wd4512 /wd4530 /wd4610 /wd4611 /wd4701 $
    /wd4702 /wd4706 /wd4996 /wd4018 /wd4090 /wd4305 /wd4133 /wd4146 /wd4554 $
    /wd4028 /wd4334 /wd4101 /wd4102 /wd4116 /wd4307 /wd4273 /wd4800 /wd4251 $
    /O2 /Ob2 /GF /Oy- /W3 /WX /Zi /GR- /Gy /GS /MD /EHsc /Oy-

My mail to chromium-dev have a bit of additional info: 
https://groups.google.com/a/chromium.org/d/msg/chromium-dev/KGAtB1i-RKQ/UfD7-FVr
afYJ

Original issue reported on code.google.com by rchlodni...@opera.com on 14 Aug 2013 at 9:10

GoogleCodeExporter commented 9 years ago

Original comment by scottmg@chromium.org on 15 Aug 2013 at 5:30

GoogleCodeExporter commented 9 years ago
Fixed by https://codereview.chromium.org/23253003/

Original comment by rchlodni...@opera.com on 20 Aug 2013 at 11:44

GoogleCodeExporter commented 9 years ago

Original comment by scottmg@chromium.org on 20 Aug 2013 at 5:06