Switch to VC++ 2013 on Windows

Remove the faux-variadic make_unique since 2013 has real variadic
templates.

Switch to the non-deprecated windows version check functions.

Switch to the develop branch of boost since master doesn't fully support
VS 2013 atm.

Fix some assorted compilation errors.

Hardcode the paths to a bunch of Visual Studio things since it's now
expanding the relevant macros to nothing for whatever reason.
This commit is contained in:
Thomas Goyne 2013-12-11 12:30:27 -08:00
parent 5493c025bc
commit af96b305bf
9 changed files with 45 additions and 38 deletions

View file

@ -66,7 +66,7 @@ type ShellWrapper(conf : ITaskItem) =
this.UseCommandProcessor <- false this.UseCommandProcessor <- false
this.StandardOutputImportance <- "High" this.StandardOutputImportance <- "High"
this.EnvironmentVariables <- [| for x in ["CC"; "CPP"; "CFLAGS"; "PATH"; "INCLUDE"; "LIB"] this.EnvironmentVariables <- [| for x in ["CC"; "CPP"; "CFLAGS"; "PATH"; "INCLUDE"; "LIB"]
-> sprintf "%s=%s" <| x <| conf.GetMetadata x |] -> sprintf "%s=%s" <| x <| conf.GetMetadata(x).Replace("\n", "").Replace(" ", "") |]
base.Execute() base.Execute()
type ExecShellScript() = type ExecShellScript() =

View file

@ -14,6 +14,7 @@
<ProjectName>BuildTasks</ProjectName> <ProjectName>BuildTasks</ProjectName>
<RestorePackages>true</RestorePackages> <RestorePackages>true</RestorePackages>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
<TargetFSharpCoreVersion>4.3.0.0</TargetFSharpCoreVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)..\paths.props" /> <Import Project="$(MSBuildThisFileDirectory)..\paths.props" />
<PropertyGroup> <PropertyGroup>
@ -40,15 +41,18 @@
<WarningLevel>3</WarningLevel> <WarningLevel>3</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion> <MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">12</MinimumVisualStudioVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets" Condition=" Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets" />
<ItemGroup> <ItemGroup>
<Compile Include="BuildTasks.fs" /> <Compile Include="BuildTasks.fs" />
<Compile Include="DependencyFetchers.fs" /> <Compile Include="DependencyFetchers.fs" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>True</Private>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib"> <Reference Include="ICSharpCode.SharpZipLib">
<HintPath>..\..\..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath> <HintPath>..\..\..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference> </Reference>
@ -57,7 +61,6 @@
<Reference Include="Microsoft.Build.Framework" /> <Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Utilities.v4.0" /> <Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="mscorlib" /> <Reference Include="mscorlib" />
<Reference Include="FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Net" /> <Reference Include="System.Net" />
@ -65,4 +68,4 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" /> <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
</Project> </Project>

View file

@ -33,7 +33,7 @@
<UseDebugLibraries Condition="'$(Configuration)'=='Release'" >false</UseDebugLibraries> <UseDebugLibraries Condition="'$(Configuration)'=='Release'" >false</UseDebugLibraries>
<WholeProgramOptimization Condition="'$(Configuration)'=='Release'" >true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'=='Release'" >true</WholeProgramOptimization>
<CharacterSet >Unicode</CharacterSet> <CharacterSet >Unicode</CharacterSet>
<PlatformToolset >v110_xp</PlatformToolset> <PlatformToolset >v120_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

View file

@ -8,12 +8,32 @@
<ExecShellScript Include="."> <ExecShellScript Include=".">
<CC>cl</CC> <CC>cl</CC>
<CFLAGS>-nologo</CFLAGS> <CFLAGS>-nologo</CFLAGS>
<PATH>$(MsysBasePath)\bin;$(NativeExecutablePath)</PATH>
<INCLUDE>$(MSBuildProjectDirectory);$(AegisubSourceBase)\src\msvc;$(AegisubSourceBase)\include;$(IncludePath)</INCLUDE>
<LIB>$(AegisubLibraryDir);$(LibraryPath)</LIB>
<Configuration>$(Configuration)</Configuration> <Configuration>$(Configuration)</Configuration>
<Platform>$(Platform)</Platform> <Platform>$(Platform)</Platform>
<Sh>$(MsysBasePath)\bin\sh.exe</Sh> <Sh>$(MsysBasePath)\bin\sh.exe</Sh>
<INCLUDE>
$(MSBuildProjectDirectory);
$(AegisubSourceBase)\src\msvc;
$(AegisubSourceBase)\include;
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include;
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include;
c:\Program Files (x86)\Windows Kits\8.1\Include\um;
c:\Program Files (x86)\Windows Kits\8.1\Include\shared
</INCLUDE>
<PATH Condition="'$(Platform)'=='Win32'">$(MsysBasePath)\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin</PATH>
<PATH Condition="'$(Platform)'=='x64'">$(MsysBasePath)\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64</PATH>
<LIB Condition="'$(Platform)'=='Win32'">
$(AegisubLibraryDir);
c:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86;
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib;
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\lib
</LIB>
<LIB Condition="'$(Platform)'=='x64'">
$(AegisubLibraryDir);
c:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64;
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\amd64;
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\lib\amd64
</LIB>
</ExecShellScript> </ExecShellScript>
</ItemGroup> </ItemGroup>

