aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorGeoff Lang <geofflang@chromium.org>2014-04-07 14:21:14 -0400
committerGeoff Lang <geofflang@chromium.org>2014-04-09 13:44:09 +0000
commitd095bdaa16259fa8a701b166ac9803f1cb8a7811 (patch)
tree83f37d5be66da7b5943606a9bae76c9d15c1cced /build
parentf3e6a9e0b9e542ac0512e83bf41f988c3a83f31d (diff)
downloadangle-d095bdaa16259fa8a701b166ac9803f1cb8a7811.tar.gz
Add a common include in the project definitions.
Any projects that may be included by gyp files outside our project (chrome or skia) may not have the same defines or ignored compiler warnings. To make sure that we can always compile, each project now includes a common file with all required definitions and gyp variables. BUG=angleproject:583 Change-Id: I702bee975d0554c51bfa03981920dfb295ffbafa Reviewed-on: https://chromium-review.googlesource.com/189458 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Diffstat (limited to 'build')
-rw-r--r--build/common.gypi50
-rw-r--r--build/common_defines.gypi116
2 files changed, 119 insertions, 47 deletions
diff --git a/build/common.gypi b/build/common.gypi
index a4acb035..68c91ea2 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -3,18 +3,16 @@
# found in the LICENSE file.
{
+ 'includes': [ 'common_defines.gypi', ],
'variables':
{
- 'component%': 'static_library',
'angle_build_tests%': '1',
'angle_build_samples%': '1',
- 'angle_path%': '<(DEPTH)',
# 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',
- 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
'gcc_or_clang_warnings':
[
'-Wall',
@@ -77,18 +75,6 @@
#'ExceptionHandling': '0',
'EnableFunctionLevelLinking': 'true',
'MinimalRebuild': 'false',
- 'PreprocessorDefinitions':
- [
- '_CRT_SECURE_NO_DEPRECATE',
- '_SCL_SECURE_NO_WARNINGS',
- '_HAS_EXCEPTIONS=0',
- '_WIN32_WINNT=0x0600',
- '_WINDOWS',
- 'NOMINMAX',
- 'WIN32',
- 'WIN32_LEAN_AND_MEAN',
- 'WINVER=0x0600',
- ],
'RuntimeTypeInfo': 'false',
'WarningLevel': '4',
},
@@ -100,34 +86,12 @@
# Most of the executables we'll ever create are tests
# and utilities with console output.
'SubSystem': '1', # /SUBSYSTEM:CONSOLE
- 'AdditionalDependencies':
- [
- 'kernel32.lib',
- 'gdi32.lib',
- 'winspool.lib',
- 'comdlg32.lib',
- 'advapi32.lib',
- 'shell32.lib',
- 'ole32.lib',
- 'oleaut32.lib',
- 'user32.lib',
- 'uuid.lib',
- 'odbc32.lib',
- 'odbccp32.lib',
- 'delayimp.lib',
- ],
},
'VCResourceCompilerTool':
{
'Culture': '1033',
},
},
- 'msvs_disabled_warnings': [ 4100, 4127, 4189, 4239, 4244, 4245, 4512, 4702, 4530, 4718 ],
- 'msvs_system_include_dirs':
- [
- '<(windows_sdk_path)/Include/shared',
- '<(windows_sdk_path)/Include/um',
- ],
}, # Common_Base
'Debug_Base':
@@ -138,7 +102,6 @@
'VCCLCompilerTool':
{
'Optimization': '0', # /Od
- 'PreprocessorDefinitions': [ '_DEBUG' ],
'BasicRuntimeChecks': '3',
'RuntimeLibrary': '1', # /MTd (debug static)
},
@@ -163,7 +126,6 @@
'VCCLCompilerTool':
{
'Optimization': '2', # /Os
- 'PreprocessorDefinitions': ['NDEBUG'],
'RuntimeLibrary': '0', # /MT (static)
},
'VCLinkerTool':
@@ -212,7 +174,8 @@
'<(windows_sdk_path)/Lib/win8/um/x64',
],
},
- 'VCLibrarianTool': {
+ 'VCLibrarianTool':
+ {
'AdditionalLibraryDirectories':
[
'<(windows_sdk_path)/Lib/win8/um/x64',
@@ -245,13 +208,6 @@
}],
],
}, # configurations
- 'conditions':
- [
- ['component=="shared_library"',
- {
- 'defines': [ 'COMPONENT_BUILD' ],
- }],
- ],
}, # target_defaults
'conditions':
[
diff --git a/build/common_defines.gypi b/build/common_defines.gypi
new file mode 100644
index 00000000..6d309a4e
--- /dev/null
+++ b/build/common_defines.gypi
@@ -0,0 +1,116 @@
+# Copyright (c) 2014 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.
+
+{
+ 'variables':
+ {
+ 'component%': 'static_library',
+ 'angle_path%': '..',
+ 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
+ },
+ 'defines':
+ [
+ 'NOMINMAX',
+ ],
+ 'msvs_disabled_warnings': [ 4100, 4127, 4189, 4239, 4244, 4245, 4512, 4702, 4530, 4718, 4189, 4267 ],
+ 'msvs_system_include_dirs':
+ [
+ '<(windows_sdk_path)/Include/shared',
+ '<(windows_sdk_path)/Include/um',
+ ],
+ 'msvs_settings':
+ {
+ 'VCCLCompilerTool':
+ {
+ 'PreprocessorDefinitions':
+ [
+ '_CRT_SECURE_NO_DEPRECATE',
+ '_SCL_SECURE_NO_WARNINGS',
+ '_HAS_EXCEPTIONS=0',
+ '_WIN32_WINNT=0x0600',
+ '_WINDOWS',
+ 'WIN32',
+ 'WIN32_LEAN_AND_MEAN',
+ 'WINVER=0x0600',
+ ],
+ },
+ 'VCLinkerTool':
+ {
+ 'AdditionalDependencies':
+ [
+ 'kernel32.lib',
+ 'gdi32.lib',
+ 'winspool.lib',
+ 'comdlg32.lib',
+ 'advapi32.lib',
+ 'shell32.lib',
+ 'ole32.lib',
+ 'oleaut32.lib',
+ 'user32.lib',
+ 'uuid.lib',
+ 'odbc32.lib',
+ 'odbccp32.lib',
+ 'delayimp.lib',
+ ],
+ },
+ },
+ 'configurations':
+ {
+ 'Debug':
+ {
+ 'msvs_settings':
+ {
+ 'VCLinkerTool':
+ {
+ 'AdditionalLibraryDirectories':
+ [
+ '<(windows_sdk_path)/Lib/win8/um/x86',
+ ],
+ },
+ 'VCLibrarianTool':
+ {
+ 'AdditionalLibraryDirectories':
+ [
+ '<(windows_sdk_path)/Lib/win8/um/x86',
+ ],
+ },
+ },
+ 'defines':
+ [
+ '_DEBUG'
+ ],
+ },
+ 'Release':
+ {
+ 'msvs_settings':
+ {
+ 'VCLinkerTool':
+ {
+ 'AdditionalLibraryDirectories':
+ [
+ '<(windows_sdk_path)/Lib/win8/um/x86',
+ ],
+ },
+ 'VCLibrarianTool':
+ {
+ 'AdditionalLibraryDirectories':
+ [
+ '<(windows_sdk_path)/Lib/win8/um/x86',
+ ],
+ },
+ },
+ 'defines':
+ [
+ 'NDEBUG'
+ ],
+ },
+ },
+ 'conditions':
+ [
+ ['component=="shared_library"',
+ {
+ 'defines': [ 'COMPONENT_BUILD' ],
+ }],
+ ],
+}