fix bin output filename

This commit is contained in:
zeromus 2016-03-21 08:30:51 +00:00
parent 4a6ea70c94
commit 0a5f63c0f1
1 changed files with 186 additions and 185 deletions

View File

@ -1,186 +1,187 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="IntegrityChecks" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="IntegrityChecks" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- TODO: define how Dev+ should be built (probably a normal release build) and set a property to generally control that while adding only the dev+ flags (not to mention NOSSE) --> <!-- TODO: define how Dev+ should be built (probably a normal release build) and set a property to generally control that while adding only the dev+ flags (not to mention NOSSE) -->
<!-- FIX MSBUILD --> <!-- FIX MSBUILD -->
<PropertyGroup> <PropertyGroup>
<!-- warning MSB8027: Two or more files with the name of X.cpp will produce outputs to the same location. This can lead to an incorrect build result. --> <!-- warning MSB8027: Two or more files with the name of X.cpp will produce outputs to the same location. This can lead to an incorrect build result. -->
<IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename> <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>
<!-- http://sedodream.com/PermaLink,guid,a5894bad-f2a1-441a-a5b2-74f16c6cf8aa.aspx --> <!-- http://sedodream.com/PermaLink,guid,a5894bad-f2a1-441a-a5b2-74f16c6cf8aa.aspx -->
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup> </PropertyGroup>
<!-- General project setup --> <!-- General project setup -->
<PropertyGroup> <PropertyGroup>
<NDS_VisualStudioName Condition="'$(VisualStudioVersion)' == '10.0'">VS2010</NDS_VisualStudioName> <NDS_VisualStudioName Condition="'$(VisualStudioVersion)' == '10.0'">VS2010</NDS_VisualStudioName>
<NDS_VisualStudioName Condition="'$(VisualStudioVersion)' == '14.0'">VS2015</NDS_VisualStudioName> <NDS_VisualStudioName Condition="'$(VisualStudioVersion)' == '14.0'">VS2015</NDS_VisualStudioName>
<IntDir>$(SolutionDir).obj\$(NDS_VisualStudioName)-$(Platform)-$(Configuration)\</IntDir> <IntDir>$(SolutionDir).obj\$(NDS_VisualStudioName)-$(Platform)-$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)__bins\</OutDir> <OutDir>$(SolutionDir)__bins\</OutDir>
<TargetName Condition="'$(Platform)' == 'x64'">DeSmuME-$(NDS_VisualStudioName)-$(ProjectName)-x64-$(Configuration)</TargetName> <TargetName>$(ProjectName)-$(NDS_VisualStudioName)-$(Configuration)</TargetName>
<TargetName>DeSmuME-$(NDS_VisualStudioName)-$(Configuration)</TargetName> <TargetName Condition="'$(Platform)' == 'x64'">$(ProjectName)-$(NDS_VisualStudioName)-x64-$(Configuration)</TargetName>
<TargetPath>$(OutDir)$(TargetName).exe</TargetPath> <TargetPath>$(OutDir)$(TargetName).exe</TargetPath>
</PropertyGroup> </PropertyGroup>
<!-- global optimizations --> <!-- global optimizations -->
<PropertyGroup> <PropertyGroup>
<WholeProgramOptimization Condition="'$(Configuration)' == 'Release'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)' == 'Release'">true</WholeProgramOptimization>
</PropertyGroup> </PropertyGroup>
<!--==========================================================================--> <!--==========================================================================-->
<!-- ITEM DEFINITIONS (standard build environment) --> <!-- ITEM DEFINITIONS (standard build environment) -->
<ItemDefinitionGroup> <ItemDefinitionGroup>
<PreBuildEvent> <PreBuildEvent>
<Command>defaultconfig\SubWCRev.bat</Command> <Command>defaultconfig\SubWCRev.bat</Command>
</PreBuildEvent> </PreBuildEvent>
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;.\zlib128;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor;..\libretro-common\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;.\zlib128;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor;..\libretro-common\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<!-- universal definitions --> <!-- universal definitions -->
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_ZLIB_DEFLATE;HAVE_LIBZ;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;HAVE_ZLIB_DEFLATE;HAVE_LIBZ;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- BETA_VERSION ? --> <!-- BETA_VERSION ? -->
<PreprocessorDefinitions Condition="'$(Configuration)' == 'Debug'">_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="'$(Configuration)' == 'Debug'">_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)' == 'Release'">RELEASE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="'$(Configuration)' == 'Release'">RELEASE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)' == 'Release FastBuild'">RELEASE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="'$(Configuration)' == 'Release FastBuild'">RELEASE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- These work together --> <!-- These work together -->
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild> <MinimalRebuild>false</MinimalRebuild>
<!-- Optimization control --> <!-- Optimization control -->
<Optimization Condition="'$(Configuration)' == 'Debug'">Disabled</Optimization> <Optimization Condition="'$(Configuration)' == 'Debug'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)' == 'Release'">Full</Optimization> <Optimization Condition="'$(Configuration)' == 'Release'">Full</Optimization>
<Optimization Condition="'$(Configuration)' == 'Release Fastbuild'">Full</Optimization> <Optimization Condition="'$(Configuration)' == 'Release Fastbuild'">Full</Optimization>
<WholeProgramOptimization Condition="'$(Configuration)' == 'Release'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)' == 'Release'">true</WholeProgramOptimization>
<FloatingPointModel>Fast</FloatingPointModel> <FloatingPointModel>Fast</FloatingPointModel>
<EnableEnhancedInstructionSet Condition="'$(Platform)' == 'Win32'">StreamingSIMDExtensions2</EnableEnhancedInstructionSet> <EnableEnhancedInstructionSet Condition="'$(Platform)' == 'Win32'">StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<!-- Debugging control --> <!-- Debugging control -->
<BufferSecurityCheck Condition="'$(Configuration)' == 'Debug'">true</BufferSecurityCheck> <BufferSecurityCheck Condition="'$(Configuration)' == 'Debug'">true</BufferSecurityCheck>
<BasicRuntimeChecks Condition="'$(Configuration)' == 'Debug'">EnableFastChecks</BasicRuntimeChecks> <BasicRuntimeChecks Condition="'$(Configuration)' == 'Debug'">EnableFastChecks</BasicRuntimeChecks>
<!-- Feature we dont use that bloats release builds anyway --> <!-- Feature we dont use that bloats release builds anyway -->
<RuntimeTypeInfo>false</RuntimeTypeInfo> <RuntimeTypeInfo>false</RuntimeTypeInfo>
<!-- Features theres no sense in having disabled --> <!-- Features theres no sense in having disabled -->
<StringPooling>true</StringPooling> <StringPooling>true</StringPooling>
<!-- Not sure if we need this yet --> <!-- Not sure if we need this yet -->
<ExceptionHandling>Sync</ExceptionHandling> <ExceptionHandling>Sync</ExceptionHandling>
<!-- Not sure why we chose this, study it later --> <!-- Not sure why we chose this, study it later -->
<CallingConvention>Cdecl</CallingConvention> <CallingConvention>Cdecl</CallingConvention>
<RuntimeLibrary Condition="'$(Configuration)' == 'Debug'">MultiThreadedDebugDll</RuntimeLibrary> <RuntimeLibrary Condition="'$(Configuration)' == 'Debug'">MultiThreadedDebugDll</RuntimeLibrary>
<RuntimeLibrary Condition="'$(Configuration)' != 'Debug'">MultiThreadedDll</RuntimeLibrary> <RuntimeLibrary Condition="'$(Configuration)' != 'Debug'">MultiThreadedDll</RuntimeLibrary>
</ClCompile> </ClCompile>
<Link> <Link>
<OutputFile>$(TargetPath)</OutputFile> <OutputFile>$(TargetPath)</OutputFile>
<!-- deps config for x64 --> <!-- deps config for x64 -->
<AdditionalLibraryDirectories Condition="'$(Platform)' == 'x64'">.\zlib128;agg;.libs;.libs\x64</AdditionalLibraryDirectories> <AdditionalLibraryDirectories Condition="'$(Platform)' == 'x64'">.\zlib128;agg;.libs;.libs\x64</AdditionalLibraryDirectories>
<AdditionalDependencies Condition="'$(Platform)' == 'x64'">directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib;zlib-vc8-x64.lib;agg-2.5-x64.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies Condition="'$(Platform)' == 'x64'">directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib;zlib-vc8-x64.lib;agg-2.5-x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<!-- deps config for Win32 --> <!-- deps config for Win32 -->
<AdditionalLibraryDirectories Condition="'$(Platform)' == 'Win32'">.\zlib128;agg;.libs;.libs\win32</AdditionalLibraryDirectories> <AdditionalLibraryDirectories Condition="'$(Platform)' == 'Win32'">.\zlib128;agg;.libs;.libs\win32</AdditionalLibraryDirectories>
<AdditionalDependencies Condition="'$(Platform)' == 'Win32'">directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib;zlib-vc8-Win32.lib;agg-2.5.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies Condition="'$(Platform)' == 'Win32'">directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib;zlib-vc8-Win32.lib;agg-2.5.lib;%(AdditionalDependencies)</AdditionalDependencies>
<!-- special deps config for newer VS --> <!-- special deps config for newer VS -->
<AdditionalDependencies Label="Configuration" Condition="'$(VisualStudioVersion)' == '14.0'">legacy_stdio_definitions.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies Label="Configuration" Condition="'$(VisualStudioVersion)' == '14.0'">legacy_stdio_definitions.lib;%(AdditionalDependencies)</AdditionalDependencies>
<!-- general deps config --> <!-- general deps config -->
<AdditionalDependencies>lua51.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>lua51.lib;%(AdditionalDependencies)</AdditionalDependencies>
<!-- (and windows libs) --> <!-- (and windows libs) -->
<AdditionalDependencies>vfw32.lib;winmm.lib;opengl32.lib;glu32.lib;ws2_32.lib;user32.lib;gdi32.lib;shell32.lib;comdlg32.lib;shlwapi.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>vfw32.lib;winmm.lib;opengl32.lib;glu32.lib;ws2_32.lib;user32.lib;gdi32.lib;shell32.lib;comdlg32.lib;shlwapi.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>lua51.dll</DelayLoadDLLs> <DelayLoadDLLs>lua51.dll</DelayLoadDLLs>
<!-- debugging options --> <!-- debugging options -->
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile> <GenerateMapFile>true</GenerateMapFile>
<!-- optimization options --> <!-- optimization options -->
<LinkTimeCodeGeneration Condition="'$(Configuration)' == 'Release'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration> <LinkTimeCodeGeneration Condition="'$(Configuration)' == 'Release'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<!-- random configs --> <!-- random configs -->
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress> <RandomizedBaseAddress>false</RandomizedBaseAddress>
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<TargetMachine Condition="'$(Platform)' == 'x64'">MachineX64</TargetMachine> <TargetMachine Condition="'$(Platform)' == 'x64'">MachineX64</TargetMachine>
<!-- prebuilt zlib is incompatible with this, and it's useless anyway --> <!-- prebuilt zlib is incompatible with this, and it's useless anyway -->
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Manifest> <Manifest>
<AdditionalManifestFiles>DeSmuME_$(Platform).manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles> <AdditionalManifestFiles>DeSmuME_$(Platform).manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest> </Manifest>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<!-- ================ UNDUPOBJ ================ --> <!-- ================ UNDUPOBJ ================ -->
<!-- relevant topics --> <!-- relevant topics -->
<!-- http://stackoverflow.com/questions/3729515/visual-studio-2010-2008-cant-handle-source-files-with-identical-names-in-diff/26935613 --> <!-- http://stackoverflow.com/questions/3729515/visual-studio-2010-2008-cant-handle-source-files-with-identical-names-in-diff/26935613 -->
<!-- http://stackoverflow.com/questions/7033855/msvc10-mp-builds-not-multicore-across-folders-in-a-project --> <!-- http://stackoverflow.com/questions/7033855/msvc10-mp-builds-not-multicore-across-folders-in-a-project -->
<!-- http://stackoverflow.com/questions/18304911/how-can-one-modify-an-itemdefinitiongroup-from-an-msbuild-target --> <!-- http://stackoverflow.com/questions/18304911/how-can-one-modify-an-itemdefinitiongroup-from-an-msbuild-target -->
<!-- other maybe related info --> <!-- other maybe related info -->
<!-- http://stackoverflow.com/questions/841913/modify-msbuild-itemgroup-metadata --> <!-- http://stackoverflow.com/questions/841913/modify-msbuild-itemgroup-metadata -->
<UsingTask TaskName="UNDUPOBJ_TASK" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> <UsingTask TaskName="UNDUPOBJ_TASK" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup> <ParameterGroup>
<OutputDir ParameterType="System.String" Required="true" /> <OutputDir ParameterType="System.String" Required="true" />
<ItemList ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" /> <ItemList ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
<OutputItemList ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" /> <OutputItemList ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" />
</ParameterGroup> </ParameterGroup>
<Task> <Task>
<Code><![CDATA[ <Code><![CDATA[
//general outline: for each item (in ClCompile) assign it to a subdirectory of $(IntDir) by allocating subdirectories 0,1,2, etc., as needed to prevent duplicate filenames from clobbering each other //general outline: for each item (in ClCompile) assign it to a subdirectory of $(IntDir) by allocating subdirectories 0,1,2, etc., as needed to prevent duplicate filenames from clobbering each other
//this minimizes the number of batches that need to be run, since each subdirectory will necessarily be in a distinct batch due to /Fo specifying that output subdirectory //this minimizes the number of batches that need to be run, since each subdirectory will necessarily be in a distinct batch due to /Fo specifying that output subdirectory
var assignmentMap = new Dictionary<string,int>(); var assignmentMap = new Dictionary<string,int>();
foreach( var item in ItemList ) foreach( var item in ItemList )
{ {
//solve bug e.g. Checkbox.cpp vs CheckBox.cpp //solve bug e.g. Checkbox.cpp vs CheckBox.cpp
var filename = item.GetMetadata("Filename").ToUpperInvariant(); var filename = item.GetMetadata("Filename").ToUpperInvariant();
//assign reused filenames to increasing numbers //assign reused filenames to increasing numbers
//assign previously unused filenames to 0 //assign previously unused filenames to 0
int assignment = 0; int assignment = 0;
if(assignmentMap.TryGetValue(filename, out assignment)) if(assignmentMap.TryGetValue(filename, out assignment))
assignmentMap[filename] = ++assignment; assignmentMap[filename] = ++assignment;
else else
assignmentMap[filename] = 0; assignmentMap[filename] = 0;
var thisFileOutdir = Path.Combine(OutputDir,assignment.ToString()) + "/"; //take care it ends in / so /Fo knows it's a directory and not a filename var thisFileOutdir = Path.Combine(OutputDir,assignment.ToString()) + "/"; //take care it ends in / so /Fo knows it's a directory and not a filename
item.SetMetadata( "ObjectFileName", thisFileOutdir ); item.SetMetadata( "ObjectFileName", thisFileOutdir );
} }
OutputItemList = ItemList; OutputItemList = ItemList;
ItemList = new Microsoft.Build.Framework.ITaskItem[0]; ItemList = new Microsoft.Build.Framework.ITaskItem[0];
]]></Code> ]]></Code>
</Task> </Task>
</UsingTask> </UsingTask>
<Target Name="UNDUPOBJ"> <Target Name="UNDUPOBJ">
<!-- see stackoverflow topics for discussion on why we need to do some loopy copying stuff here --> <message importance="high" text="PLATFORM: $(Platform)"/>
<ItemGroup> <!-- see stackoverflow topics for discussion on why we need to do some loopy copying stuff here -->
<ClCompileCopy Include="@(ClCompile)"/> <ItemGroup>
<ClCompile Remove="@(ClCompile)"/> <ClCompileCopy Include="@(ClCompile)"/>
</ItemGroup> <ClCompile Remove="@(ClCompile)"/>
<UNDUPOBJ_TASK OutputDir="$(IntDir)" ItemList="@(ClCompileCopy)" OutputItemList="@(ClCompile)"> </ItemGroup>
<Output ItemName="ClCompile" TaskParameter="OutputItemList"/> <UNDUPOBJ_TASK OutputDir="$(IntDir)" ItemList="@(ClCompileCopy)" OutputItemList="@(ClCompile)">
</UNDUPOBJ_TASK> <Output ItemName="ClCompile" TaskParameter="OutputItemList"/>
</Target> </UNDUPOBJ_TASK>
<!-- ================ UNDUPOBJ ================ --> </Target>
<!-- ================ UNDUPOBJ ================ -->
</Project> </Project>