View file

@ -55,20 +55,10 @@ namespace agi {
/// @param name New name for the thread /// @param name New name for the thread
void SetThreadName(const char *name); void SetThreadName(const char *name);
#ifdef _MSC_VER
#define MAKE_UNIQUE(TEMPLATE_LIST, PADDING_LIST, LIST, COMMA, X1, X2, X3, X4) \
template<class T COMMA LIST(_CLASS_TYPE)> \
inline std::unique_ptr<T> make_unique(LIST(_TYPE_REFREF_ARG)) { \
return std::unique_ptr<T>(new T(LIST(_FORWARD_ARG))); \
}
_VARIADIC_EXPAND_0X(MAKE_UNIQUE, , , , )
#undef MAKE_UNIQUE
#else
template<typename T, typename... Args> template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args) { std::unique_ptr<T> make_unique(Args&&... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
} }
#endif
/// A thin wrapper around this_thread::sleep_for that uses std::thread on /// A thin wrapper around this_thread::sleep_for that uses std::thread on
/// Windows (to avoid having to compile boost.thread) and boost::thread /// Windows (to avoid having to compile boost.thread) and boost::thread

View file

@ -30,19 +30,13 @@ using agi::charset::ConvertLocal;
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
namespace bfs = boost::filesystem; namespace bfs = boost::filesystem;
#include <versionhelpers.h>
#undef CreateDirectory #undef CreateDirectory
namespace { namespace {
FINDEX_INFO_LEVELS find_info_level() { FINDEX_INFO_LEVELS find_info_level() {
OSVERSIONINFO osvi; return IsWindowsVistaOrGreater() ? FindExInfoBasic : FindExInfoStandard;
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
if (osvi.dwMajorVersion > 6 || (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion >= 1))
return FindExInfoBasic;
else
return FindExInfoStandard;
} }
} }

View file

@ -812,7 +812,7 @@ bool DirectSoundPlayer2::IsThreadAlive()
thread.reset(); thread.reset();
} }
return thread; return !!thread;
} }
void DirectSoundPlayer2::Play(int64_t start,int64_t count) void DirectSoundPlayer2::Play(int64_t start,int64_t count)

View file

@ -108,14 +108,14 @@ FFMS_Index *FFmpegSourceProvider::DoIndexing(FFMS_Indexer *Indexer, agi::fs::pat
int calls; int calls;
}; };
progress state = { ps, 0 }; progress state = { ps, 0 };
Index = FFMS_DoIndexing(Indexer, Trackmask, FFMS_TRACKMASK_NONE, nullptr, nullptr, IndexEH, TIndexCallback callback = [](int64_t Current, int64_t Total, void *Private) -> int {
static_cast<TIndexCallback>([](int64_t Current, int64_t Total, void *Private) -> int { auto state = static_cast<progress *>(Private);
auto state = static_cast<progress *>(Private); if (++state->calls % 10 == 0)
if (++state->calls % 10 == 0) state->ps->SetProgress(Current, Total);
state->ps->SetProgress(Current, Total); return state->ps->IsCancelled();
return state->ps->IsCancelled(); };
}), Index = FFMS_DoIndexing(Indexer, Trackmask, FFMS_TRACKMASK_NONE,
&state, &ErrInfo); nullptr, nullptr, IndexEH, callback, &state, &ErrInfo);
}); });
if (Index == nullptr) { if (Index == nullptr) {

2
deps/boost vendored

@ -1 +1 @@
Subproject commit 55e528420dcc2cef01ca17f1d51d349debcc9b81 Subproject commit f866ff6fea187a5c9ad80895f078dec577cdc304