[RFC] Refactor declaration generation error detection

The initial goal for this was to allow declaration generation to work in windows (as part of #696) however this ends up allowing us to detect cases when the generator fails.instead of failing silently. And the only *(Windows?)* specific bit here is the different preprocessor line format.

BTW can anyone confirm in which versions of Clang preprocessor (-E) prints #line instead of just #?

Ping @ZyX-I - one case I did not cover was when the generator fails to find any declaration for a file - can we treat this as an error and fail?

In a nutshell
- Call compiler from CMake instead of lua script to generate a
  preprocessor file - allows for better/early error detection if
  the compiler fails
- Accept preprocessor lines with trailing chars after # as is
  the case in Clang/Windows
- The fourth argument to gendeclarations.lua is now the path to
  the proprocessor output file
Do not use `-U`, change `EQUAL` above to `MATCHES`. It appears that `EQUAL` which used to work only because I did not test clean compilation.