1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?xml version="1.0" encoding="utf-8"?>
- <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ImportGroup Label="PropertySheets">
- <Import Project="v8-version.props" Condition=" '$(V8VersionImported)' == '' "/>
- <Import Project="downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
- </ImportGroup>
- <PropertyGroup Label="UserMacros">
- <V8libDir>$(BaseDir)libs\v8-$(V8Version)</V8libDir>
- </PropertyGroup>
- <!--
- Download Target.
- Name must be unique.
- By design, targets are executed only once per project.
-
- Usage:
-
- package: URI
- expectfileordirectory: Skips the download and extraction if exists
- outputfolder: Folder to store a downloaded file.
- By default "$(BaseDir)libs", if empty
- outputfilename: If not empty, overrides filename from URI.
- .exe files don't get extracted
- extractto: Folder to extract an archive to
- -->
- <Target Name="v8BinariesDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
- <DownloadPackageTask
- package="http://files.freeswitch.org/windows/packages/v8/$(V8Version)/v8-$(V8Version)-binaries-$(Platform.ToLower())-$(Configuration.ToLower()).zip"
- expectfileordirectory="$(V8libDir)\binaries\$(Platform)\$(Configuration)\v8.dll"
- outputfolder=""
- outputfilename=""
- extractto="$(BaseDir)libs\"
- />
- </Target>
- <Target Name="v8HeadersDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
- <DownloadPackageTask
- package="http://files.freeswitch.org/windows/packages/v8/$(V8Version)/v8-$(V8Version)-headers.zip"
- expectfileordirectory="$(V8libDir)\include\v8.h"
- outputfolder=""
- outputfilename=""
- extractto="$(BaseDir)libs\"
- />
- </Target>
- <Target Name="v8copyTarget" BeforeTargets="CustomBuild" DependsOnTargets="v8BinariesDownloadTarget">
- <Message Text="Copying v8 libraries to the freeswitch output folder." Importance="High" />
- <ItemGroup>
- <v8Files Include="$(V8libDir)\binaries\$(Platform)\$(Configuration)\*.dll"/>
- </ItemGroup>
- <Copy Condition="!exists('$(BaseDir)\$(Platform)\$(Configuration)\v8.dll')"
- SourceFiles="@(v8Files)"
- DestinationFiles="@(v8Files->'$(BaseDir)\$(Platform)\$(Configuration)\%(Filename)%(Extension)')"
- />
- </Target>
- <ItemDefinitionGroup>
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <TreatWarningAsError>true</TreatWarningAsError>
- <AdditionalIncludeDirectories>$(SolutionDir)libs\v8-$(V8Version)\include;$(SolutionDir)src\mod\languages\mod_v8;$(SolutionDir)src\mod\languages\mod_v8\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <Link>
- <AdditionalLibraryDirectories>$(SolutionDir)libs\v8-$(V8Version)\binaries\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- <AdditionalDependencies>v8.dll.lib;v8_libbase.dll.lib;v8_libplatform.dll.lib;%(AdditionalDependencies)</AdditionalDependencies>
- </Link>
- </ItemDefinitionGroup>
- </Project>
|