We have a static library that exports some grpc.pb.cc, grpc.pb.h files and except that a bunch of other ordinary files. We call this LibMicroservicesClient.
Then we have another library that is linking this library using ProjectReference in msbuild:
<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)LibMicroservicesClient.vcxproj">
<Project>{A397A6CB-641A-41FB-9E8C-2263EC3712E8}</Project>
<Private>false</Private>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
At link of the final library that is importing this LibMicroservicesClient, in the intermediate folder a bunch of .asm files is started to get generated. These files are also generated in the LibMicroservicesClient intermediate folder so when two libraries are referencing the same LibMicroservicesClient they start to conflict on access denied because they are creating the same .asm file.
How can I reference a static library that will not create the asm files at all??? How can I even control this thing.
We are using Visual Studio 2015. We build with MSBuild though that comes along.
Ah i got it. The link time optimisation and whole program optimisation were enabled. When lto is disabled but whole program opt is enabled the program auto enables lto. The side effect was that .asm files were not generated during link of libraries but when the library was linked to the final executable. Thus disabling of lto an whole program optimisation solved this