initial commit
This commit is contained in:
129
samples/asrun/bin/script.as
Normal file
129
samples/asrun/bin/script.as
Normal file
@@ -0,0 +1,129 @@
|
||||
#pragma debug // This turns on debugging, same as the command line argument -d
|
||||
|
||||
/*
|
||||
|
||||
Script must have 'int main()' or 'void main()' as the entry point.
|
||||
|
||||
Some functions that are available:
|
||||
|
||||
void print(const string &in str);
|
||||
array<string> @getCommandLineArgs();
|
||||
void createCoRoutine(coroutine @func, dictionary @args);
|
||||
void yield();
|
||||
|
||||
Some objects that are available:
|
||||
|
||||
funcdef void coroutine(dictionary@)
|
||||
string
|
||||
array<T>
|
||||
dictionary
|
||||
file
|
||||
filesystem
|
||||
|
||||
*/
|
||||
|
||||
string g_str = getDefaultString();
|
||||
|
||||
enum E
|
||||
{
|
||||
VALUE1 = 20,
|
||||
VALUE2 = 30
|
||||
}
|
||||
|
||||
class Test
|
||||
{
|
||||
int a;
|
||||
int b;
|
||||
string c;
|
||||
void method()
|
||||
{
|
||||
print("In Test::method()\n");
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
E val = E(100);
|
||||
array<string> @args = getCommandLineArgs();
|
||||
|
||||
print("Received the following args : " + join(args, "|") + "\n");
|
||||
|
||||
Test t;
|
||||
Test @ht = t;
|
||||
t.method();
|
||||
|
||||
array<int> a;
|
||||
array<int> @ha;
|
||||
|
||||
function();
|
||||
|
||||
// Garbage collection is automatic
|
||||
// Set up a circular reference to prove this
|
||||
{
|
||||
Link @link = Link();
|
||||
@link.next = link;
|
||||
}
|
||||
|
||||
// Use a co-routine to fill an array with objects
|
||||
array<Link@> links;
|
||||
createCoRoutine(fillArray, dictionary = {{'my array', @links}});
|
||||
for( int n = 0; n < 10; n++ )
|
||||
{
|
||||
print("The size of the array is currently " + links.length() + "\n");
|
||||
yield();
|
||||
}
|
||||
|
||||
print("Press enter to exit\n");
|
||||
getInput();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void function()
|
||||
{
|
||||
print("Currently in a different function\n");
|
||||
|
||||
int n = 0;
|
||||
{
|
||||
int n = 1; // This will warn that it is hiding the above variable of the same name
|
||||
string s = "hello";
|
||||
print(s + "\n");
|
||||
}
|
||||
{
|
||||
int n = 2;
|
||||
}
|
||||
}
|
||||
|
||||
// A co-routine
|
||||
void fillArray(dictionary @dict)
|
||||
{
|
||||
array<Link@> @links = cast<array<Link@>>(dict['my array']);
|
||||
for( int n = 0; n < 50; n++ )
|
||||
{
|
||||
links.insertLast(Link());
|
||||
if( n % 10 == 9 )
|
||||
yield();
|
||||
}
|
||||
}
|
||||
|
||||
string getDefaultString()
|
||||
{
|
||||
return "default";
|
||||
}
|
||||
|
||||
class Link
|
||||
{
|
||||
Link @next;
|
||||
}
|
||||
|
||||
class PrintOnDestruct
|
||||
{
|
||||
~PrintOnDestruct()
|
||||
{
|
||||
print("I'm being destroyed now\n");
|
||||
}
|
||||
}
|
||||
|
||||
// This object will only be destroyed after the
|
||||
// script has finished execution.
|
||||
PrintOnDestruct pod;
|
||||
76
samples/asrun/projects/mingw/makefile
Normal file
76
samples/asrun/projects/mingw/makefile
Normal file
@@ -0,0 +1,76 @@
|
||||
# asrun MingW makefile
|
||||
|
||||
CXX = g++
|
||||
CXXFLAGS = -O2 -I../../../../angelscript/include
|
||||
SRCDIR = ../../source
|
||||
OBJDIR = obj
|
||||
|
||||
SRCNAMES = \
|
||||
main.cpp \
|
||||
|
||||
OBJ = $(addprefix $(OBJDIR)/, $(notdir $(SRCNAMES:.cpp=.o))) \
|
||||
obj/scriptarray.o \
|
||||
obj/scripthelper.o \
|
||||
obj/scriptstdstring.o \
|
||||
obj/scriptstdstringutil.o \
|
||||
obj/scriptdictionary.o \
|
||||
obj/scriptfile.o \
|
||||
obj/scriptfilesystem.o \
|
||||
obj/scriptbuilder.o \
|
||||
obj/debugger.o \
|
||||
obj/contextmgr.o \
|
||||
obj/datetime.o
|
||||
|
||||
|
||||
BIN = ../../bin/asrun.exe
|
||||
OBJ_D = $(subst /,\,$(OBJ))
|
||||
BIN_D = $(subst /,\,$(BIN))
|
||||
DELETER = del /f
|
||||
|
||||
all: $(BIN)
|
||||
|
||||
$(BIN): $(OBJ)
|
||||
$(CXX) -static -o $(BIN) $(OBJ) -langelscript -L ../../../../angelscript/lib
|
||||
@echo -------------------------------------------------------------------
|
||||
@echo Done.
|
||||
|
||||
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
obj/scriptarray.o: ../../../../add_on/scriptarray/scriptarray.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
obj/scripthelper.o: ../../../../add_on/scripthelper/scripthelper.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
obj/scriptstdstring.o: ../../../../add_on/scriptstdstring/scriptstdstring.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
obj/scriptstdstringutil.o: ../../../../add_on/scriptstdstring/scriptstdstring_utils.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
obj/scriptdictionary.o: ../../../../add_on/scriptdictionary/scriptdictionary.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
obj/scriptfile.o: ../../../../add_on/scriptfile/scriptfile.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
obj/scriptfilesystem.o: ../../../../add_on/scriptfile/scriptfilesystem.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
obj/scriptbuilder.o: ../../../../add_on/scriptbuilder/scriptbuilder.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
obj/debugger.o: ../../../../add_on/debugger/debugger.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
obj/contextmgr.o: ../../../../add_on/contextmgr/contextmgr.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
obj/datetime.o: ../../../../add_on/datetime/datetime.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
clean:
|
||||
$(DELETER) $(OBJ_D) $(BIN_D)
|
||||
|
||||
.PHONY: all clean
|
||||
20
samples/asrun/projects/msvc2012/asrun.sln
Normal file
20
samples/asrun/projects/msvc2012/asrun.sln
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2012 for Windows Desktop
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asrun", "asrun.vcxproj", "{1454C75F-8CE0-450D-A520-D9D487A37ACD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
197
samples/asrun/projects/msvc2012/asrun.vcxproj
Normal file
197
samples/asrun/projects/msvc2012/asrun.vcxproj
Normal file
@@ -0,0 +1,197 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{271C24EA-8749-48F2-AF08-D428EAA26441}</ProjectGuid>
|
||||
<RootNamespace>asrun</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>11.0.60315.1</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscriptd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscript64d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscript.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscript64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\..\add_on\contextmgr\contextmgr.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\debugger\debugger.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptdictionary\scriptdictionary.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptfile\scriptfilesystem.cpp" />
|
||||
<ClCompile Include="..\..\source\main.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptarray\scriptarray.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptbuilder\scriptbuilder.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptfile\scriptfile.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scripthelper\scripthelper.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptstdstring\scriptstdstring.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptstdstring\scriptstdstring_utils.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\..\add_on\contextmgr\contextmgr.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptdictionary\scriptdictionary.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptfile\scriptfilesystem.h" />
|
||||
<ClInclude Include="..\..\..\..\angelscript\include\angelscript.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\debugger\debugger.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptarray\scriptarray.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptbuilder\scriptbuilder.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptfile\scriptfile.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scripthelper\scripthelper.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptstdstring\scriptstdstring.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
20
samples/asrun/projects/msvc2015/asrun.sln
Normal file
20
samples/asrun/projects/msvc2015/asrun.sln
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2012 for Windows Desktop
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asrun", "asrun.vcxproj", "{1454C75F-8CE0-450D-A520-D9D487A37ACD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
199
samples/asrun/projects/msvc2015/asrun.vcxproj
Normal file
199
samples/asrun/projects/msvc2015/asrun.vcxproj
Normal file
@@ -0,0 +1,199 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{271C24EA-8749-48F2-AF08-D428EAA26441}</ProjectGuid>
|
||||
<RootNamespace>asrun</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>11.0.60315.1</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscriptd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscript64d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscript.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscript64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\..\add_on\contextmgr\contextmgr.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\datetime\datetime.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\debugger\debugger.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptdictionary\scriptdictionary.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptfile\scriptfilesystem.cpp" />
|
||||
<ClCompile Include="..\..\source\main.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptarray\scriptarray.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptbuilder\scriptbuilder.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptfile\scriptfile.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scripthelper\scripthelper.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptstdstring\scriptstdstring.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptstdstring\scriptstdstring_utils.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\..\add_on\contextmgr\contextmgr.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\datetime\datetime.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptdictionary\scriptdictionary.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptfile\scriptfilesystem.h" />
|
||||
<ClInclude Include="..\..\..\..\angelscript\include\angelscript.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\debugger\debugger.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptarray\scriptarray.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptbuilder\scriptbuilder.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptfile\scriptfile.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scripthelper\scripthelper.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptstdstring\scriptstdstring.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
20
samples/asrun/projects/msvc2017/asrun.sln
Normal file
20
samples/asrun/projects/msvc2017/asrun.sln
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2012 for Windows Desktop
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asrun", "asrun.vcxproj", "{1454C75F-8CE0-450D-A520-D9D487A37ACD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
200
samples/asrun/projects/msvc2017/asrun.vcxproj
Normal file
200
samples/asrun/projects/msvc2017/asrun.vcxproj
Normal file
@@ -0,0 +1,200 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{271C24EA-8749-48F2-AF08-D428EAA26441}</ProjectGuid>
|
||||
<RootNamespace>asrun</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>11.0.60315.1</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscriptd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscript64d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscript.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscript64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\..\add_on\contextmgr\contextmgr.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\datetime\datetime.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\debugger\debugger.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptdictionary\scriptdictionary.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptfile\scriptfilesystem.cpp" />
|
||||
<ClCompile Include="..\..\source\main.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptarray\scriptarray.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptbuilder\scriptbuilder.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptfile\scriptfile.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scripthelper\scripthelper.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptstdstring\scriptstdstring.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptstdstring\scriptstdstring_utils.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\..\add_on\contextmgr\contextmgr.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\datetime\datetime.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptdictionary\scriptdictionary.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptfile\scriptfilesystem.h" />
|
||||
<ClInclude Include="..\..\..\..\angelscript\include\angelscript.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\debugger\debugger.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptarray\scriptarray.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptbuilder\scriptbuilder.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptfile\scriptfile.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scripthelper\scripthelper.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptstdstring\scriptstdstring.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
20
samples/asrun/projects/msvc2019/asrun.sln
Normal file
20
samples/asrun/projects/msvc2019/asrun.sln
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2012 for Windows Desktop
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asrun", "asrun.vcxproj", "{1454C75F-8CE0-450D-A520-D9D487A37ACD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
200
samples/asrun/projects/msvc2019/asrun.vcxproj
Normal file
200
samples/asrun/projects/msvc2019/asrun.vcxproj
Normal file
@@ -0,0 +1,200 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{271C24EA-8749-48F2-AF08-D428EAA26441}</ProjectGuid>
|
||||
<RootNamespace>asrun</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>11.0.60315.1</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\..\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscriptd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscript64d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscript.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\angelscript\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>../../../../angelscript/lib/angelscript64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\..\add_on\contextmgr\contextmgr.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\datetime\datetime.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\debugger\debugger.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptdictionary\scriptdictionary.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptfile\scriptfilesystem.cpp" />
|
||||
<ClCompile Include="..\..\source\main.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptarray\scriptarray.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptbuilder\scriptbuilder.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptfile\scriptfile.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scripthelper\scripthelper.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptstdstring\scriptstdstring.cpp" />
|
||||
<ClCompile Include="..\..\..\..\add_on\scriptstdstring\scriptstdstring_utils.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\..\add_on\contextmgr\contextmgr.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\datetime\datetime.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptdictionary\scriptdictionary.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptfile\scriptfilesystem.h" />
|
||||
<ClInclude Include="..\..\..\..\angelscript\include\angelscript.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\debugger\debugger.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptarray\scriptarray.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptbuilder\scriptbuilder.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptfile\scriptfile.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scripthelper\scripthelper.h" />
|
||||
<ClInclude Include="..\..\..\..\add_on\scriptstdstring\scriptstdstring.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
158
samples/asrun/projects/msvc6/msvc6.dsp
Normal file
158
samples/asrun/projects/msvc6/msvc6.dsp
Normal file
@@ -0,0 +1,158 @@
|
||||
# Microsoft Developer Studio Project File - Name="msvc6" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=msvc6 - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "msvc6.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "msvc6.mak" CFG="msvc6 - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "msvc6 - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "msvc6 - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "msvc6 - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../../angelscript/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 ../../../../angelscript/lib/angelscript.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../../bin/asrun.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "msvc6 - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../../angelscript/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ../../../../angelscript/lib/angelscriptd.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../bin/asrun.exe" /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "msvc6 - Win32 Release"
|
||||
# Name "msvc6 - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\add_on\debugger\debugger.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\source\main.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\add_on\scriptarray\scriptarray.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\add_on\scriptbuilder\scriptbuilder.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\add_on\scriptfile\scriptfile.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\add_on\scripthelper\scripthelper.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\add_on\scriptstdstring\scriptstdstring.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\add_on\scriptstdstring\scriptstdstring_utils.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\angelscript\include\angelscript.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\add_on\debugger\debugger.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\add_on\scriptarray\scriptarray.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\add_on\scriptbuilder\scriptbuilder.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\add_on\scriptfile\scriptfile.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\add_on\scripthelper\scripthelper.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\add_on\scriptstdstring\scriptstdstring.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
29
samples/asrun/projects/msvc6/msvc6.dsw
Normal file
29
samples/asrun/projects/msvc6/msvc6.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "msvc6"=.\msvc6.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
20
samples/asrun/projects/msvc9/asrun.sln
Normal file
20
samples/asrun/projects/msvc9/asrun.sln
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C++ Express 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC943}") = "asrun", "asrun.vcproj", "{1454C75F-8CE0-450D-A520-D9D487A37ACD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1454C75F-8CE0-450D-A520-D9D487A37ACD}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
255
samples/asrun/projects/msvc9/asrun.vcproj
Normal file
255
samples/asrun/projects/msvc9/asrun.vcproj
Normal file
@@ -0,0 +1,255 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="asrun"
|
||||
ProjectGUID="{1454C75F-8CE0-450D-A520-D9D487A37ACD}"
|
||||
RootNamespace="asrun"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\angelscript\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="../../../../angelscript/lib/angelscriptd.lib"
|
||||
OutputFile="..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
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="..\..\..\..\angelscript\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="../../../../angelscript/lib/angelscript.lib"
|
||||
OutputFile="..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<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="..\..\..\..\add_on\debugger\debugger.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\main.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\add_on\scriptarray\scriptarray.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\add_on\scriptbuilder\scriptbuilder.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\add_on\scriptfile\scriptfile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\add_on\scripthelper\scripthelper.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\add_on\scriptstdstring\scriptstdstring.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\add_on\scriptstdstring\scriptstdstring_utils.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\..\angelscript\include\angelscript.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\add_on\debugger\debugger.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\add_on\scriptarray\scriptarray.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\add_on\scriptbuilder\scriptbuilder.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\add_on\scriptfile\scriptfile.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\add_on\scripthelper\scripthelper.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\add_on\scriptstdstring\scriptstdstring.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
778
samples/asrun/source/main.cpp
Normal file
778
samples/asrun/source/main.cpp
Normal file
@@ -0,0 +1,778 @@
|
||||
#include <iostream> // cout
|
||||
#include <assert.h> // assert()
|
||||
#include <string.h> // strstr()
|
||||
#include <vector>
|
||||
#include <stdlib.h> // system()
|
||||
#include <stdio.h>
|
||||
#include <direct.h> // _chdir()
|
||||
#include <sstream> // stringstream
|
||||
#include <angelscript.h>
|
||||
#include "../../../add_on/scriptbuilder/scriptbuilder.h"
|
||||
#include "../../../add_on/scriptstdstring/scriptstdstring.h"
|
||||
#include "../../../add_on/scriptarray/scriptarray.h"
|
||||
#include "../../../add_on/scriptdictionary/scriptdictionary.h"
|
||||
#include "../../../add_on/scriptfile/scriptfile.h"
|
||||
#include "../../../add_on/scriptfile/scriptfilesystem.h"
|
||||
#include "../../../add_on/scripthelper/scripthelper.h"
|
||||
#include "../../../add_on/debugger/debugger.h"
|
||||
#include "../../../add_on/contextmgr/contextmgr.h"
|
||||
#include "../../../add_on/datetime/datetime.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h> // WriteConsoleW
|
||||
#include <TlHelp32.h> // CreateToolhelp32Snapshot, Process32First, Process32Next
|
||||
|
||||
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
|
||||
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#include <crtdbg.h> // MSVC debugging routines
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Function prototypes
|
||||
int ConfigureEngine(asIScriptEngine *engine);
|
||||
void InitializeDebugger(asIScriptEngine *engine);
|
||||
int CompileScript(asIScriptEngine *engine, const char *scriptFile);
|
||||
int ExecuteScript(asIScriptEngine *engine, const char *scriptFile);
|
||||
void MessageCallback(const asSMessageInfo *msg, void *param);
|
||||
asIScriptContext *RequestContextCallback(asIScriptEngine *engine, void *param);
|
||||
void ReturnContextCallback(asIScriptEngine *engine, asIScriptContext *ctx, void *param);
|
||||
void PrintString(const string &str);
|
||||
string GetInput();
|
||||
int ExecSystemCmd(const string &cmd);
|
||||
int ExecSystemCmd(const string &str, string &out);
|
||||
CScriptArray *GetCommandLineArgs();
|
||||
void SetWorkDir(const string &file);
|
||||
void WaitForUser();
|
||||
int PragmaCallback(const string &pragmaText, CScriptBuilder &builder, void *userParam);
|
||||
|
||||
// The command line arguments
|
||||
CScriptArray *g_commandLineArgs = 0;
|
||||
int g_argc = 0;
|
||||
char **g_argv = 0;
|
||||
|
||||
// The context manager is used to manage the execution of co-routines
|
||||
CContextMgr *g_ctxMgr = 0;
|
||||
|
||||
// The debugger is used to debug the script
|
||||
bool g_doDebug = false;
|
||||
CDebugger *g_dbg = 0;
|
||||
|
||||
// Context pool
|
||||
vector<asIScriptContext*> g_ctxPool;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
// Tell MSVC to report any memory leaks
|
||||
_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF);
|
||||
_CrtSetReportMode(_CRT_ASSERT,_CRTDBG_MODE_FILE);
|
||||
_CrtSetReportFile(_CRT_ASSERT,_CRTDBG_FILE_STDERR);
|
||||
|
||||
// Use _CrtSetBreakAlloc(n) to find a specific memory leak
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
// Turn on support for virtual terminal sequences to add support for colored text in the console
|
||||
// Ref: https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
|
||||
// Ref: https://stackoverflow.com/questions/2048509/how-to-echo-with-different-colors-in-the-windows-command-line
|
||||
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if (hOut == INVALID_HANDLE_VALUE)
|
||||
return -1;
|
||||
|
||||
DWORD dwMode = 0;
|
||||
if (!GetConsoleMode(hOut, &dwMode))
|
||||
return -1;
|
||||
|
||||
dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
|
||||
if (!SetConsoleMode(hOut, dwMode))
|
||||
return -1;
|
||||
#endif
|
||||
|
||||
int r;
|
||||
|
||||
// Validate the command line arguments
|
||||
bool argsValid = true;
|
||||
if( argc < 2 )
|
||||
argsValid = false;
|
||||
else if( argc == 2 && strcmp(argv[1], "-d") == 0 )
|
||||
argsValid = false;
|
||||
|
||||
if( !argsValid )
|
||||
{
|
||||
cout << "AngelScript command line runner. Version " << ANGELSCRIPT_VERSION_STRING << endl << endl;
|
||||
cout << "Usage: " << endl;
|
||||
cout << "asrun [-d] <script file> [<args>]" << endl;
|
||||
cout << " -d inform if the script should be runned with debug" << endl;
|
||||
cout << " <script file> is the script file that should be runned" << endl;
|
||||
cout << " <args> zero or more args for the script" << endl;
|
||||
|
||||
WaitForUser();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Create the script engine
|
||||
asIScriptEngine *engine = asCreateScriptEngine();
|
||||
if( engine == 0 )
|
||||
{
|
||||
cout << "Failed to create script engine." << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Configure the script engine with all the functions,
|
||||
// and variables that the script should be able to use.
|
||||
r = ConfigureEngine(engine);
|
||||
if( r < 0 ) return -1;
|
||||
|
||||
// Check if the script is to be debugged
|
||||
if( strcmp(argv[1], "-d") == 0 )
|
||||
g_doDebug = true;
|
||||
|
||||
// Store the command line arguments for the script
|
||||
int scriptArg = g_doDebug ? 2 : 1;
|
||||
g_argc = argc - (scriptArg + 1);
|
||||
g_argv = argv + (scriptArg + 1);
|
||||
|
||||
// Set the current work dir according to the script's location
|
||||
SetWorkDir(argv[scriptArg]);
|
||||
|
||||
// Compile the script code
|
||||
r = CompileScript(engine, argv[scriptArg]);
|
||||
if (r < 0)
|
||||
{
|
||||
WaitForUser();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Execute the script
|
||||
r = ExecuteScript(engine, argv[scriptArg]);
|
||||
|
||||
// Shut down the engine
|
||||
if( g_commandLineArgs )
|
||||
g_commandLineArgs->Release();
|
||||
engine->ShutDownAndRelease();
|
||||
|
||||
if (r < 0)
|
||||
WaitForUser();
|
||||
return r;
|
||||
}
|
||||
|
||||
// This message callback is used by the engine to send compiler messages
|
||||
void MessageCallback(const asSMessageInfo *msg, void *param)
|
||||
{
|
||||
const char *type = "ERR ";
|
||||
if( msg->type == asMSGTYPE_WARNING )
|
||||
type = "WARN";
|
||||
else if( msg->type == asMSGTYPE_INFORMATION )
|
||||
type = "INFO";
|
||||
|
||||
printf("%s (%d, %d) : %s : %s\n", msg->section, msg->row, msg->col, type, msg->message);
|
||||
}
|
||||
|
||||
// This function will register the application interface
|
||||
int ConfigureEngine(asIScriptEngine *engine)
|
||||
{
|
||||
int r;
|
||||
|
||||
// The script compiler will send any compiler messages to the callback
|
||||
r = engine->SetMessageCallback(asFUNCTION(MessageCallback), 0, asCALL_CDECL); assert( r >= 0 );
|
||||
|
||||
// Register the standard add-ons that we'll allow the scripts to use
|
||||
RegisterStdString(engine);
|
||||
RegisterScriptArray(engine, false);
|
||||
RegisterStdStringUtils(engine);
|
||||
RegisterScriptDictionary(engine);
|
||||
RegisterScriptDateTime(engine);
|
||||
RegisterScriptFile(engine);
|
||||
RegisterScriptFileSystem(engine);
|
||||
RegisterExceptionRoutines(engine);
|
||||
|
||||
// Register a couple of extra functions for the scripts
|
||||
r = engine->RegisterGlobalFunction("void print(const string &in)", asFUNCTION(PrintString), asCALL_CDECL); assert( r >= 0 );
|
||||
r = engine->RegisterGlobalFunction("string getInput()", asFUNCTION(GetInput), asCALL_CDECL); assert(r >= 0);
|
||||
r = engine->RegisterGlobalFunction("array<string> @getCommandLineArgs()", asFUNCTION(GetCommandLineArgs), asCALL_CDECL); assert( r >= 0 );
|
||||
r = engine->RegisterGlobalFunction("int exec(const string &in)", asFUNCTIONPR(ExecSystemCmd, (const string &), int), asCALL_CDECL); assert( r >= 0 );
|
||||
r = engine->RegisterGlobalFunction("int exec(const string &in, string &out)", asFUNCTIONPR(ExecSystemCmd, (const string &, string &), int), asCALL_CDECL); assert( r >= 0 );
|
||||
|
||||
// Setup the context manager and register the support for co-routines
|
||||
g_ctxMgr = new CContextMgr();
|
||||
g_ctxMgr->RegisterCoRoutineSupport(engine);
|
||||
|
||||
// Tell the engine to use our context pool. This will also
|
||||
// allow us to debug internal script calls made by the engine
|
||||
r = engine->SetContextCallbacks(RequestContextCallback, ReturnContextCallback, 0); assert( r >= 0 );
|
||||
|
||||
// TODO: There should be an option of outputting the engine
|
||||
// configuration for use with the offline compiler asbuild.
|
||||
// It should then be possible to execute pre-compiled bytecode.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// This is the to-string callback for the string type
|
||||
std::string StringToString(void *obj, int /* expandMembers */, CDebugger * /* dbg */)
|
||||
{
|
||||
// We know the received object is a string
|
||||
std::string *val = reinterpret_cast<std::string*>(obj);
|
||||
|
||||
// Format the output string
|
||||
// TODO: Should convert non-readable characters to escape sequences
|
||||
std::stringstream s;
|
||||
s << "(len=" << val->length() << ") \"";
|
||||
if( val->length() < 20 )
|
||||
s << *val << "\"";
|
||||
else
|
||||
s << val->substr(0, 20) << "...";
|
||||
|
||||
return s.str();
|
||||
}
|
||||
|
||||
// This is the to-string callback for the array type
|
||||
// This is generic and will take care of all template instances based on the array template
|
||||
std::string ArrayToString(void *obj, int expandMembers, CDebugger *dbg)
|
||||
{
|
||||
CScriptArray *arr = reinterpret_cast<CScriptArray*>(obj);
|
||||
|
||||
std::stringstream s;
|
||||
s << "(len=" << arr->GetSize() << ")";
|
||||
|
||||
if( expandMembers > 0 )
|
||||
{
|
||||
s << " [";
|
||||
for( asUINT n = 0; n < arr->GetSize(); n++ )
|
||||
{
|
||||
s << dbg->ToString(arr->At(n), arr->GetElementTypeId(), expandMembers - 1, arr->GetArrayObjectType()->GetEngine());
|
||||
if( n < arr->GetSize()-1 )
|
||||
s << ", ";
|
||||
}
|
||||
s << "]";
|
||||
}
|
||||
|
||||
return s.str();
|
||||
}
|
||||
|
||||
// This is the to-string callback for the dictionary type
|
||||
std::string DictionaryToString(void *obj, int expandMembers, CDebugger *dbg)
|
||||
{
|
||||
CScriptDictionary *dic = reinterpret_cast<CScriptDictionary*>(obj);
|
||||
|
||||
std::stringstream s;
|
||||
s << "(len=" << dic->GetSize() << ")";
|
||||
|
||||
if( expandMembers > 0 )
|
||||
{
|
||||
s << " [";
|
||||
asUINT n = 0;
|
||||
for( CScriptDictionary::CIterator it = dic->begin(); it != dic->end(); it++, n++ )
|
||||
{
|
||||
s << "[" << it.GetKey() << "] = ";
|
||||
|
||||
// Get the type and address of the value
|
||||
const void *val = it.GetAddressOfValue();
|
||||
int typeId = it.GetTypeId();
|
||||
|
||||
// Use the engine from the currently active context (if none is active, the debugger
|
||||
// will use the engine held inside it by default, but in an environment where there
|
||||
// multiple engines this might not be the correct instance).
|
||||
asIScriptContext *ctx = asGetActiveContext();
|
||||
|
||||
s << dbg->ToString(const_cast<void*>(val), typeId, expandMembers - 1, ctx ? ctx->GetEngine() : 0);
|
||||
|
||||
if( n < dic->GetSize() - 1 )
|
||||
s << ", ";
|
||||
}
|
||||
s << "]";
|
||||
}
|
||||
|
||||
return s.str();
|
||||
}
|
||||
|
||||
// This is the to-string callback for the dictionary type
|
||||
std::string DateTimeToString(void *obj, int expandMembers, CDebugger *dbg)
|
||||
{
|
||||
CDateTime *dt = reinterpret_cast<CDateTime*>(obj);
|
||||
|
||||
std::stringstream s;
|
||||
s << "{" << dt->getYear() << "-" << dt->getMonth() << "-" << dt->getDay() << " ";
|
||||
s << dt->getHour() << ":" << dt->getMinute() << ":" << dt->getSecond() << "}";
|
||||
|
||||
return s.str();
|
||||
}
|
||||
|
||||
// This function initializes the debugger and let's the user set initial break points
|
||||
void InitializeDebugger(asIScriptEngine *engine)
|
||||
{
|
||||
// Create the debugger instance and store it so the context callback can attach
|
||||
// it to the scripts contexts that will be used to execute the scripts
|
||||
g_dbg = new CDebugger();
|
||||
|
||||
// Let the debugger hold an engine pointer that can be used by the callbacks
|
||||
g_dbg->SetEngine(engine);
|
||||
|
||||
// Register the to-string callbacks so the user can see the contents of strings
|
||||
g_dbg->RegisterToStringCallback(engine->GetTypeInfoByName("string"), StringToString);
|
||||
g_dbg->RegisterToStringCallback(engine->GetTypeInfoByName("array"), ArrayToString);
|
||||
g_dbg->RegisterToStringCallback(engine->GetTypeInfoByName("dictionary"), DictionaryToString);
|
||||
g_dbg->RegisterToStringCallback(engine->GetTypeInfoByName("datetime"), DateTimeToString);
|
||||
|
||||
// Allow the user to initialize the debugging before moving on
|
||||
cout << "Debugging, waiting for commands. Type 'h' for help." << endl;
|
||||
g_dbg->TakeCommands(0);
|
||||
}
|
||||
|
||||
// This is where the script is compiled into bytecode that can be executed
|
||||
int CompileScript(asIScriptEngine *engine, const char *scriptFile)
|
||||
{
|
||||
int r;
|
||||
|
||||
// We will only initialize the global variables once we're
|
||||
// ready to execute, so disable the automatic initialization
|
||||
engine->SetEngineProperty(asEP_INIT_GLOBAL_VARS_AFTER_BUILD, false);
|
||||
|
||||
CScriptBuilder builder;
|
||||
|
||||
// Set the pragma callback so we can detect if the script needs debugging
|
||||
builder.SetPragmaCallback(PragmaCallback, 0);
|
||||
|
||||
// Compile the script
|
||||
r = builder.StartNewModule(engine, "script");
|
||||
if( r < 0 ) return -1;
|
||||
|
||||
r = builder.AddSectionFromFile(scriptFile);
|
||||
if( r < 0 ) return -1;
|
||||
|
||||
r = builder.BuildModule();
|
||||
if( r < 0 )
|
||||
{
|
||||
engine->WriteMessage(scriptFile, 0, 0, asMSGTYPE_ERROR, "Script failed to build");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Execute the script by calling the main() function
|
||||
int ExecuteScript(asIScriptEngine *engine, const char *scriptFile)
|
||||
{
|
||||
asIScriptModule *mod = engine->GetModule("script", asGM_ONLY_IF_EXISTS);
|
||||
if( !mod ) return -1;
|
||||
|
||||
// Find the main function
|
||||
asIScriptFunction *func = mod->GetFunctionByDecl("int main()");
|
||||
if( func == 0 )
|
||||
{
|
||||
// Try again with "void main()"
|
||||
func = mod->GetFunctionByDecl("void main()");
|
||||
}
|
||||
|
||||
if( func == 0 )
|
||||
{
|
||||
engine->WriteMessage(scriptFile, 0, 0, asMSGTYPE_ERROR, "Cannot find 'int main()' or 'void main()'");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(g_doDebug)
|
||||
InitializeDebugger(engine);
|
||||
|
||||
// Once we have the main function, we first need to initialize the global variables
|
||||
// Since we've set up the request context callback we will be able to debug the
|
||||
// initialization without passing in a pre-created context
|
||||
int r = mod->ResetGlobalVars(0);
|
||||
if( r < 0 )
|
||||
{
|
||||
engine->WriteMessage(scriptFile, 0, 0, asMSGTYPE_ERROR, "Failed while initializing global variables");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Set up a context to execute the script
|
||||
// The context manager will request the context from the
|
||||
// pool, which will automatically attach the debugger
|
||||
asIScriptContext *ctx = g_ctxMgr->AddContext(engine, func, true);
|
||||
|
||||
// Execute the script until completion
|
||||
// The script may create co-routines. These will automatically
|
||||
// be managed by the context manager
|
||||
while( g_ctxMgr->ExecuteScripts() );
|
||||
|
||||
// Check if the main script finished normally
|
||||
r = ctx->GetState();
|
||||
if( r != asEXECUTION_FINISHED )
|
||||
{
|
||||
if( r == asEXECUTION_EXCEPTION )
|
||||
{
|
||||
cout << "The script failed with an exception" << endl;
|
||||
cout << GetExceptionInfo(ctx, true).c_str();
|
||||
r = -1;
|
||||
}
|
||||
else if( r == asEXECUTION_ABORTED )
|
||||
{
|
||||
cout << "The script was aborted" << endl;
|
||||
r = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "The script terminated unexpectedly (" << r << ")" << endl;
|
||||
r = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the return value from the script
|
||||
if( func->GetReturnTypeId() == asTYPEID_INT32 )
|
||||
{
|
||||
r = *(int*)ctx->GetAddressOfReturnValue();
|
||||
}
|
||||
else
|
||||
r = 0;
|
||||
}
|
||||
|
||||
// Return the context after retrieving the return value
|
||||
g_ctxMgr->DoneWithContext(ctx);
|
||||
|
||||
// Destroy the context manager
|
||||
if( g_ctxMgr )
|
||||
{
|
||||
delete g_ctxMgr;
|
||||
g_ctxMgr = 0;
|
||||
}
|
||||
|
||||
// Before leaving, allow the engine to clean up remaining objects by
|
||||
// discarding the module and doing a full garbage collection so that
|
||||
// this can also be debugged if desired
|
||||
mod->Discard();
|
||||
engine->GarbageCollect();
|
||||
|
||||
// Release all contexts that have been allocated
|
||||
#if AS_CAN_USE_CPP11
|
||||
for( auto ctx : g_ctxPool )
|
||||
ctx->Release();
|
||||
#else
|
||||
for( size_t n = 0; n < g_ctxPool.size(); n++ )
|
||||
g_ctxPool[n]->Release();
|
||||
#endif
|
||||
|
||||
g_ctxPool.clear();
|
||||
|
||||
// Destroy debugger
|
||||
if( g_dbg )
|
||||
{
|
||||
delete g_dbg;
|
||||
g_dbg = 0;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
// This little function allows the script to print a string to the screen
|
||||
void PrintString(const string &str)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
// Unless the std out has been redirected to file we'll need to allow Windows to convert
|
||||
// the text to the current locale so that characters will be displayed appropriately.
|
||||
HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
DWORD mode = 0;
|
||||
if( console != INVALID_HANDLE_VALUE && GetConsoleMode(console, &mode) != 0 )
|
||||
{
|
||||
// We're writing to a console window, so convert the UTF8 string to UTF16 and write with
|
||||
// WriteConsoleW. Windows will then automatically display the characters correctly according
|
||||
// to the user's settings
|
||||
// TODO: buffer size needs to be dynamic to handle large strings
|
||||
// must split the string correctly between UTF8 unicode sequences
|
||||
wchar_t bufUTF16[100000];
|
||||
MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, bufUTF16, 100000);
|
||||
WriteConsoleW(console, bufUTF16, lstrlenW(bufUTF16), 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// We're writing to a file, so just write the bytes as-is without any conversion
|
||||
cout << str;
|
||||
}
|
||||
#else
|
||||
cout << str;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Retrieve a line from stdin
|
||||
string GetInput()
|
||||
{
|
||||
string line;
|
||||
getline(cin, line);
|
||||
return line;
|
||||
}
|
||||
|
||||
// TODO: Perhaps it might be interesting to implement pipes so that the script can receive input from stdin,
|
||||
// or execute commands that return output similar to how popen is used
|
||||
|
||||
// This function calls the system command, captures the stdout and return the status
|
||||
// Return of -1 indicates an error. Else the return code is the return status of the executed command
|
||||
// ref: https://stackoverflow.com/questions/478898/how-do-i-execute-a-command-and-get-the-output-of-the-command-within-c-using-po
|
||||
int ExecSystemCmd(const string &str, string &out)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
// Convert the command to UTF16 to properly handle unicode path names
|
||||
wchar_t bufUTF16[10000];
|
||||
MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, bufUTF16, 10000);
|
||||
|
||||
// Create a pipe to capture the stdout from the system command
|
||||
HANDLE pipeRead, pipeWrite;
|
||||
SECURITY_ATTRIBUTES secAttr = {0};
|
||||
secAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
secAttr.bInheritHandle = TRUE;
|
||||
secAttr.lpSecurityDescriptor = NULL;
|
||||
if( !CreatePipe(&pipeRead, &pipeWrite, &secAttr, 0) )
|
||||
return -1;
|
||||
|
||||
// Start the process for the system command, informing the pipe to
|
||||
// capture stdout, and also to skip showing the command window
|
||||
STARTUPINFOW si = {0};
|
||||
si.cb = sizeof(STARTUPINFOW);
|
||||
si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
|
||||
si.hStdOutput = pipeWrite;
|
||||
si.hStdError = pipeWrite;
|
||||
si.wShowWindow = SW_HIDE;
|
||||
PROCESS_INFORMATION pi = {0};
|
||||
BOOL success = CreateProcessW(NULL, bufUTF16, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi);
|
||||
if( !success )
|
||||
{
|
||||
CloseHandle(pipeWrite);
|
||||
CloseHandle(pipeRead);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Run the command until the end, while capturing stdout
|
||||
for(;;)
|
||||
{
|
||||
// Wait for a while to allow the process to work
|
||||
DWORD ret = WaitForSingleObject(pi.hProcess, 50);
|
||||
|
||||
// Read from the stdout if there is any data
|
||||
for (;;)
|
||||
{
|
||||
char buf[1024];
|
||||
DWORD readCount = 0;
|
||||
DWORD availCount = 0;
|
||||
|
||||
if( !::PeekNamedPipe(pipeRead, NULL, 0, NULL, &availCount, NULL) )
|
||||
break;
|
||||
|
||||
if( availCount == 0 )
|
||||
break;
|
||||
|
||||
if( !::ReadFile(pipeRead, buf, sizeof(buf) - 1 < availCount ? sizeof(buf) - 1 : availCount, &readCount, NULL) || !readCount )
|
||||
break;
|
||||
|
||||
buf[readCount] = 0;
|
||||
out += buf;
|
||||
}
|
||||
|
||||
// End the loop if the process finished
|
||||
if( ret == WAIT_OBJECT_0 )
|
||||
break;
|
||||
}
|
||||
|
||||
// Get the return status from the process
|
||||
DWORD status = 0;
|
||||
GetExitCodeProcess(pi.hProcess, &status);
|
||||
|
||||
CloseHandle(pipeRead);
|
||||
CloseHandle(pipeWrite);
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
|
||||
return status;
|
||||
#else
|
||||
// TODO: Implement suppor for ExecSystemCmd(const string &, string&) on non-Windows platforms
|
||||
asIScriptContext *ctx = asGetActiveContext();
|
||||
if( ctx )
|
||||
ctx->SetException("Oops! This is not yet implemented on non-Windows platforms. Sorry!\n");
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
// This function simply calls the system command and returns the status
|
||||
// Return of -1 indicates an error. Else the return code is the return status of the executed command
|
||||
int ExecSystemCmd(const string &str)
|
||||
{
|
||||
// Check if the command line processor is available
|
||||
if( system(0) == 0 )
|
||||
{
|
||||
asIScriptContext *ctx = asGetActiveContext();
|
||||
if( ctx )
|
||||
ctx->SetException("Command interpreter not available\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
// Convert the command to UTF16 to properly handle unicode path names
|
||||
wchar_t bufUTF16[10000];
|
||||
MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, bufUTF16, 10000);
|
||||
return _wsystem(bufUTF16);
|
||||
#else
|
||||
return system(cmd.c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
// This function returns the command line arguments that were passed to the script
|
||||
CScriptArray *GetCommandLineArgs()
|
||||
{
|
||||
if( g_commandLineArgs )
|
||||
{
|
||||
g_commandLineArgs->AddRef();
|
||||
return g_commandLineArgs;
|
||||
}
|
||||
|
||||
// Obtain a pointer to the engine
|
||||
asIScriptContext *ctx = asGetActiveContext();
|
||||
asIScriptEngine *engine = ctx->GetEngine();
|
||||
|
||||
// Create the array object
|
||||
asITypeInfo *arrayType = engine->GetTypeInfoById(engine->GetTypeIdByDecl("array<string>"));
|
||||
g_commandLineArgs = CScriptArray::Create(arrayType, (asUINT)0);
|
||||
|
||||
// Find the existence of the delimiter in the input string
|
||||
for( int n = 0; n < g_argc; n++ )
|
||||
{
|
||||
// Add the arg to the array
|
||||
g_commandLineArgs->Resize(g_commandLineArgs->GetSize()+1);
|
||||
((string*)g_commandLineArgs->At(n))->assign(g_argv[n]);
|
||||
}
|
||||
|
||||
// Return the array by handle
|
||||
g_commandLineArgs->AddRef();
|
||||
return g_commandLineArgs;
|
||||
}
|
||||
|
||||
// This function is called by the engine whenever a context is needed for an
|
||||
// execution we use it to pool contexts and to attach the debugger if needed.
|
||||
asIScriptContext *RequestContextCallback(asIScriptEngine *engine, void * /*param*/)
|
||||
{
|
||||
asIScriptContext *ctx = 0;
|
||||
|
||||
// Check if there is a free context available in the pool
|
||||
if( g_ctxPool.size() )
|
||||
{
|
||||
ctx = g_ctxPool.back();
|
||||
g_ctxPool.pop_back();
|
||||
}
|
||||
else
|
||||
{
|
||||
// No free context was available so we'll have to create a new one
|
||||
ctx = engine->CreateContext();
|
||||
}
|
||||
|
||||
// Attach the debugger if needed
|
||||
if( ctx && g_dbg )
|
||||
{
|
||||
// Set the line callback for the debugging
|
||||
ctx->SetLineCallback(asMETHOD(CDebugger, LineCallback), g_dbg, asCALL_THISCALL);
|
||||
}
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
||||
// This function is called by the engine when the context is no longer in use
|
||||
void ReturnContextCallback(asIScriptEngine *engine, asIScriptContext *ctx, void * /*param*/)
|
||||
{
|
||||
// We can also check for possible script exceptions here if so desired
|
||||
|
||||
// Unprepare the context to free any objects it may still hold (e.g. return value)
|
||||
// This must be done before making the context available for re-use, as the clean
|
||||
// up may trigger other script executions, e.g. if a destructor needs to call a function.
|
||||
ctx->Unprepare();
|
||||
|
||||
// Place the context into the pool for when it will be needed again
|
||||
g_ctxPool.push_back(ctx);
|
||||
}
|
||||
|
||||
void SetWorkDir(const string &file)
|
||||
{
|
||||
_chdir(file.c_str());
|
||||
}
|
||||
|
||||
// This function is used to allow the user to read the output to the console before exiting
|
||||
// when the process is initiated from the file explorer on Windows.
|
||||
void WaitForUser()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
// Check if the script is initiated directly from the file explorer in which
|
||||
// case it is necessary to wait for some user input before exiting so the
|
||||
// user has time to check the compiler error messages.
|
||||
// Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/ms686701(v=vs.85).aspx
|
||||
DWORD parentPid = 0;
|
||||
DWORD myPid = GetCurrentProcessId();
|
||||
|
||||
HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
|
||||
PROCESSENTRY32W procEntry;
|
||||
procEntry.dwSize = sizeof(PROCESSENTRY32W);
|
||||
|
||||
// Find the pid of the parent process
|
||||
Process32FirstW(hSnapShot, &procEntry);
|
||||
do
|
||||
{
|
||||
if (myPid == procEntry.th32ProcessID)
|
||||
{
|
||||
parentPid = procEntry.th32ParentProcessID;
|
||||
break;
|
||||
}
|
||||
} while (Process32NextW(hSnapShot, &procEntry));
|
||||
|
||||
// Find the name of the parent process
|
||||
wstring name;
|
||||
Process32FirstW(hSnapShot, &procEntry);
|
||||
do
|
||||
{
|
||||
if (parentPid == procEntry.th32ProcessID)
|
||||
{
|
||||
name = procEntry.szExeFile;
|
||||
break;
|
||||
}
|
||||
} while (Process32NextW(hSnapShot, &procEntry));
|
||||
|
||||
CloseHandle(hSnapShot);
|
||||
|
||||
if (name == L"explorer.exe")
|
||||
{
|
||||
PrintString("\nPress enter to exit\n");
|
||||
GetInput();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int PragmaCallback(const string &pragmaText, CScriptBuilder &builder, void * /*userParam*/)
|
||||
{
|
||||
asIScriptEngine *engine = builder.GetEngine();
|
||||
|
||||
// Filter the pragmaText so only what is of interest remains
|
||||
// With this the user can add comments and use different whitespaces without affecting the result
|
||||
asUINT pos = 0;
|
||||
asUINT length = 0;
|
||||
string cleanText;
|
||||
while( pos < pragmaText.size() )
|
||||
{
|
||||
asETokenClass tokenClass = engine->ParseToken(pragmaText.c_str() + pos, 0, &length);
|
||||
if (tokenClass == asTC_IDENTIFIER || tokenClass == asTC_KEYWORD || tokenClass == asTC_VALUE)
|
||||
{
|
||||
string token = pragmaText.substr(pos, length);
|
||||
cleanText += " " + token;
|
||||
}
|
||||
if (tokenClass == asTC_UNKNOWN)
|
||||
return -1;
|
||||
pos += length;
|
||||
}
|
||||
|
||||
// Interpret the result
|
||||
if (cleanText == " debug")
|
||||
{
|
||||
g_doDebug = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// The #pragma directive was not accepted
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user