Commit 2c034784 by John Kessenich

Merge pull request #10 from baldurk/osinclude-common-header

Build: Use common osinclude.h header file that redirects per-platform, remove obsolete build files, enforce relative includes.
parents 085371d9 bc83e64e
......@@ -3,6 +3,8 @@
*.so
*.exe
tags
glslang/MachineIndependent/glslang_tab.cpp
glslang/MachineIndependent/glslang_tab.cpp.h
build/
Test/localResults/
Test/multiThread.out
......
......@@ -7,8 +7,10 @@ project(glslang)
if(WIN32)
set(CMAKE_GENERATOR_TOOLSET "v110" CACHE STRING "Platform Toolset" FORCE)
include(ChooseMSVCCRT.cmake)
add_definitions(-DGLSLANG_OSINCLUDE_WIN32)
elseif(UNIX)
add_definitions(-fPIC)
add_definitions(-DGLSLANG_OSINCLUDE_UNIX)
else(WIN32)
message("unkown platform")
endif(WIN32)
......
cmake_minimum_required(VERSION 2.8)
include_directories(. ../glslang)
if(WIN32)
include_directories(${include_directories} ../glslang/OSDependent/Windows)
elseif(UNIX)
include_directories(${include_directories} ../glslang/OSDependent/Linux)
else(WIN32)
message("unknown platform")
endif(WIN32)
set(SOURCES InitializeDll.cpp InitializeDll.h)
add_library(OGLCompiler STATIC ${SOURCES})
......
......@@ -35,7 +35,7 @@
#define __INITIALIZEDLL_H
#include "osinclude.h"
#include "../glslang/OSDependent/osinclude.h"
namespace glslang {
......
INCLUDE = -I. -I../glslang -I../glslang/Include -I../glslang/OSDependent/Linux -I../glslang/MachineIndependent
WARNINGS = -Wall -Wwrite-strings -Wpointer-arith -Wcast-align -Wstrict-prototypes \
-Wnested-externs
CPP = g++
CPPOPTIONS = -O3 -Wno-deprecated -D_ALT_NS=1 -fPIC
CPPOPTIONS = -g -Wno-deprecated -D_ALT_NS=1 -fPIC
CPPFLAGS = $(CPPOPTIONS) $(INCLUDE)
#
# Linking related
#
AR = ar
STATIC_OPTION = rcs
#
# Misc
#
export PERL = perl
export RM = rm -f
export MV = mv -f
export DEPEND = g++ -M
#
# Object file variables are defined here.
#
OSSRCS = InitializeDll.cpp
OSOBJS = InitializeDll.o
LIBNAME = libInitializeDll.a
all : $(LIBNAME)
$(LIBNAME) : $(OSOBJS)
$(AR) $(STATIC_OPTION) $(LIBNAME) $(OSOBJS)
%.o : %.cpp
$(CPP) $(CPPFLAGS) -c $<
#
# Dependency
#
depend : $(OSSRCS)
$(DEPEND) $(CPPFLAGS) $(OSSRCS) > depend
include depend
#
# Cleanup
#
.PHONY : clean
clean :
$(RM) *.o *.a
......@@ -47,10 +47,6 @@ CMake: The currently maintained and preferred way of building is through CMake.
In MSVC, after running CMake, you may need to use the Configuration Manager to
check the INSTALL project.
Note there are some legacy build methods still intermingled within the directory
structure (make, MSVC), but these are no longer maintained, having been
replaced with CMake.
Programmatic Interfaces
-----------------------
......
cmake_minimum_required(VERSION 2.8)
include_directories(.. ${CMAKE_CURRENT_BINARY_DIR})
set(SOURCES
GlslangToSpv.cpp
SpvBuilder.cpp
......
......@@ -50,7 +50,7 @@
namespace spv {
// Include C-based headers that don't have a namespace
#include "SPIRV/GLSL.std.450.h"
#include "GLSL.std.450.h"
}
const char* GlslStd450DebugNames[spv::GLSLstd450Count];
......
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StandAlone", "StandAlone.vcxproj", "{660D0A05-69A9-4F09-9664-02FBEB08FAE2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glslang", "glslang.vcxproj", "{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug CRT DLL|Win32 = Debug CRT DLL|Win32
Debug CRT DLL|x64 = Debug CRT DLL|x64
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release CRT DLL|Win32 = Release CRT DLL|Win32
Release CRT DLL|x64 = Release CRT DLL|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug CRT DLL|Win32.ActiveCfg = Debug CRT DLL|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug CRT DLL|Win32.Build.0 = Debug CRT DLL|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug CRT DLL|x64.ActiveCfg = Debug CRT DLL|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug CRT DLL|x64.Build.0 = Debug CRT DLL|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|Win32.ActiveCfg = Debug|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|Win32.Build.0 = Debug|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|x64.ActiveCfg = Debug|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|x64.Build.0 = Debug|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release CRT DLL|Win32.ActiveCfg = Release CRT DLL|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release CRT DLL|Win32.Build.0 = Release CRT DLL|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release CRT DLL|x64.ActiveCfg = Release CRT DLL|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release CRT DLL|x64.Build.0 = Release CRT DLL|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|Win32.ActiveCfg = Release|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|Win32.Build.0 = Release|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|x64.ActiveCfg = Release|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|x64.Build.0 = Release|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug CRT DLL|Win32.ActiveCfg = Debug CRT DLL|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug CRT DLL|Win32.Build.0 = Debug CRT DLL|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug CRT DLL|x64.ActiveCfg = Debug CRT DLL|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug CRT DLL|x64.Build.0 = Debug CRT DLL|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|Win32.ActiveCfg = Debug|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|Win32.Build.0 = Debug|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|x64.ActiveCfg = Debug|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|x64.Build.0 = Debug|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release CRT DLL|Win32.ActiveCfg = Release CRT DLL|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release CRT DLL|Win32.Build.0 = Release CRT DLL|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release CRT DLL|x64.ActiveCfg = Release CRT DLL|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release CRT DLL|x64.Build.0 = Release CRT DLL|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|Win32.ActiveCfg = Release|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|Win32.Build.0 = Release|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|x64.ActiveCfg = Release|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{fcd4a310-b19f-40bd-9324-e7d4e7d4dad1}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Standalone\StandAlone.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="glslang\GenericCodeGen\CodeGen.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="glslang\GenericCodeGen\Link.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="StandAlone\Worklist.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
cmake_minimum_required(VERSION 2.8)
include_directories(.)
if(WIN32)
include_directories(../glslang/OSDependent/Windows)
elseif(UNIX)
include_directories(../glslang/OSDependent/Linux)
else(WIN32)
message("unkown platform")
endif(WIN32)
set(SOURCES StandAlone.cpp)
set(REMAPPER_SOURCES spirv-remap.cpp)
......
SRCS := StandAlone.cpp
OBJECTS := $(SRCS:.cpp=.o)
DEPS := $(addprefix ., $(SRCS:.cpp=.d))
OBJECTPATH=./../glslang/MachineIndependent
LIBPATH=./../glslang/MachineIndependent/lib
SRCS=StandAlone.cpp
CXXFLAGS += -fPIC -I../glslang/OSDependent/Linux
all: glslangValidator
glslangValidator: $(OBJECTS) regenlib
$(CC) -g -o $@ $(OBJECTS) -L $(LIBPATH) -lglslang -lpthread -lm -lstdc++
cp $@ ../Test
cp $@ ../Install/Linux
-include $(DEPS)
%.o : %.cpp
$(CXX) $(CXXFLAGS) -MMD -MP -MF $(addprefix ., $(<:.cpp=.d)) -c -o $@ $<
regenlib:
$(MAKE) -C $(OBJECTPATH)
#
# Cleanup
#
.PHONY : clean glslangValidator regenlib
clean :
$(RM) *.o glslangValidator ../Install/Linux/glslangValidator
$(MAKE) -C $(OBJECTPATH) clean
......@@ -49,7 +49,7 @@
#include <stdlib.h>
#include <math.h>
#include "osinclude.h"
#include "../glslang/OSDependent/osinclude.h"
extern "C" {
SH_IMPORT_EXPORT void ShOutputHtml();
......
......@@ -35,7 +35,7 @@
#ifndef WORKLIST_H_INCLUDED
#define WORKLIST_H_INCLUDED
#include "osinclude.h"
#include "../glslang/OSDependent/osinclude.h"
#include <string>
#include <list>
......
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glslang", "glslang_vs2010.vcxproj", "{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StandAlone", "StandAlone_vs2010.vcxproj", "{660D0A05-69A9-4F09-9664-02FBEB08FAE2}"
ProjectSection(ProjectDependencies) = postProject
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3} = {3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|Win32.ActiveCfg = Debug|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|Win32.Build.0 = Debug|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|x64.ActiveCfg = Debug|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|x64.Build.0 = Debug|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|Win32.ActiveCfg = Release|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|Win32.Build.0 = Release|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|x64.ActiveCfg = Release|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|x64.Build.0 = Release|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|Win32.ActiveCfg = Debug|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|Win32.Build.0 = Debug|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|x64.ActiveCfg = Debug|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|x64.Build.0 = Debug|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|Win32.ActiveCfg = Release|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|Win32.Build.0 = Release|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|x64.ActiveCfg = Release|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glslang", "glslang_vs2013.vcxproj", "{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StandAlone", "StandAlone_vs2013.vcxproj", "{660D0A05-69A9-4F09-9664-02FBEB08FAE2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|Win32.ActiveCfg = Debug|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|Win32.Build.0 = Debug|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|x64.ActiveCfg = Debug|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|x64.Build.0 = Debug|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|Win32.ActiveCfg = Release|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|Win32.Build.0 = Release|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|x64.ActiveCfg = Release|x64
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|x64.Build.0 = Release|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|Win32.ActiveCfg = Debug|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|Win32.Build.0 = Debug|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|x64.ActiveCfg = Debug|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|x64.Build.0 = Debug|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|Win32.ActiveCfg = Release|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|Win32.Build.0 = Release|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|x64.ActiveCfg = Release|x64
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Machine Independent">
<UniqueIdentifier>{593f06dd-7981-4cb7-91ba-eae633fa547e}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;y;l</Extensions>
</Filter>
<Filter Include="Machine Independent\Generated Source">
<UniqueIdentifier>{564543b5-6302-49ab-9d24-bd6bef91274a}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{d4faa328-f693-4b77-9fcb-9629ca0d8ee8}</UniqueIdentifier>
</Filter>
<Filter Include="Public">
<UniqueIdentifier>{c79e7f4d-1836-4b72-b201-46e72e4e4b6b}</UniqueIdentifier>
</Filter>
<Filter Include="OSDependent">
<UniqueIdentifier>{d48b8f48-5784-4cb6-bead-7f98647a1c44}</UniqueIdentifier>
</Filter>
<Filter Include="OSDependent\Windows">
<UniqueIdentifier>{092b92ee-743a-407d-ad9b-92af399715d6}</UniqueIdentifier>
</Filter>
<Filter Include="OSDependent\Linux">
<UniqueIdentifier>{0c27903f-6ef2-4725-9d9c-70f50aeaa7a1}</UniqueIdentifier>
</Filter>
<Filter Include="Machine Independent\Preprocessor">
<UniqueIdentifier>{f25a01e9-79ce-49bf-b79a-d10de89a0fec}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="glslang\MachineIndependent\InfoSink.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\Initialize.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="OGLCompilersDLL\InitializeDll.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\IntermTraverse.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\Intermediate.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\ParseHelper.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\PoolAlloc.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\RemoveTree.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\ShaderLang.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\SymbolTable.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\intermOut.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\parseConst.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\OSDependent\Windows\main.cpp">
<Filter>OSDependent\Windows</Filter>
</ClCompile>
<ClCompile Include="glslang\OSDependent\Windows\ossource.cpp">
<Filter>OSDependent\Windows</Filter>
</ClCompile>
<ClCompile Include="glslang\OSDependent\Linux\ossource.cpp">
<Filter>OSDependent\Linux</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\glslang_tab.cpp">
<Filter>Machine Independent\Generated Source</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\Versions.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\Constant.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\Scan.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\preprocessor\Pp.cpp">
<Filter>Machine Independent\Preprocessor</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\preprocessor\PpAtom.cpp">
<Filter>Machine Independent\Preprocessor</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\preprocessor\PpMemory.cpp">
<Filter>Machine Independent\Preprocessor</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\preprocessor\PpScanner.cpp">
<Filter>Machine Independent\Preprocessor</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\preprocessor\PpSymbols.cpp">
<Filter>Machine Independent\Preprocessor</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\preprocessor\PpTokens.cpp">
<Filter>Machine Independent\Preprocessor</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\preprocessor\PpContext.cpp">
<Filter>Machine Independent\Preprocessor</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\limits.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\linkValidate.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
<ClCompile Include="glslang\MachineIndependent\reflection.cpp">
<Filter>Machine Independent</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="glslang\MachineIndependent\Initialize.h">
<Filter>Machine Independent</Filter>
</ClInclude>
<ClInclude Include="glslang\MachineIndependent\ParseHelper.h">
<Filter>Machine Independent</Filter>
</ClInclude>
<ClInclude Include="glslang\MachineIndependent\RemoveTree.h">
<Filter>Machine Independent</Filter>
</ClInclude>
<ClInclude Include="glslang\MachineIndependent\localintermediate.h">
<Filter>Machine Independent</Filter>
</ClInclude>
<ClInclude Include="glslang\Include\BaseTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="glslang\Include\Common.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="glslang\Include\ConstantUnion.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="glslang\Include\InfoSink.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="OGLCompilersDLL\InitializeDll.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="glslang\Include\InitializeGlobals.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="glslang\Include\PoolAlloc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="glslang\Include\ResourceLimits.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="glslang\Include\ShHandle.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="glslang\MachineIndependent\SymbolTable.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="glslang\Include\Types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="glslang\Include\intermediate.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="glslang\Public\ShaderLang.h">
<Filter>Public</Filter>
</ClInclude>
<ClInclude Include="glslang\OSDependent\Windows\osinclude.h">
<Filter>OSDependent\Windows</Filter>
</ClInclude>
<ClInclude Include="glslang\OSDependent\Linux\osinclude.h">
<Filter>OSDependent\Linux</Filter>
</ClInclude>
<ClInclude Include="glslang\MachineIndependent\glslang_tab.cpp.h">
<Filter>Machine Independent\Generated Source</Filter>
</ClInclude>
<ClInclude Include="glslang\MachineIndependent\Versions.h">
<Filter>Machine Independent</Filter>
</ClInclude>
<ClInclude Include="glslang\MachineIndependent\Scan.h">
<Filter>Machine Independent</Filter>
</ClInclude>
<ClInclude Include="glslang\MachineIndependent\ScanContext.h">
<Filter>Machine Independent</Filter>
</ClInclude>
<ClInclude Include="glslang\MachineIndependent\preprocessor\PpContext.h">
<Filter>Machine Independent\Preprocessor</Filter>
</ClInclude>
<ClInclude Include="glslang\MachineIndependent\preprocessor\PpTokens.h">
<Filter>Machine Independent\Preprocessor</Filter>
</ClInclude>
<ClInclude Include="glslang\MachineIndependent\reflection.h">
<Filter>Machine Independent</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="glslang\MachineIndependent\glslang.y">
<Filter>Machine Independent</Filter>
</CustomBuild>
</ItemGroup>
</Project>
cmake_minimum_required(VERSION 2.8)
include_directories(MachineIndependent ../OGLCompilersDLL ${CMAKE_CURRENT_BINARY_DIR})
if(WIN32)
add_subdirectory(OSDependent/Windows)
include_directories(${include_directories} OSDependent/Windows)
elseif(UNIX)
add_subdirectory(OSDependent/Linux)
include_directories(${include_directories} OSDependent/Linux)
add_subdirectory(OSDependent/Unix)
else(WIN32)
message("unkown platform")
endif(WIN32)
......@@ -75,18 +72,18 @@ endif()
# Always use a custom command since our use of --defines isn't assumed by CMake's BISON_TARGET,
# which ends up causing the target to always be rebuilt.
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp.h
COMMAND ${BISON_EXECUTABLE} --defines=${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp.h -t MachineIndependent/glslang.y -o ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp.h
COMMAND ${BISON_EXECUTABLE} --defines=${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp.h -t ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang.y -o ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp
MAIN_DEPENDENCY MachineIndependent/glslang.y
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp)
set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp)
add_library(glslang STATIC ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS})
if(WIN32)
source_group("Public" REGULAR_EXPRESSION "Public/*")
source_group("MachineIndependent" REGULAR_EXPRESSION "MachineIndependent/[^/]*")
source_group("Generated Files" FILES ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp.h)
source_group("Generated Files" FILES MachineIndependent/glslang_tab.cpp MachineIndependent/glslang_tab.cpp.h)
source_group("Include" REGULAR_EXPRESSION "Include/[^/]*")
source_group("GenericCodeGen" REGULAR_EXPRESSION "GenericCodeGen/*")
source_group("MachineIndependent\\Preprocessor" REGULAR_EXPRESSION "MachineIndependent/preprocessor/*")
......
CC = g++
OBJECTS = CodeGen.o Link.o
AR=ar
SRCS=CodeGen.cpp Link.cpp
CPPFLAGS = -fPIC
default : all
all : libCodeGen.a
libCodeGen.a : $(OBJECTS)
$(AR) rvu $@ $(OBJECTS)
ranlib $@
%.o : %.cpp
$(CC) -c $(CPPFLAGS) $<
#
# Cleanup
#
.PHONY : clean
clean :
$(RM) *.o *.a
depend:
makedepend -- $(CFLAGS) -- $(SRCS)
# DO NOT DELETE
CodeGen.o: ../Include/Common.h ../Include/PoolAlloc.h ../Include/ShHandle.h
CodeGen.o: ../Public/ShaderLang.h
CodeGen.o: ../Include/InfoSink.h
Link.o: ../Include/Common.h ../Include/PoolAlloc.h ../Include/ShHandle.h
Link.o: ../Public/ShaderLang.h
Link.o: ../Include/InfoSink.h
INCLUDE = -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL
INCPREPROCESSOR=./preprocessor
INCCODEGEN=./../GenericCodeGen
INCOSDEPENDENT=./../OSDependent/Linux/
INCINITIALISATION=./../../OGLCompilersDLL/
LIBPREPROCESSOR=./preprocessor/libPreprocessor.a
LIBOSDEPENDENT=./../OSDependent/Linux/libOssource.a
LIBINITIALISATION=./../../OGLCompilersDLL/libInitializeDll.a
LIBCODEGEN=./../GenericCodeGen/libCodeGen.a
CXXFLAGS += $(DEFINE) $(INCLUDE) -fPIC
SHAREDOBJECT=./lib/libglslang.so
SRCS= gen_glslang_tab.cpp Initialize.cpp IntermTraverse.cpp \
Intermediate.cpp ParseHelper.cpp PoolAlloc.cpp limits.cpp \
RemoveTree.cpp ShaderLang.cpp SymbolTable.cpp intermOut.cpp \
parseConst.cpp InfoSink.cpp Versions.cpp Constant.cpp Scan.cpp \
linkValidate.cpp reflection.cpp
OBJECTS := $(SRCS:.cpp=.o)
DEPS := $(addprefix ., $(SRCS:.cpp=.d))
all: $(SHAREDOBJECT)
$(SHAREDOBJECT): $(OBJECTS) $(LIBPREPROCESSOR) $(LIBCODEGEN) $(LIBOSDEPENDENT) $(LIBINITIALISATION)
$(CXX) -fPIC -shared -o $@ -rdynamic -Wl,-whole-archive $(OBJECTS) $(LIBPREPROCESSOR) $(LIBCODEGEN) $(LIBOSDEPENDENT) $(LIBINITIALISATION) -Wl,-no-whole-archive
cp $@ ../../Test
cp $@ ../../Install/Linux
gen_glslang_tab.o : gen_glslang_tab.cpp
$(CXX) -fPIC -c $(INCLUDE) gen_glslang_tab.cpp -o $@
gen_glslang_tab.cpp glslang_tab.h: glslang.y
@echo Generating gen_glslang_tab.cpp
bison -t -v -d glslang.y
mv glslang.tab.c gen_glslang_tab.cpp
mv glslang.tab.h glslang_tab.cpp.h
-include $(DEPS)
%.o : %.cpp
$(CXX) $(CXXFLAGS) -MMD -MP -MF $(addprefix ., $(<:.cpp=.d)) -c -o $@ $<
$(LIBPREPROCESSOR):
$(MAKE) -C $(INCPREPROCESSOR)
$(LIBCODEGEN):
$(MAKE) -C $(INCCODEGEN)
$(LIBINITIALISATION):
$(MAKE) -C $(INCINITIALISATION)
$(LIBOSDEPENDENT):
$(MAKE) -C $(INCOSDEPENDENT)
#
# Cleanup
#
clean :
$(RM) *.o *.a gen_glslang_tab.cpp glslang_tab.cpp glslang_tab.cpp.h glslang_tab.h glslang.output
$(RM) ./lib/*.so
$(MAKE) -C $(INCPREPROCESSOR) clean
$(MAKE) -C $(INCCODEGEN) clean
$(MAKE) -C $(INCINITIALISATION) clean
$(MAKE) -C $(INCOSDEPENDENT) clean
.PHONY : clean $(LIBPREPROCESSOR) $(LIBCODEGEN) $(LIBOSDEPENDENT) $(LIBINITIALISATION)
......@@ -37,7 +37,7 @@
#include "ParseHelper.h"
#include "Scan.h"
#include "osinclude.h"
#include "../OSDependent/osinclude.h"
#include <stdarg.h>
#include <algorithm>
......
......@@ -36,7 +36,7 @@
#include "../Include/Common.h"
#include "../Include/InitializeGlobals.h"
#include "osinclude.h"
#include "../OSDependent/osinclude.h"
namespace glslang {
......
INCLUDE = -I../
CXXFLAGS=$(DEFINE) $(INCLUDE) -fPIC
SRCS := PpAtom.cpp PpScanner.cpp PpTokens.cpp Pp.cpp PpContext.cpp PpMemory.cpp PpSymbols.cpp
OBJECTS := $(SRCS:.cpp=.o)
DEPS := $(addprefix ., $(SRCS:.cpp=.d))
all : libPreprocessor.a
libPreprocessor.a : $(OBJECTS)
$(AR) rvu $@ $(OBJECTS)
ranlib $@
-include $(DEPS)
%.o : %.cpp
$(CXX) $(CXXFLAGS) -MMD -MP -MF $(addprefix ., $(<:.cpp=.d)) -c -o $@ $<
#
# Cleanup
#
.PHONY : clean
clean :
$(RM) *.o *.a
####
#### This Makefile should be used in the Linux Compiler build. This Makefile build the OSDependent
#### component as a static library.
####
#
# Compilation related
#
INCLUDE = -I. -I../.. -I../../Include -I../../../OGLCompilersDLL
WARNINGS = -Wall -Wwrite-strings -Wpointer-arith -Wcast-align -Wstrict-prototypes \
-Wnested-externs
CPP = g++
CPPOPTIONS = -O3 -Wno-deprecated -D_ALT_NS=1 -fPIC
CPPOPTIONS = -g -Wno-deprecated -D_ALT_NS=1 -fPIC
CPPFLAGS = $(CPPOPTIONS) $(INCLUDE)
#
# Linking related
#
AR = ar
STATIC_OPTION = rcs
#
# Misc
#
export PERL = perl
export RM = rm -f
export MV = mv -f
export DEPEND = g++ -M
#
# Object file variables are defined here.
#
OSSRCS = ossource.cpp
OSOBJS = ossource.o
LIBNAME = libOssource.a
all : $(LIBNAME)
$(LIBNAME) : $(OSOBJS)
$(AR) $(STATIC_OPTION) $(LIBNAME) $(OSOBJS)
%.o : %.cpp
$(CPP) $(CPPFLAGS) -c $<
#
# Dependency
#
depend : $(OSSRCS)
$(DEPEND) $(CPPFLAGS) $(OSSRCS) > depend
include depend
#
# Cleanup
#
.PHONY : clean
clean :
$(RM) *.o *.a
......@@ -2,8 +2,6 @@
cmake_minimum_required(VERSION 2.8)
include_directories(. ../../../OGLCompilersDLL)
add_library(OSDependent STATIC ossource.cpp osinclude.h)
install(TARGETS OSDependent
......
cmake_minimum_required(VERSION 2.8)
include_directories(. ../../../OGLCompilersDLL)
set(SOURCES ossource.cpp osinclude.h)
add_library(OSDependent STATIC ${SOURCES})
......
//
//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
//All rights reserved.
//
//Redistribution and use in source and binary forms, with or without
//modification, are permitted provided that the following conditions
//are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
//
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
//POSSIBILITY OF SUCH DAMAGE.
//
#ifndef __ROOT_OSINCLUDE_H
#define __ROOT_OSINCLUDE_H
#if defined(GLSLANG_OSINCLUDE_WIN32)
#include "Windows/osinclude.h"
#elif defined(GLSLANG_OSINCLUDE_UNIX)
#include "Unix/osinclude.h"
#else
#error "Unknown platform"
#endif
#endif // __ROOT_OSINCLUDE_H
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