CMake issues with Visual Studio Ninja generator
There is a Ninja-based generator for Visual studio, which is used if you create a project using Visual Studio's CMake integration. There are issues with it because the CONFIG generator expression has a different meaning than in other generators. Normally it is equal to one of the possible values for CMAKE_BUILD_TYPE. But in the VS Ninja generator, it is an arbitrary name.
This issue is not very important to solve, but I am writing some notes in case it comes up.
Possible workarounds:
- Use an external CMake install to create VS projects with the classic generator (I am doing this).
- Set
USE_PRECOMPILED_HEADERSandBUILD_GAME_NACLto 0, which will avoid the two places where this generator expression variable is used.
It might be possible to fix by making variables to evaluate to whether the build type is equal to [foo] in generator expressions, which would be $<CONFIG:foo> or the result of ${CMAKE_BUILD_TYPE} EQ foo depending on which generator is being used.
I suppose the precompiled headers error is a moot point, since they don't work on Ninja anyway.
Besides the NaCl bit there's one more use of CONFIG generator expressions - adding the DEBUG_BUILD define.