Skip to content

Commit a90d679

Browse files
Merge branch 'main' into unit
2 parents 434f6f9 + c332e9d commit a90d679

File tree

6 files changed

+101
-77
lines changed

6 files changed

+101
-77
lines changed

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
<!-- we manually update these -->
8888
<PropertyGroup Condition="'$(MSBuildProjectName.IndexOf(`libtorch-`))' != '-1'">
8989
<LibTorchPackageVersion>2.2.1.1</LibTorchPackageVersion>
90+
<EnablePackageValidation>false</EnablePackageValidation>
9091
<VersionPrefix>$(LibTorchPackageVersion)</VersionPrefix>
9192
<VersionSuffix></VersionSuffix>
9293
</PropertyGroup>

azure-pipelines.yml

Lines changed: 68 additions & 66 deletions
Large diffs are not rendered by default.

build/BranchInfo.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<MajorVersion>0</MajorVersion>
44
<MinorVersion>102</MinorVersion>
55
<PatchVersion>7</PatchVersion>
6+
<PreviousPackageVersion>0.102.6</PreviousPackageVersion>
67
</PropertyGroup>
78

89
</Project>

pkg/Directory.Build.targets

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project>
2+
<Import Project="..\Directory.Build.targets" />
3+
4+
<PropertyGroup Condition="'$(IsPackable)' != 'false' and '$(EnablePackageValidation)' != 'false'">
5+
<EnablePackageValidation>true</EnablePackageValidation>
6+
<PackageValidationBaselineVersion>$(PreviousPackageVersion)</PackageValidationBaselineVersion>
7+
</PropertyGroup>
8+
9+
<Target Name="GetTargetPath" Returns="@(_updatedTargetPath)">
10+
<!-- Repoint up the TargetPath to represent the a matching file from PackagePreparationPath if it exists, otherwise don't return a target path
11+
This fakes what the project output would be if we were using real projects (and not package projects) to represent these libraries. -->
12+
<ItemGroup>
13+
<_targetPathUnderPackagePrep Include="@(TargetPathWithTargetPlatformMoniker->'$(PackagePreparationPath)$(PackageIdFolderName)\lib\$(TargetFramework)\%(FileName)%(Extension)')" />
14+
<_updatedTargetPath Include="@(_targetPathUnderPackagePrep)" Condition="Exists('%(Identity)')" />
15+
</ItemGroup>
16+
</Target>
17+
</Project>

pkg/pack.proj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,25 @@
66
<PackProject Include="**\libtorch-cuda-$(CudaVersionDot)-linux-*.nupkgproj" Condition="'$(IncludeLibTorchCudaPackages)' == 'true' AND '$(TargetOS)' == 'linux'" />
77
<PackProject Include="**\libtorch-cuda-$(CudaVersionDot)-win-*.nupkgproj" Condition="'$(IncludeLibTorchCudaPackages)' == 'true' AND '$(TargetOS)' == 'windows'" />
88
<PackProject Include="**\libtorch-cuda-$(CudaVersionDot)-mac-*.nupkgproj" Condition="'$(IncludeLibTorchCudaPackages)' == 'true' AND '$(TargetOS)' == 'mac'" />
9+
</ItemGroup>
10+
<ItemGroup Condition="'$(IncludeTorchSharpPackage)' == 'true'">
911
<PackProject Include="**\TorchAudio.nupkgproj" />
1012
<PackProject Include="**\TorchSharp.nupkgproj" />
1113
<PackProject Include="**\TorchSharp-cpu.nupkgproj" />
1214
<PackProject Include="**\TorchSharp-cuda-linux.nupkgproj" />
1315
<PackProject Include="**\TorchSharp-cuda-windows.nupkgproj" />
1416
<PackProject Include="**\TorchVision.nupkgproj" />
1517
</ItemGroup>
16-
<Target Name="Pack">
18+
<Target Name="Restore">
1719
<Message Text="Restoring packaging projects..." Importance="high" />
18-
19-
<Warning Text="Packages will be incomplete and unusable on linux platforms. To get a complete package you need the LibTorchSharp.so binaries for other platforms and copy them into '$(PackagePreparationPath)' to make complete packages. This is automated by Azure Pipelines."
20+
<MSBuild Projects="%(PackProject.Identity)" Targets="Restore" />
21+
</Target>
22+
<Target Name="Pack" DependsOnTargets="Restore">
23+
<Warning Text="Packages will be incomplete and unusable on linux platforms. To get a complete package you need the LibTorchSharp.so binaries for other platforms and copy them into '$(PackagePreparationPath)' to make complete packages. This is automated by Azure Pipelines."
2024
Condition="'$(IncludeTorchSharpPackage)' == 'true' AND !Exists('$(PackagePreparationPath)\TorchSharp\runtimes\linux-x64\native\libLibTorchSharp.so')" />
21-
<Warning Text="Packages will be incomplete and unusable on win-x64 platform. To get a complete package you need the LibTorchSharp.dll binaries for other platforms and copy them into '$(PackagePreparationPath)' to make complete packages. This is automated by Azure Pipelines."
25+
<Warning Text="Packages will be incomplete and unusable on win-x64 platform. To get a complete package you need the LibTorchSharp.dll binaries for other platforms and copy them into '$(PackagePreparationPath)' to make complete packages. This is automated by Azure Pipelines."
2226
Condition="'$(IncludeTorchSharpPackage)' == 'true' AND !Exists('$(PackagePreparationPath)\TorchSharp\runtimes\win-x64\native\LibTorchSharp.dll')" />
2327

24-
<MSBuild Projects="%(PackProject.Identity)" Targets="Restore" />
2528
<MSBuild Projects="%(PackProject.Identity)" Targets="Pack" />
2629

2730
<Message Text="Done packing!" Importance="high" />

src/Native/LibTorchSharp/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ if(APPLE)
7979
set_target_properties(LibTorchSharp PROPERTIES INSTALL_RPATH "@loader_path;@executable_path;")
8080
endif()
8181

82-
if(NOT WIN32)
83-
# Set C++ standard
84-
set_target_properties(LibTorchSharp PROPERTIES
85-
CXX_STANDARD 17
86-
CXX_STANDARD_REQUIRED ON
87-
)
82+
# Set C++ standard
83+
set_target_properties(LibTorchSharp PROPERTIES
84+
CXX_STANDARD 17
85+
CXX_STANDARD_REQUIRED ON
86+
)
8887

88+
if(NOT WIN32)
8989
# Add C++ specific compile options
9090
target_compile_options(LibTorchSharp PRIVATE
9191
$<$<COMPILE_LANGUAGE:CXX>:-std=c++17>

0 commit comments

Comments
 (0)