v8.props 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3. <ImportGroup Label="PropertySheets">
  4. <Import Project="v8-version.props" Condition=" '$(V8VersionImported)' == '' "/>
  5. <Import Project="downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
  6. </ImportGroup>
  7. <PropertyGroup Label="UserMacros">
  8. <V8libDir>$(BaseDir)libs\v8-$(V8Version)</V8libDir>
  9. </PropertyGroup>
  10. <!--
  11. Download Target.
  12. Name must be unique.
  13. By design, targets are executed only once per project.
  14. Usage:
  15. package: URI
  16. expectfileordirectory: Skips the download and extraction if exists
  17. outputfolder: Folder to store a downloaded file.
  18. By default "$(BaseDir)libs", if empty
  19. outputfilename: If not empty, overrides filename from URI.
  20. .exe files don't get extracted
  21. extractto: Folder to extract an archive to
  22. -->
  23. <Target Name="v8BinariesDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
  24. <DownloadPackageTask
  25. package="http://files.freeswitch.org/windows/packages/v8/$(V8Version)/v8-$(V8Version)-binaries-$(Platform.ToLower())-$(Configuration.ToLower()).zip"
  26. expectfileordirectory="$(V8libDir)\binaries\$(Platform)\$(Configuration)\v8.dll"
  27. outputfolder=""
  28. outputfilename=""
  29. extractto="$(BaseDir)libs\"
  30. />
  31. </Target>
  32. <Target Name="v8HeadersDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
  33. <DownloadPackageTask
  34. package="http://files.freeswitch.org/windows/packages/v8/$(V8Version)/v8-$(V8Version)-headers.zip"
  35. expectfileordirectory="$(V8libDir)\include\v8.h"
  36. outputfolder=""
  37. outputfilename=""
  38. extractto="$(BaseDir)libs\"
  39. />
  40. </Target>
  41. <Target Name="v8copyTarget" BeforeTargets="CustomBuild" DependsOnTargets="v8BinariesDownloadTarget">
  42. <Message Text="Copying v8 libraries to the freeswitch output folder." Importance="High" />
  43. <ItemGroup>
  44. <v8Files Include="$(V8libDir)\binaries\$(Platform)\$(Configuration)\*.dll"/>
  45. </ItemGroup>
  46. <Copy Condition="!exists('$(BaseDir)\$(Platform)\$(Configuration)\v8.dll')"
  47. SourceFiles="@(v8Files)"
  48. DestinationFiles="@(v8Files->'$(BaseDir)\$(Platform)\$(Configuration)\%(Filename)%(Extension)')"
  49. />
  50. </Target>
  51. <ItemDefinitionGroup>
  52. <ClCompile>
  53. <WarningLevel>Level3</WarningLevel>
  54. <TreatWarningAsError>true</TreatWarningAsError>
  55. <AdditionalIncludeDirectories>$(SolutionDir)libs\v8-$(V8Version)\include;$(SolutionDir)src\mod\languages\mod_v8;$(SolutionDir)src\mod\languages\mod_v8\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  56. <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
  57. </ClCompile>
  58. <Link>
  59. <AdditionalLibraryDirectories>$(SolutionDir)libs\v8-$(V8Version)\binaries\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
  60. <AdditionalDependencies>v8.dll.lib;v8_libbase.dll.lib;v8_libplatform.dll.lib;%(AdditionalDependencies)</AdditionalDependencies>
  61. </Link>
  62. </ItemDefinitionGroup>
  63. </Project>