Commit 29d56fbb by alokp@chromium.org

Added GYP build files. GYP files are needed for integration with chromium and…

Added GYP build files. GYP files are needed for integration with chromium and cross-platform build for glsl translator. It would really be nice if we did not have to maintain two build systems. For now I have only moved the GLSL translator to gyp build system. Please note that the gyp files awkwardly have build_ prefix so they do not conflict with the manually-maintained sln files. Review URL: http://codereview.appspot.com/885043 git-svn-id: https://angleproject.googlecode.com/svn/trunk@98 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 0e3358a6
deps = {
"trunk/third_party/gyp":
"http://gyp.googlecode.com/svn/trunk@800",
}
deps_os = {
"win": {
# Cygwin is required for gyp actions, flex, and bison.
"trunk/third_party/cygwin":
"http://src.chromium.org/svn/trunk/deps/third_party/cygwin@11984",
}
}
hooks = [
{
# A change to a .gyp, .gypi, or to GYP itself should run the generator.
"pattern": ".",
"action": ["python", "trunk/build/gyp_angle"],
},
]
# 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.
{
'targets': [
{
'target_name': 'all',
'type': 'none',
'dependencies': [
# TODO(alokp): build_ prefix should be removed from the gyp files
# as soon as we can get rid of manually-maintained sln files.
# Otherwise auto-generated sln files will overwrite/conflict the
# manually maintained ones.
'../samples/build_samples.gyp:*',
'../src/build_angle.gyp:*',
# '../tests/tests.gyp:*',
],
},
],
}
# Local Variables:
# tab-width:2
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=2 shiftwidth=2:
# 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.
{
'variables': {
'library%': 'static_library',
},
'target_defaults': {
'default_configuration': 'Debug',
'configurations': {
'Common': {
'abstract': 1,
'msvs_configuration_attributes': {
'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
},
'msvs_configuration_platform': 'Win32',
'msvs_settings': {
'VCCLCompilerTool': {
'BufferSecurityCheck': 'true',
'DebugInformationFormat': '3',
'ExceptionHandling': '0',
'EnableFunctionLevelLinking': 'true',
'MinimalRebuild': 'false',
'PreprocessorDefinitions': [
'_CRT_SECURE_NO_DEPRECATE',
'_HAS_EXCEPTIONS=0',
'_HAS_TR1=0',
'_WIN32_WINNT=0x0600',
'_WINDOWS',
'NOMINMAX',
'WIN32',
'WIN32_LEAN_AND_MEAN',
'WINVER=0x0600',
],
'RuntimeTypeInfo': 'false',
'WarningLevel': '3',
},
'VCLinkerTool': {
'FixedBaseAddress': '1',
'GenerateDebugInformation': 'true',
'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
'MapFileName': '$(OutDir)\\$(TargetName).map',
# SubSystem values:
# 0 == not set
# 1 == /SUBSYSTEM:CONSOLE
# 2 == /SUBSYSTEM:WINDOWS
# Most of the executables we'll ever create are tests
# and utilities with console output.
'SubSystem': '1',
},
},
}, # Common
'Debug': {
'inherit_from': ['Common'],
'msvs_settings': {
'VCCLCompilerTool': {
'Optimization': '0', # /Od
'PreprocessorDefinitions': ['_DEBUG'],
'BasicRuntimeChecks': '3',
'RuntimeLibrary': '1', # /MTd (debug static)
},
'VCLinkerTool': {
'LinkIncremental': '2',
},
},
}, # Debug
'Release': {
'inherit_from': ['Common'],
'msvs_settings': {
'VCCLCompilerTool': {
'Optimization': '2', # /Os
'PreprocessorDefinitions': ['NDEBUG'],
'RuntimeLibrary': '0', # /MT (static)
},
'VCLinkerTool': {
'LinkIncremental': '1',
},
},
}, # Release
}, # configurations
}, # target_defaults
'conditions': [
['OS=="win"', {
'target_defaults': {
'msvs_cygwin_dirs': ['../third_party/cygwin'],
},
}]
],
}
# Local Variables:
# tab-width:2
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=2 shiftwidth=2:
#!/usr/bin/python
# 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.
# This script is wrapper for ANGLE that adds some support for how GYP
# is invoked by ANGLE beyond what can be done in the gclient hooks.
import os
import sys
script_dir = os.path.dirname(__file__)
angle_dir = os.path.normpath(os.path.join(script_dir, os.pardir))
sys.path.append(os.path.join(angle_dir, 'third_party', 'gyp', 'pylib'))
import gyp
if __name__ == '__main__':
args = sys.argv[1:]
print 'Updating projects from gyp files...'
sys.stdout.flush()
# Add common.gypi to the include path.
args.append('-I' + os.path.join(script_dir, 'common.gypi'))
# Add all.gyp as the main gyp file to be generated.
args.append(os.path.join(script_dir, 'all.gyp'))
sys.exit(gyp.main(args))
# 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.
{
'targets': [
{
'target_name': 'essl_to_glsl',
'type': 'executable',
'dependencies': [
'../src/build_angle.gyp:translator_glsl',
],
'include_dirs': [
'../include',
],
'sources': [
'translator/translator.cpp',
],
},
],
}
# Local Variables:
# tab-width:2
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=2 shiftwidth=2:
......@@ -61,21 +61,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLESv2", "..\src\libGLES
{5620F0E4-6C43-49BC-A178-B804E1A0C3A7} = {5620F0E4-6C43-49BC-A178-B804E1A0C3A7}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "translator_glsl", "..\src\compiler\translator_glsl.vcproj", "{65DB6E65-00E6-4533-8446-5F623BD94909}"
ProjectSection(ProjectDependencies) = postProject
{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD} = {5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "translator_hlsl", "..\src\compiler\translator_hlsl.vcproj", "{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}"
ProjectSection(ProjectDependencies) = postProject
{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD} = {5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "essl_to_glsl", "translator\essl_to_glsl.vcproj", "{EADEBCCD-65ED-45D1-9E06-949A21EBAB9E}"
ProjectSection(ProjectDependencies) = postProject
{65DB6E65-00E6-4533-8446-5F623BD94909} = {65DB6E65-00E6-4533-8446-5F623BD94909}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "essl_to_hlsl", "translator\essl_to_hlsl.vcproj", "{E12EA115-EBC7-47C2-B651-30A0CE986025}"
ProjectSection(ProjectDependencies) = postProject
{5620F0E4-6C43-49BC-A178-B804E1A0C3A7} = {5620F0E4-6C43-49BC-A178-B804E1A0C3A7}
......@@ -137,18 +127,10 @@ Global
{B5871A7A-968C-42E3-A33B-981E6F448E78}.Debug|Win32.Build.0 = Debug|Win32
{B5871A7A-968C-42E3-A33B-981E6F448E78}.Release|Win32.ActiveCfg = Release|Win32
{B5871A7A-968C-42E3-A33B-981E6F448E78}.Release|Win32.Build.0 = Release|Win32
{65DB6E65-00E6-4533-8446-5F623BD94909}.Debug|Win32.ActiveCfg = Debug|Win32
{65DB6E65-00E6-4533-8446-5F623BD94909}.Debug|Win32.Build.0 = Debug|Win32
{65DB6E65-00E6-4533-8446-5F623BD94909}.Release|Win32.ActiveCfg = Release|Win32
{65DB6E65-00E6-4533-8446-5F623BD94909}.Release|Win32.Build.0 = Release|Win32
{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Debug|Win32.ActiveCfg = Debug|Win32
{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Debug|Win32.Build.0 = Debug|Win32
{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Release|Win32.ActiveCfg = Release|Win32
{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Release|Win32.Build.0 = Release|Win32
{EADEBCCD-65ED-45D1-9E06-949A21EBAB9E}.Debug|Win32.ActiveCfg = Debug|Win32
{EADEBCCD-65ED-45D1-9E06-949A21EBAB9E}.Debug|Win32.Build.0 = Debug|Win32
{EADEBCCD-65ED-45D1-9E06-949A21EBAB9E}.Release|Win32.ActiveCfg = Release|Win32
{EADEBCCD-65ED-45D1-9E06-949A21EBAB9E}.Release|Win32.Build.0 = Release|Win32
{E12EA115-EBC7-47C2-B651-30A0CE986025}.Debug|Win32.ActiveCfg = Debug|Win32
{E12EA115-EBC7-47C2-B651-30A0CE986025}.Debug|Win32.Build.0 = Debug|Win32
{E12EA115-EBC7-47C2-B651-30A0CE986025}.Release|Win32.ActiveCfg = Release|Win32
......
......@@ -11,11 +11,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLESv2", "libGLESv2\libG
{5620F0E4-6C43-49BC-A178-B804E1A0C3A7} = {5620F0E4-6C43-49BC-A178-B804E1A0C3A7}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "translator_glsl", "compiler\translator_glsl.vcproj", "{65DB6E65-00E6-4533-8446-5F623BD94909}"
ProjectSection(ProjectDependencies) = postProject
{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD} = {5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "translator_hlsl", "compiler\translator_hlsl.vcproj", "{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}"
ProjectSection(ProjectDependencies) = postProject
{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD} = {5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}
......@@ -37,10 +32,6 @@ Global
{B5871A7A-968C-42E3-A33B-981E6F448E78}.Debug|Win32.Build.0 = Debug|Win32
{B5871A7A-968C-42E3-A33B-981E6F448E78}.Release|Win32.ActiveCfg = Release|Win32
{B5871A7A-968C-42E3-A33B-981E6F448E78}.Release|Win32.Build.0 = Release|Win32
{65DB6E65-00E6-4533-8446-5F623BD94909}.Debug|Win32.ActiveCfg = Debug|Win32
{65DB6E65-00E6-4533-8446-5F623BD94909}.Debug|Win32.Build.0 = Debug|Win32
{65DB6E65-00E6-4533-8446-5F623BD94909}.Release|Win32.ActiveCfg = Release|Win32
{65DB6E65-00E6-4533-8446-5F623BD94909}.Release|Win32.Build.0 = Release|Win32
{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Debug|Win32.ActiveCfg = Debug|Win32
{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Debug|Win32.Build.0 = Debug|Win32
{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Release|Win32.ActiveCfg = Release|Win32
......
# 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.
{
'variables': {
# Source files common between translator_glsl and translator_hlsl
'translator_common_sources': [
'common/angleutils.h',
'common/debug.cpp',
'common/debug.h',
'compiler/BaseTypes.h',
'compiler/Common.h',
'compiler/ConstantUnion.h',
'compiler/InfoSink.cpp',
'compiler/InfoSink.h',
'compiler/Initialize.cpp',
'compiler/Initialize.h',
'compiler/InitializeDll.cpp',
'compiler/InitializeDll.h',
'compiler/InitializeGlobals.h',
'compiler/InitializeParseContext.h',
'compiler/Intermediate.cpp',
'compiler/intermediate.h',
'compiler/intermOut.cpp',
'compiler/IntermTraverse.cpp',
'compiler/Link.cpp',
'compiler/localintermediate.h',
'compiler/MMap.h',
'compiler/osinclude.h',
'compiler/ossource.cpp',
'compiler/parseConst.cpp',
'compiler/ParseHelper.cpp',
'compiler/ParseHelper.h',
'compiler/PoolAlloc.cpp',
'compiler/PoolAlloc.h',
'compiler/QualifierAlive.cpp',
'compiler/QualifierAlive.h',
'compiler/RemoveTree.cpp',
'compiler/RemoveTree.h',
'compiler/ShaderLang.cpp',
'compiler/ShHandle.h',
'compiler/SymbolTable.cpp',
'compiler/SymbolTable.h',
'compiler/Types.h',
'compiler/unistd.h',
'compiler/preprocessor/atom.c',
'compiler/preprocessor/atom.h',
'compiler/preprocessor/compile.h',
'compiler/preprocessor/cpp.c',
'compiler/preprocessor/cpp.h',
'compiler/preprocessor/cppstruct.c',
'compiler/preprocessor/memory.c',
'compiler/preprocessor/memory.h',
'compiler/preprocessor/parser.h',
'compiler/preprocessor/preprocess.h',
'compiler/preprocessor/scanner.c',
'compiler/preprocessor/scanner.h',
'compiler/preprocessor/slglobals.h',
'compiler/preprocessor/symbols.c',
'compiler/preprocessor/symbols.h',
'compiler/preprocessor/tokens.c',
'compiler/preprocessor/tokens.h',
# Generated files
'compiler/Gen_glslang.cpp',
'compiler/Gen_glslang_tab.cpp',
'compiler/glslang_tab.h',
],
},
'targets': [
{
'target_name': 'translator_glsl',
'type': '<(library)',
'include_dirs': [
'compiler',
'.',
'../include',
],
'sources': [
'<@(translator_common_sources)',
'compiler/CodeGenGLSL.cpp',
'compiler/OutputGLSL.cpp',
'compiler/OutputGLSL.h',
'compiler/TranslatorGLSL.cpp',
'compiler/TranslatorGLSL.h',
],
'actions': [
{
'action_name': 'flex_glslang',
'inputs': ['compiler/glslang.l'],
'outputs': ['compiler/Gen_glslang.cpp'],
'action': [
'flex',
'--noline',
'--outfile=<(_outputs)',
'<(_inputs)',
],
},
{
'action_name': 'bison_glslang',
'inputs': ['compiler/glslang.y'],
'outputs': ['compiler/Gen_glslang_tab.cpp'],
'action': [
'bison',
'--no-lines',
'--defines=compiler/glslang_tab.h',
'--skeleton=yacc.c',
'--output=<(_outputs)',
'<(_inputs)',
],
},
],
},
],
}
# Local Variables:
# tab-width:2
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=2 shiftwidth=2:
......@@ -39,24 +39,23 @@ O [0-7]
#endif
int yy_input(char* buf, int max_size);
TSourceLoc yylineno;
#ifdef _WIN32
extern int yyparse(TParseContext&);
#define YY_DECL int yylex(YYSTYPE* pyylval, TParseContext& parseContext)
#else
extern int yyparse(void*);
#define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal)
#define parseContext (*((TParseContext*)(parseContextLocal)))
#endif
extern int yyparse(void*);
#define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal)
#define parseContext (*((TParseContext*)(parseContextLocal)))
#define YY_INPUT(buf,result,max_size) (result = yy_input(buf, max_size))
%}
/*
TODO(alokp): yylineno is only here to support old flex.exe in compiler/tools.
Remove it when we can exclusively use the newer version.
*/
%option yylineno
%option noyywrap
%option never-interactive
%option outfile="Gen_glslang.cpp"
%x FIELDS
......@@ -308,12 +307,7 @@ int PaParseStrings(char* argv[], int strLen[], int argc, TParseContext& parseCon
yylineno = 1;
if (*cpp->PaStrLen >= 0) {
int ret;
#ifdef _WIN32
ret = yyparse(parseContextLocal);
#else
ret = yyparse((void*)(&parseContextLocal));
#endif
int ret = yyparse((void*)(&parseContextLocal));
if (cpp->CompileError == 1 || parseContextLocal.recoveredFromError || parseContextLocal.numErrors > 0)
return 1;
else
......
......@@ -158,7 +158,7 @@
<Tool
Name="VCCustomBuildTool"
Description="Executing flex on $(InputPath)"
CommandLine="if EXIST $(InputDir)Gen_glslang.cpp del $(InputDir)Gen_glslang.cpp&#x0D;&#x0A;$(InputDir)tools\flex.exe $(InputPath)&#x0D;&#x0A;"
CommandLine="if EXIST $(InputDir)Gen_glslang.cpp del $(InputDir)Gen_glslang.cpp&#x0D;&#x0A;$(InputDir)tools\flex.exe $(InputPath)&#x0D;&#x0A;rename $(InputDir)lex.yy.c Gen_$(InputName).cpp&#x0D;&#x0A;"
AdditionalDependencies="glslang_tab.h"
Outputs="$(InputDir)Gen_glslang.cpp"
/>
......
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="translator_glsl"
ProjectGUID="{65DB6E65-00E6-4533-8446-5F623BD94909}"
RootNamespace="CrossCompilerGLSL"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)\glsl"
ConfigurationType="4"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="./;../;../../include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)\glsl"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="./;../;../../include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\CodeGenGLSL.cpp"
>
</File>
<File
RelativePath=".\OutputGLSL.cpp"
>
</File>
<File
RelativePath=".\TranslatorGLSL.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\OutputGLSL.h"
>
</File>
<File
RelativePath=".\TranslatorGLSL.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
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