Browse Source

Some compiler flags are clang only

Cheng Zhao 7 years ago
parent
commit
0d8cfe8dbe
5 changed files with 38 additions and 15 deletions
  1. 16 8
      brightray/brightray.gyp
  2. 1 1
      brightray/brightray.gypi
  3. 10 5
      common.gypi
  4. 6 1
      electron.gyp
  5. 5 0
      toolchain.gypi

+ 16 - 8
brightray/brightray.gyp

@@ -69,21 +69,29 @@
           },
           'cflags': [
             '<!@(<(pkg-config) --cflags <(linux_system_libraries))',
-            # Needed by using libgtkui:
-            '-Wno-deprecated-register',
-            '-Wno-sentinel',
-          ],
-          'cflags_cc': [
-            '-Wno-reserved-user-defined-literal',
           ],
           'direct_dependent_settings': {
             'cflags': [
               '<!@(<(pkg-config) --cflags <(linux_system_libraries))',
-              '-Wno-deprecated-register',
-              '-Wno-sentinel',
             ],
           },
           'conditions': [
+            ['clang==1', {
+              'cflags_cc': [
+                '-Wno-reserved-user-defined-literal',
+              ],
+              'cflags': [
+                # Needed by using libgtkui:
+                '-Wno-deprecated-register',
+                '-Wno-sentinel',
+              ],
+              'direct_dependent_settings': {
+                'cflags': [
+                  '-Wno-deprecated-register',
+                  '-Wno-sentinel',
+                ],
+              },
+            }],
             ['libchromiumcontent_component', {
               'link_settings': {
                 'libraries': [

+ 1 - 1
brightray/brightray.gypi

@@ -348,7 +348,7 @@
           ],
         },
       }],
-      ['OS=="linux"', {
+      ['OS=="linux" and clang==1', {
         'cflags': [
           '-Wno-inconsistent-missing-override',
           '-Wno-undefined-var-template', # https://crbug.com/604888

+ 10 - 5
common.gypi

@@ -109,22 +109,27 @@
         'conditions': [
           ['OS=="linux"', {
             'cflags': [
-              '-Wno-parentheses-equality',
               '-Wno-unused-function',
-              '-Wno-sometimes-uninitialized',
-              '-Wno-pointer-sign',
-              '-Wno-string-plus-int',
               '-Wno-unused-variable',
               '-Wno-unused-value',
               '-Wno-deprecated-declarations',
               '-Wno-return-type',
-              '-Wno-shift-negative-value',
               '-Wno-format',
               '-Wno-varargs', # https://git.io/v6Olj
               # Required when building as shared library.
               '-fPIC',
             ],
           }],
+          ['OS=="linux" and clang==1', {
+            'cflags': [
+              '-Wno-pointer-sign',
+              '-Wno-parentheses-equality',
+              '-Wno-sometimes-uninitialized',
+              '-Wno-string-plus-int',
+              '-Wno-shift-negative-value',
+              '-Wno-reserved-user-defined-literal',
+            ],
+          }],
         ],
       }],
       ['_target_name=="node"', {

+ 6 - 1
electron.gyp

@@ -358,7 +358,6 @@
           # Required settings of using breakpad.
           'cflags_cc': [
             '-Wno-empty-body',
-            '-Wno-reserved-user-defined-literal',
           ],
           'include_dirs': [
             'vendor/breakpad/src',
@@ -367,6 +366,12 @@
             'vendor/breakpad/breakpad.gyp:breakpad_client',
           ],
         }],  # OS=="linux"
+        ['OS=="linux" and clang==1', {
+          # Required settings of using breakpad.
+          'cflags_cc': [
+            '-Wno-reserved-user-defined-literal',
+          ],
+        }],  # OS=="linux" and clang==1
       ],
     },  # target <(product_name)_lib
     {

+ 5 - 0
toolchain.gypi

@@ -143,6 +143,11 @@
         ['CC.host', '$(CC)'],
         ['CXX.host', '$(CXX)'],
       ],
+      'target_defaults': {
+        'cflags_cc': [
+          '-std=c++11',
+        ],
+      },
     }],
 
     # Specify the SDKROOT.