Precompile headers: build failure when compiling Objective-C++ source files
If one uses the Ninja or Makefile generator, precompile headers support, and Objective-C++ files, the build will fail.
The Objective-C++ files (*.mm) need to be in the client CMake code marked with SKIP_PRECOMPILE_HEADERS
.
This is due to the fact that CMake's precompile headers feature supports only the C
/ C++
languages. Objective-C++ files appear in CMake as C++
files, and there is no way they can be excluded / use an Objective-C++ tailored PCH file.
CMake needs to learn how to distinguish the Objective-C++ differently as C++. Using a cmSystemTools::StringEndsWith(file, ".mm")
seems very hackish.