I have two toolkits for the platform: v110 and v110_xp for my project, and depending on the platform I want to include / exclude part of the compiled code.
_MSC_FULL_VER and $(PlatformToolsetVersion) have exactly the same value for both of these platform toolkits. As an alternative, I tried using $(PlatformToolset) as follows:
_MSC_PLATFORM_TOOLSET=$(PlatformToolset)
but the problem is that $(PlatformToolset) not numeric. I wonder how I can use this non-numeric value as a preprocessor directive?
After trying a few solutions, I realized that
_MSC_PLATFORM_TOOLSET='$(PlatformToolset)'
and then
#if (_MSC_PLATFORM_TOOLSET=='v110') [Something]
works fine but
#if(_MSC_PLATFORM_TOOLSET == 'v110_xp') [SomethingElse]
results in "too many characters in the character constant" .
In context, see this similar question: Visual Studio: how to programmatically use the C ++ toolkit
c ++ visual-studio-2012 preprocessor-directive
hagh
source share