Ich versuche, eine XML-Projektdatei zu komprimieren. Das Projekt kompiliert eine einzelne Quelldatei, aber seine Größe ist größer als 11 KB, da die Einstellungen mehrmals kopiert werden. Ich versuche, pro-Quelldatei-Einstellungen zu verschieben und sie in Configuration PropertyGroup mit verschiedenen Bedingung Anweisungen oder Ausdrücke (was nennt sie XML?).VS, die PropertyGroup-Konfigurationseinstellungen nicht berücksichtigt
Wenn ich A guide to .vcxproj and .props file structure von MSDN Blogs richtig bin Parsen, können wir die Einstellungen iin der Eigenschaftsgruppe platzieren:
<PropertyGroup Label=“Configuration“ />
<!– This property sheet (directly or via imports) defines the
default values for many tool-specific properties such as the
compiler’s Optimization, WarningLevel properties, Midl tool’s
TypeLibraryName property, etc...
Allerdings, wenn ich meine Änderungen überprüfen, indem VS schließen und dann wieder geöffnet es mit dem modifizierten Projektdatei wird keine der Einstellungen übernommen. Visual Studio scheint seine eigenen Einstellungen zu verwenden.
Ich habe ein paar Fragen:
Gibt es eine Visual Studio Einstellung, es zu sagen, jede Einstellung in jeder Quelldatei zu stoppen sraying? Es gibt keinen Grund, eine Einstellung 175x4 Mal für jede Quelldatei zu duplizieren, die in jede Konfiguration übertragen wird.
Verfügt Visual Studio über ein Komprimierungsprogramm, so dass ich dies nicht manuell durchführen muss? Es ist sehr mühsame Arbeit.
Warum erkennt Visual Studio die Einstellungen nicht? Wie repariere ich es?
Hier ist ein Screen-Capture einer Eigenschaftsseite, die Präprozessormakros enthält. Das geänderte XML enthält Folgendes, das in Visual Studio nicht wiedergegeben wird. Ich habe es mit und ohne ClCompile
versucht.
<!-- Debug Configurations -->
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Release Configuration">
<ClCompile>
<PreprocessorDefinitions>CRYPTOPP_DLL_ONLY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
...
</ClCompile>
</PropertyGroup>
Hier ist die verdichtete Projektdatei. Die original can be found here. Das Projekt kompiliert 1 Quelldatei und seine Größe über 11 KB wird nicht komprimiert.
Meine Mods beginnen bei <!-- All Configurations -->
und enden bei <!-- Back to Visual Studio boilerplate -->
. Ich habe noch nicht alle Einstellungen fertiggestellt, aber die, die gemacht wurden, wie Präprozessor-Makros und Laufzeitbibliothek, werden nicht unter Visual Studio angezeigt.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1974a53a-9863-41c9-886d-b2b8c2fc3c8b}</ProjectGuid>
<RootNamespace>dlltest</RootNamespace>
<PlatformToolset>v100</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<!-- All Configurations -->
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<OutDir>$(Platform)\DLL_Output\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<CallingConvention>StdCall</CallingConvention>
<SuppressStartupBanner>true</SuppressStartupBanner>
</ClCompile>
</PropertyGroup>
<!-- Debug Configurations -->
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Debug Configuration">
<ClCompile>
<PreprocessorDefinitions>CRYPTOPP_DLL_ONLY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization>Disabled</Optimization>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
</PropertyGroup>
<!-- Release Configurations -->
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Release Configuration">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;CRYPTOPP_DLL_ONLY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
</PropertyGroup>
<!-- X86 Configurations -->
<PropertyGroup Condition="'$(Platform)'=='Win32'" Label="X86 Configuration">
<ClCompile>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
</PropertyGroup>
<!-- X64 Configurations -->
<PropertyGroup Condition="'$(Platform)'=='x64'" Label="X64 Configuration">
<ClCompile>
<!-- <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet> -->
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
</ClCompile>
</PropertyGroup>
<!-- Back to Visual Studio boilerplate -->
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<StringPooling>true</StringPooling>
<PrecompiledHeader />
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>cryptopp.lib;Ws2_32.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>$(Platform)\DLL_Output\$(Configuration)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<StringPooling>true</StringPooling>
<PrecompiledHeader />
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>cryptopp.lib;Ws2_32.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>$(Platform)\DLL_Output\$(Configuration)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader />
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>cryptopp.lib;Ws2_32.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>$(Platform)\DLL_Output\$(Configuration)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader />
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>cryptopp.lib;Ws2_32.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>$(Platform)\DLL_Output\$(Configuration)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="dlltest.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
Dank @stijn. * "... setze sie nach dem' '... "... - Leider funktioniert das auch nicht. Ich bewege sie weiter, füge '' hinzu und nehme '' weg, < andere Vermutungen >. Sein wirklich unglücklicher Microsoft dokumentiert dieses Zeug nicht richtig. Das wird zur völligen Verschwendung meiner Zeit, seit ich zwei Tage alt bin. Und ich bin nicht näher daran, "EnableEnhancedInstructionSet" richtig einzustellen, so dass X64-Code immer noch langsamer als Win32-Code läuft. –
jww
Ich wette Ballmer lacht seinen Arsch auf mich, während er sein Bonusgeld zählt. Ich habe seit 2010 mehr als 3.000 US-Dollar für vier Versionen von Visual Studio-Versionen ausgegeben, um sicherzustellen, dass wir sie richtig unterstützen und ich kann nicht einmal eine anständige Menge an Dokumenten für das Geld bekommen. Stattdessen muss ich zu Stack Overflow kommen und um Antworten betteln. Das ist lächerlich. – jww
erhalten Sie auf BizSpark von Microsoft. Beste 0 Cent, die du (n) jemals ausgegeben hast, um alles zu bekommen – Drew