Configurations from X64 project file

Main development forum.

Configurations from X64 project file

Postby gerundt » Tue Sep 07, 2010 1:45 pm

Our X64 project file for Visual Studio (MergeX64.vcproj) has the following configurations:

  • UnicodeRelease|Win32
  • UnicodeRelease|x64
  • UnicodeDebug|Win32
  • UnicodeDebug|x64
  • X64 Debug|Win32
  • X64 Debug|x64
  • X64 Release|Win32
  • X64 Release|x64

What is the different between "Unicode*" and "X64 *" configurations? I compared for example "UnicodeRelease|Win32" with "X64 Release|Win32" and saw only a different <OutputDirectory>. The same with "UnicodeRelease|x64" and "X64 Release|x64":

Code: Select all
       <Configuration
-         Name="UnicodeRelease|Win32"
-         OutputDirectory=".\..\BuildTmp\MergeUnicodeRelease"
-         IntermediateDirectory=".\..\BuildTmp\MergeUnicodeRelease"
+         Name="X64 Release|Win32"
+         OutputDirectory="$(ConfigurationName)"
+         IntermediateDirectory="$(ConfigurationName)"
          ConfigurationType="1"
          InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
          UseOfMFC="2"


Code: Select all
       <Configuration
-         Name="UnicodeRelease|x64"
-         OutputDirectory=".\..\BuildTmp\$(PlatformName)\Merge$(ConfigurationName)"
-         IntermediateDirectory=".\..\BuildTmp\$(PlatformName)\Merge$(ConfigurationName)"
+         Name="X64 Release|x64"
+         OutputDirectory=".\..\BuildTmp\$(PlatformName)\$(ConfigurationName)"
+         IntermediateDirectory=".\..\BuildTmp\$(PlatformName)\$(ConfigurationName)"
          ConfigurationType="1"
          InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
          UseOfMFC="2"


So if it the configurations are the same, we should maybe merge them and drop the "X64 *" configurations. There are a little bit confusing, because I don't know what we compile, if I select for example "X64 Release|Win32": x64 or Win32?

Greetings,
Tim
gerundt
Site Admin
 
Posts: 192
Joined: Wed Sep 24, 2008 8:47 am
Location: Germany

Re: Configurations from X64 project file

Postby kimmov » Tue Sep 07, 2010 2:37 pm

Ok, nice mess there.

The Unicode configuration is for 32-bit Windows to use the Unicode versions of WIN32 API. The difference to legacy ANSI is we add couple of defines to (pre)compiler to select use of Unicode versions of API calls. And for linker to link against Unicode libraries.

For 64-bit Windows there is no ANSI API anymore. Only Unicode versions, so no need to mention "Unicode" in configuration name. And 64-bit Windows has this backwards compatibility layer that can run 32-bit Unicode applications. But "native" applications for 64-bit Windows use the 64-bit compilation and link against 64-bit libraries. Which are selected by (pre)compiler and linker switches. There should be at least "WIN64" defined for precompiler.

And one way to test if executable/DLL is 64-bit is to open it with Dependency Walker and see which DLLs it links against. And of course 64-bit app does not start in 32-bit Windows.

We really need only these configurations:
  • UnicodeRelease|Win32
  • UnicodeDebug|Win32
  • X64 Debug|x64
  • X64 Release|x64
kimmov
 
Posts: 562
Joined: Thu Sep 11, 2008 8:51 pm
Location: Finland

Re: Configurations from X64 project file

Postby gerundt » Tue Sep 07, 2010 3:49 pm

Since we drop ANSI support with WinMerge 2.14 did we really need to mention "Unicode" for Win32 anymore? And since the "X64 *" configurations has only the platform "x64" would it not be easier for the user to have just a "Release" and "Debug" configuration with different platform settings?

  • Release|Win32
  • Release|x64
  • Debug|Win32
  • Debug|x64
gerundt
Site Admin
 
Posts: 192
Joined: Wed Sep 24, 2008 8:47 am
Location: Germany

Re: Configurations from X64 project file

Postby kimmov » Tue Sep 07, 2010 3:57 pm

It may make sense to keep the "Unicode" so it is more obvious, especially for new people compiling, that it is Unicode target, not ANSI target. Just a thought...
kimmov
 
Posts: 562
Joined: Thu Sep 11, 2008 8:51 pm
Location: Finland

Re: Configurations from X64 project file

Postby gerundt » Wed Sep 08, 2010 12:49 pm

I submitted a patch (#3061941) which delete the "X64 *"configurations from the X64 project file.

After the patch we have the following configurations:

  • UnicodeRelease|Win32
  • UnicodeRelease|x64
  • UnicodeDebug|Win32
  • UnicodeDebug|x64
gerundt
Site Admin
 
Posts: 192
Joined: Wed Sep 24, 2008 8:47 am
Location: Germany

Re: Configurations from X64 project file

Postby kimmov » Wed Sep 08, 2010 1:06 pm

Sorry I was unclear in my previous message . I mean to say keeping "Unicode" would be good for Win32 as there it is not explicit. For x64 it is explicit so it indeed is unnecessary.
kimmov
 
Posts: 562
Joined: Thu Sep 11, 2008 8:51 pm
Location: Finland

Re: Configurations from X64 project file

Postby gerundt » Wed Sep 08, 2010 1:38 pm

I know that Unicode is unnecessary for x64, but it seems, that if you have two platforms in a project, you can always change the platform for a config!

If your project have for example a "UnicodeRelease|Win32" and a "X64 Release|x64" configuration, the user can still change to "UnicodeRelease|x64" and "X64 Release|Win32", even it is not defined.

So if we use the same name for Win32 and x64 the user can't select something wrong. :)
gerundt
Site Admin
 
Posts: 192
Joined: Wed Sep 24, 2008 8:47 am
Location: Germany

Re: Configurations from X64 project file

Postby kimmov » Wed Sep 08, 2010 1:57 pm

Ah ok, I forgot this "feature" in VS... 8-)
kimmov
 
Posts: 562
Joined: Thu Sep 11, 2008 8:51 pm
Location: Finland

Re: Configurations from X64 project file

Postby gerundt » Mon Nov 01, 2010 1:53 pm

Ok, I backported this also to branch R2_14...
gerundt
Site Admin
 
Posts: 192
Joined: Wed Sep 24, 2008 8:47 am
Location: Germany


Return to Developers

Who is online

Users browsing this forum: No registered users and 3 guests

cron