Hash :
29f148b0
        
        Author :
  
        
        Date :
2016-11-23T21:05:36
        
      
Support Vulkan on Linux as well as Windows. Refactor display and surface classes into Win32 and Linux parts and add Linux parts to gn and gyp builds. BUG=angleproject:1668 Change-Id: I2a7d29c35f4f42fa0035bd97938d3770f3627672 Reviewed-on: https://chromium-review.googlesource.com/412426 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458
# Copyright (c) 2010 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
    'includes': [ 'common_defines.gypi', ],
    'variables':
    {
        'angle_path': '<(DEPTH)',
        'angle_build_winrt%': '0',
        'angle_build_winrt_app_type_revision%': '10.0',
        'angle_build_winrt_target_platform_ver%' : '',
        # angle_code is set to 1 for the core ANGLE targets defined in src/build_angle.gyp.
        # angle_code is set to 0 for test code, sample code, and third party code.
        # When angle_code is 1, we build with additional warning flags on Mac and Linux.
        'angle_code%': 0,
        'release_symbols%': 'true',
        'gcc_or_clang_warnings':
        [
            '-Wall',
            '-Wchar-subscripts',
            '-Werror',
            '-Wextra',
            '-Wformat=2',
            '-Winit-self',
            '-Wno-format-nonliteral',
            '-Wno-unknown-pragmas',
            '-Wno-unused-function',
            '-Wno-unused-parameter',
            '-Wpacked',
            '-Wpointer-arith',
            '-Wundef',
            '-Wwrite-strings',
        ],
        'gcc_or_clang_warnings_cc':
        [
            '-Wnon-virtual-dtor',
        ],
        # TODO: Pull chromium's clang dep.
        'clang%': 0,
        'clang_only_warnings':
        [
            '-Wshorten-64-to-32',
        ],
    },
    'target_defaults':
    {
        'default_configuration': 'Debug',
        'variables':
        {
            'warn_as_error%': 1,
        },
        'target_conditions':
        [
            ['warn_as_error == 1',
            {
                'msvs_settings':
                {
                    'VCCLCompilerTool':
                    {
                        'WarnAsError': 'true',
                    },
                    'VCLinkerTool':
                    {
                        'TreatLinkerWarningAsErrors': 'true',
                    },
                },
            }],
        ],
        'conditions':
        [
            ['angle_build_winrt==1',
            {
                'msvs_enable_winrt' : '1',
                'msvs_application_type_revision' : '<(angle_build_winrt_app_type_revision)',
                'msvs_target_platform_version' : '<(angle_build_winrt_target_platform_ver)',
            }],
        ],
        'configurations':
        {
            'Common_Base':
            {
                'abstract': 1,
                # Require the version of the Windows 10 SDK installed on the local machine.
                'msvs_windows_sdk_version': 'v10.0',
                'msvs_configuration_attributes':
                {
                    'OutputDirectory': '$(SolutionDir)$(ConfigurationName)_$(Platform)',
                    'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
                    'CharacterSet': '0',    # ASCII
                },
                'msvs_settings':
                {
                    'VCCLCompilerTool':
                    {
                        # Control Flow Guard is a security feature in Windows
                        # 8.1 and higher designed to prevent exploitation of
                        # indirect calls in executables.
                        # Control Flow Guard is enabled using the /d2guard4
                        # compiler setting in combination with the /guard:cf
                        # linker setting.
                        'AdditionalOptions': ['/MP', '/d2guard4'],
                        'BufferSecurityCheck': 'true',
                        'DebugInformationFormat': '3',
                        'ExceptionHandling': '0',
                        'EnableFunctionLevelLinking': 'true',
                        'MinimalRebuild': 'false',
                        'WarningLevel': '4',
                        'conditions':
                        [
                            ['angle_build_winrt==1',
                            {
                                # Use '/Wv:18' to avoid WRL warnings in VS2015 Update 3
                                # Use /Gw and /Zc:threadSafeInit to avoid
                                # LTCG-related crashes with VS2015 Update 3
                                'AdditionalOptions': ['/Wv:18', '/Gw', '/Zc:threadSafeInit-'],
                            }],
                        ],
                    },
                    'VCLinkerTool':
                    {
                        # Control Flow Guard is a security feature in Windows
                        # 8.1 and higher designed to prevent exploitation of
                        # indirect calls in executables.
                        # Control Flow Guard is enabled using the /d2guard4
                        # compiler setting in combination with the /guard:cf
                        # linker setting.
                        'AdditionalOptions': ['/guard:cf'],
                        'FixedBaseAddress': '1',
                        'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
                        'MapFileName': '$(OutDir)\\$(TargetName).map',
                        # Most of the executables we'll ever create are tests
                        # and utilities with console output.
                        'SubSystem': '1',    # /SUBSYSTEM:CONSOLE
                    },
                    'VCResourceCompilerTool':
                    {
                        'Culture': '1033',
                    },
                },
                'xcode_settings':
                {
                    'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
                },
            },    # Common_Base
            'Debug_Base':
            {
                'abstract': 1,
                'defines':
                [
                    '_DEBUG'
                ],
                'msvs_settings':
                {
                    'VCCLCompilerTool':
                    {
                        'Optimization': '0',    # /Od
                        'BasicRuntimeChecks': '3',
                        'RuntimeTypeInfo': 'true',
                        'conditions':
                        [
                            ['angle_build_winrt==1',
                            {
                                # Use the dynamic C runtime to match
                                # Windows Application Store requirements
                                # The C runtime for Windows Store applications
                                # is a framework package that is managed by
                                # the Windows deployment model and can be
                                # shared by multiple packages.
                                'RuntimeLibrary': '3', # /MDd (debug dll)
                            },
                            {
                                # Use the static C runtime to
                                # match chromium and make sure
                                # we don't depend on the dynamic
                                # runtime's shared heaps
                                'RuntimeLibrary': '1', # /MTd (debug static)
                            }],
                        ],
                    },
                    'VCLinkerTool':
                    {
                        'GenerateDebugInformation': 'true',
                        'LinkIncremental': '2',
                        'conditions':
                        [
                            ['angle_build_winrt==1',
                            {
                                'AdditionalDependencies':
                                [
                                    'dxgi.lib',
                                ],
                                'EnableCOMDATFolding': '1', # disable
                                'OptimizeReferences': '1', # disable
                            }],
                        ],
                    },
                },
                'xcode_settings':
                {
                    'COPY_PHASE_STRIP': 'NO',
                    'GCC_OPTIMIZATION_LEVEL': '0',
                },
            },    # Debug_Base
            'Release_Base':
            {
                'abstract': 1,
                'defines':
                [
                    'NDEBUG'
                ],
                'msvs_settings':
                {
                    'VCCLCompilerTool':
                    {
                        'RuntimeTypeInfo': 'false',
                        'conditions':
                        [
                            ['angle_build_winrt==1',
                            {
                                # Use Chromium's settings for 'Official' builds
                                # to optimize WinRT release builds
                                'Optimization': '1', # /O1, minimize size
                                'FavorSizeOrSpeed': '2', # /Os
                                'WholeProgramOptimization': 'true',
                                # Use the dynamic C runtime to match
                                # Windows Application Store requirements
                                # The C runtime for Windows Store applications
                                # is a framework package that is managed by
                                # the Windows deployment model and can be
                                # shared by multiple packages.
                                'RuntimeLibrary': '2', # /MD (nondebug dll)
                            },
                            {
                                'Optimization': '2', # /O2, maximize speed
                                # Use the static C runtime to
                                # match chromium and make sure
                                # we don't depend on the dynamic
                                'RuntimeLibrary': '0', # /MT (nondebug static)
                            }],
                        ],
                    },
                    'VCLinkerTool':
                    {
                        'GenerateDebugInformation': '<(release_symbols)',
                        'LinkIncremental': '1',
                        'conditions':
                        [
                            ['angle_build_winrt==1',
                            {
                                # Use Chromium's settings for 'Official' builds
                                # to optimize WinRT release builds
                                'LinkTimeCodeGeneration': '1',
                                'AdditionalOptions': ['/cgthreads:8'],
                            }],
                        ],
                    },
                },
            },    # Release_Base
            'x86_Base':
            {
                'abstract': 1,
                'msvs_configuration_platform': 'Win32',
                'msvs_settings':
                {
                    'VCLinkerTool':
                    {
                        'TargetMachine': '1', # x86
                    },
                    'VCLibrarianTool':
                    {
                        'TargetMachine': '1', # x86
                    },
                },
                'defines': [ 'ANGLE_X86_CPU' ],
            }, # x86_Base
            'x64_Base':
            {
                'abstract': 1,
                'msvs_configuration_platform': 'x64',
                'msvs_settings':
                {
                    'VCLinkerTool':
                    {
                        'TargetMachine': '17', # x86 - 64
                    },
                    'VCLibrarianTool':
                    {
                        'TargetMachine': '17', # x86 - 64
                    },
                },
                'defines': [ 'ANGLE_X64_CPU' ],
            },    # x64_Base
            # Concrete configurations
            'Debug':
            {
                'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
            },
            'Release':
            {
                'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
            },
            'conditions':
            [
                ['OS == "win"',
                {
                    'Debug_x64':
                    {
                        'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
                    },
                    'Release_x64':
                    {
                        'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
                    },
                }],
                ['angle_build_winrt==1',
                {
                    'arm_Base':
                    {
                        'abstract': 1,
                        'msvs_configuration_platform': 'ARM',
                        'msvs_settings':
                        {
                            'VCLinkerTool':
                            {
                                'TargetMachine': '3', # ARM
                            },
                            'VCLibrarianTool':
                            {
                                'TargetMachine': '3', # ARM
                            },
                        },
                    }, # arm_Base
                    'Debug_ARM':
                    {
                        'inherit_from': ['Common_Base', 'arm_Base', 'Debug_Base'],
                    },
                    'Release_ARM':
                    {
                        'inherit_from': ['Common_Base', 'arm_Base', 'Release_Base'],
                    },
                }],
            ],
        },    # configurations
    },    # target_defaults
    'conditions':
    [
        ['OS == "win"',
        {
            'target_defaults':
            {
                'msvs_cygwin_dirs': ['../third_party/cygwin'],
            },
        },
        { # OS != win
            'target_defaults':
            {
                'cflags':
                [
                    '-fPIC',
                ],
                'cflags_cc':
                [
                    '-std=c++0x',
                ],
            },
        }],
        ['OS != "win" and OS != "mac"',
        {
            'target_defaults':
            {
                'cflags':
                [
                    '-pthread',
                ],
                'cflags_cc':
                [
                    '-fno-exceptions',
                ],
                'ldflags':
                [
                    '-pthread',
                ],
                'configurations':
                {
                    'Debug':
                    {
                        'variables':
                        {
                            'debug_optimize%': '0',
                        },
                        'defines':
                        [
                            '_DEBUG',
                        ],
                        'cflags':
                        [
                            '-O>(debug_optimize)',
                            '-g',
                        ],
                    }
                },
            },
        }],
        ['angle_code==1',
        {
            'target_defaults':
            {
                'conditions':
                [
                    ['OS == "mac"',
                    {
                        'xcode_settings':
                        {
                            'WARNING_CFLAGS': ['<@(gcc_or_clang_warnings)']
                        },
                    }],
                    ['OS != "win" and OS != "mac"',
                    {
                        'cflags_c':
                        [
                            '<@(gcc_or_clang_warnings)',
                            '-std=c99',
                        ],
                        'cflags_cc':
                        [
                            '<@(gcc_or_clang_warnings_cc)',
                        ],
                        'defines':
                        [
                            'SYSCONFDIR="/etc"',
                            'FALLBACK_CONFIG_DIRS="/etc/xdg"',
                            'FALLBACK_DATA_DIRS="/usr/local/share:/usr/share"',
                        ],
                    }],
                    ['clang==1',
                    {
                        'cflags': ['<@(clang_only_warnings)']
                    }],
                ]
            }
        }],
    ],
}