Archived
Building for Windows from source without nuget
Hello,
is there a trivial way to build Windows binaries without Visual Studio downloading (restoring) packages? My goal is to build and link Ice against existing libraries. I am aware of the modified mcpp dependency.
Thanks in advance and
kind regards,
Ben
Comments
-
is there a trivial way to build Windows binaries without Visual Studio downloading (restoring) packages?
No there isn't
My goal is to build and link Ice against existing libraries. I am aware of the modified mcpp dependency.
What are you trying to archive, link with different version of the third-party dependencies?
0 -
Hello,
is there a trivial way to build Windows binaries without Visual Studio downloading (restoring) packages? My goal is to build and link Ice against existing libraries. I am aware of the modified mcpp dependency.
Thanks in advance and
kind regards,
Ben
0 -
Thank you for your reply!
I have some of the dependencies already built in my project. Or long story short, I wrote a portfile for vcpkg. Works nicely on Mac. But for Windows i need to get rid of the nuget stuff. I guess I’ll have to write a script that removes it from the Ice project files then.
0 -
I think you will have to at least remove or add a condition to the
EnsureNuGetPackageBuildImports
targets, so that they are skip with your build.You also need to remove the
NuGetRestore
dependency on the build targets https://github.com/zeroc-ice/ice/blob/b962f8f5ea4e3e388595adfa7499d16ea92df6f0/cpp/msbuild/ice.proj#L244It wouldn't be too complicated to add a MSBuild property to support both vcpkg and NuGet builds
1 -
For example patch the
EnsureNuGetPackageBuildImports
targets with a condition like<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild" Condition="'$(UseVcpkg)' != 'yes'">
Add separate Build targets that don't depend on NuGetRestore in ice.proj
<!-- Build with vcpkg --> <Target Name="BuildDistWitVcpkg" Condition="'$(ICE_BIN_DIST)' != 'all'"> <MSBuild Projects="@(DistSolution)" BuildInParallel="true" Properties="%(Properties);UseVcpkg=yes"/> </Target>
1 -
Oh, that looks like a much more elegant solution! :-) I will go with that and create a PR, in case you’re interested.
Thank you very much!
Ben
0