Commit 8935267f by Jamie Madill

Fix some syntax errors in the gyp build configuration, and make some…

Fix some syntax errors in the gyp build configuration, and make some modifications so the tests should work with chromium in component build. We use a separate static translator for linking directly with unit tests, so they have more direct access to the translator classes. ANGLEBUG=477 BUG= R=shannonwoods@chromium.org, zmo@chromium.org Review URL: https://codereview.appspot.com/13971043
parent e6dcc981
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
'MinimalRebuild': 'false', 'MinimalRebuild': 'false',
'PreprocessorDefinitions': [ 'PreprocessorDefinitions': [
'_CRT_SECURE_NO_DEPRECATE', '_CRT_SECURE_NO_DEPRECATE',
'_SCL_SECURE_NO_DEPRECATE',
'_HAS_EXCEPTIONS=0', '_HAS_EXCEPTIONS=0',
'_WIN32_WINNT=0x0600', '_WIN32_WINNT=0x0600',
'_WINDOWS', '_WINDOWS',
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#ifndef _COMPILER_INTERFACE_INCLUDED_ #ifndef _COMPILER_INTERFACE_INCLUDED_
#define _COMPILER_INTERFACE_INCLUDED_ #define _COMPILER_INTERFACE_INCLUDED_
#if defined(COMPONENT_BUILD) #if (COMPONENT_BUILD)
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
#if defined(COMPILER_IMPLEMENTATION) #if defined(COMPILER_IMPLEMENTATION)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
'target_name': 'essl_to_glsl', 'target_name': 'essl_to_glsl',
'type': 'executable', 'type': 'executable',
'dependencies': [ 'dependencies': [
'../src/build_angle.gyp:translator_glsl', '../src/build_angle.gyp:translator',
], ],
'include_dirs': [ 'include_dirs': [
'../include', '../include',
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
'target_name': 'essl_to_hlsl', 'target_name': 'essl_to_hlsl',
'type': 'executable', 'type': 'executable',
'dependencies': [ 'dependencies': [
'../src/build_angle.gyp:translator_hlsl', '../src/build_angle.gyp:translator',
], ],
'include_dirs': [ 'include_dirs': [
'../include', '../include',
......
...@@ -5,65 +5,7 @@ ...@@ -5,65 +5,7 @@
{ {
'variables': { 'variables': {
'angle_code': 1, 'angle_code': 1,
}, 'translator_sources': [
'target_defaults': {
'defines': [
'ANGLE_DISABLE_TRACE',
'ANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL1',
'ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") }',
],
},
'targets': [
{
'target_name': 'preprocessor',
'type': 'static_library',
'include_dirs': [
],
'sources': [
'compiler/preprocessor/DiagnosticsBase.cpp',
'compiler/preprocessor/DiagnosticsBase.h',
'compiler/preprocessor/DirectiveHandlerBase.cpp',
'compiler/preprocessor/DirectiveHandlerBase.h',
'compiler/preprocessor/DirectiveParser.cpp',
'compiler/preprocessor/DirectiveParser.h',
'compiler/preprocessor/ExpressionParser.cpp',
'compiler/preprocessor/ExpressionParser.h',
'compiler/preprocessor/Input.cpp',
'compiler/preprocessor/Input.h',
'compiler/preprocessor/length_limits.h',
'compiler/preprocessor/Lexer.cpp',
'compiler/preprocessor/Lexer.h',
'compiler/preprocessor/Macro.cpp',
'compiler/preprocessor/Macro.h',
'compiler/preprocessor/MacroExpander.cpp',
'compiler/preprocessor/MacroExpander.h',
'compiler/preprocessor/numeric_lex.h',
'compiler/preprocessor/pp_utils.h',
'compiler/preprocessor/Preprocessor.cpp',
'compiler/preprocessor/Preprocessor.h',
'compiler/preprocessor/SourceLocation.h',
'compiler/preprocessor/Token.cpp',
'compiler/preprocessor/Token.h',
'compiler/preprocessor/Tokenizer.cpp',
'compiler/preprocessor/Tokenizer.h',
],
# TODO(jschuh): http://crbug.com/167187
'msvs_disabled_warnings': [
4267,
],
},
{
'target_name': 'translator_static',
'type': 'static_library',
'dependencies': ['preprocessor'],
'include_dirs': [
'.',
'../include',
],
'defines': [
'COMPILER_IMPLEMENTATION',
],
'sources': [
'compiler/BaseTypes.h', 'compiler/BaseTypes.h',
'compiler/BuiltInFunctionEmulator.cpp', 'compiler/BuiltInFunctionEmulator.cpp',
'compiler/BuiltInFunctionEmulator.h', 'compiler/BuiltInFunctionEmulator.h',
...@@ -110,7 +52,7 @@ ...@@ -110,7 +52,7 @@
'compiler/MMap.h', 'compiler/MMap.h',
'compiler/osinclude.h', 'compiler/osinclude.h',
'compiler/OutputESSL.cpp', 'compiler/OutputESSL.cpp',
'compiler/OutputESSL.h', 'compiler/OutputESSL.h',
'compiler/OutputGLSLBase.cpp', 'compiler/OutputGLSLBase.cpp',
'compiler/OutputGLSLBase.h', 'compiler/OutputGLSLBase.h',
'compiler/OutputGLSL.cpp', 'compiler/OutputGLSL.cpp',
...@@ -170,6 +112,65 @@ ...@@ -170,6 +112,65 @@
'third_party/compiler/ArrayBoundsClamper.cpp', 'third_party/compiler/ArrayBoundsClamper.cpp',
'third_party/compiler/ArrayBoundsClamper.h', 'third_party/compiler/ArrayBoundsClamper.h',
], ],
},
'target_defaults': {
'defines': [
'ANGLE_DISABLE_TRACE',
'ANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL1',
'ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") }',
],
},
'targets': [
{
'target_name': 'preprocessor',
'type': 'static_library',
'include_dirs': [
],
'sources': [
'compiler/preprocessor/DiagnosticsBase.cpp',
'compiler/preprocessor/DiagnosticsBase.h',
'compiler/preprocessor/DirectiveHandlerBase.cpp',
'compiler/preprocessor/DirectiveHandlerBase.h',
'compiler/preprocessor/DirectiveParser.cpp',
'compiler/preprocessor/DirectiveParser.h',
'compiler/preprocessor/ExpressionParser.cpp',
'compiler/preprocessor/ExpressionParser.h',
'compiler/preprocessor/Input.cpp',
'compiler/preprocessor/Input.h',
'compiler/preprocessor/length_limits.h',
'compiler/preprocessor/Lexer.cpp',
'compiler/preprocessor/Lexer.h',
'compiler/preprocessor/Macro.cpp',
'compiler/preprocessor/Macro.h',
'compiler/preprocessor/MacroExpander.cpp',
'compiler/preprocessor/MacroExpander.h',
'compiler/preprocessor/numeric_lex.h',
'compiler/preprocessor/pp_utils.h',
'compiler/preprocessor/Preprocessor.cpp',
'compiler/preprocessor/Preprocessor.h',
'compiler/preprocessor/SourceLocation.h',
'compiler/preprocessor/Token.cpp',
'compiler/preprocessor/Token.h',
'compiler/preprocessor/Tokenizer.cpp',
'compiler/preprocessor/Tokenizer.h',
],
# TODO(jschuh): http://crbug.com/167187
'msvs_disabled_warnings': [
4267,
],
},
{
'target_name': 'translator',
'type': '<(component)',
'dependencies': ['preprocessor'],
'include_dirs': [
'.',
'../include',
],
'defines': [
'COMPILER_IMPLEMENTATION',
],
'sources': ['<@(translator_sources)'],
# TODO(jschuh): http://crbug.com/167187 size_t -> int # TODO(jschuh): http://crbug.com/167187 size_t -> int
'msvs_disabled_warnings': [ 4267 ], 'msvs_disabled_warnings': [ 4267 ],
'conditions': [ 'conditions': [
...@@ -180,17 +181,52 @@ ...@@ -180,17 +181,52 @@
}], }],
], ],
}, },
{
'target_name': 'translator',
'type': '<(component)',
'dependencies': ['translator_static'],
},
# TODO(zmo): once we rid the webkit dependency to tranlator_glsl, # TODO(zmo): once we rid the webkit dependency to tranlator_glsl,
# we can get rid of this translator_glsl. # we can get rid of this translator_glsl.
{ {
'target_name': 'translator_glsl', 'target_name': 'translator_glsl',
'type': '<(component)', 'type': '<(component)',
'dependencies': ['translator_static'], 'dependencies': ['preprocessor'],
'include_dirs': [
'.',
'../include',
],
'defines': [
'COMPILER_IMPLEMENTATION',
],
'sources': ['<@(translator_sources)'],
# TODO(jschuh): http://crbug.com/167187 size_t -> int
'msvs_disabled_warnings': [ 4267 ],
'conditions': [
['OS=="win"', {
'sources': ['compiler/ossource_win.cpp'],
}, { # else: posix
'sources': ['compiler/ossource_posix.cpp'],
}],
],
},
{
'target_name': 'translator_static',
'type': 'static_library',
'dependencies': ['preprocessor'],
'include_dirs': [
'.',
'../include',
],
'defines': [
'COMPILER_IMPLEMENTATION',
'COMPONENT_BUILD=0',
],
'sources': ['<@(translator_sources)'],
# TODO(jschuh): http://crbug.com/167187 size_t -> int
'msvs_disabled_warnings': [ 4267 ],
'conditions': [
['OS=="win"', {
'sources': ['compiler/ossource_win.cpp'],
}, { # else: posix
'sources': ['compiler/ossource_posix.cpp'],
}],
],
}, },
], ],
'conditions': [ 'conditions': [
...@@ -348,6 +384,7 @@ ...@@ -348,6 +384,7 @@
'AdditionalDependencies': [ 'AdditionalDependencies': [
'd3d9.lib', 'd3d9.lib',
'dxguid.lib', 'dxguid.lib',
'%(AdditionalDependencies)',
], ],
} }
}, },
...@@ -386,6 +423,7 @@ ...@@ -386,6 +423,7 @@
'VCLinkerTool': { 'VCLinkerTool': {
'AdditionalDependencies': [ 'AdditionalDependencies': [
'd3d9.lib', 'd3d9.lib',
'%(AdditionalDependencies)',
], ],
} }
}, },
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
}, },
'includes': [ 'includes': [
'preprocessor_tests/preprocessor_tests.gypi', 'preprocessor_tests/preprocessor_tests.gypi',
] ],
'include_dirs': [ 'include_dirs': [
'../src/compiler/preprocessor', '../src/compiler/preprocessor',
'../third_party/googletest/include', '../third_party/googletest/include',
...@@ -53,9 +53,8 @@ ...@@ -53,9 +53,8 @@
{ {
'target_name': 'compiler_tests', 'target_name': 'compiler_tests',
'type': 'executable', 'type': 'executable',
'dependencies': 'dependencies': [
'../src/build_angle.gyp:translator_common', '../src/build_angle.gyp:translator_static',
'../src/build_angle.gyp:translator_glsl',
'gtest', 'gtest',
'gmock', 'gmock',
], ],
...@@ -64,7 +63,7 @@ ...@@ -64,7 +63,7 @@
}, },
'includes': [ 'includes': [
'compiler_tests/compiler_tests.gypi', 'compiler_tests/compiler_tests.gypi',
] ],
'include_dirs': [ 'include_dirs': [
'../include', '../include',
'../src', '../src',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment