I could make it work at Ubuntu 19.10 with Code::Blocks 20.03 from the ppa:codeblocks-dev/release
For C++ project.
for framework.h to produce precompiled header
1. Select at Main Project Options the Precompiled Header Strategy : Generate PCH alongside original header (default) (don't know if this flag actually currently makes any difference for this).
2. Create framework.cpp that includes just framework.h.
3. Select at framework.cpp properties for it just to be built (not linked) and lower priority to 0 to make it build firstly.
4. At framework.cpp properties > advanced tab, check custom build and set it to:
$compiler $options $includes -x c++-header framework.h -o framework.h.gch
5. For the project, set the extra compiler option:
-include "framework.h"
If this option is not set, clang++ won't use the precompiled header even if its present at the folder or even if it is included inside the cpp explicitly.
I couldn't set these properties I had set for framework.cpp at framework.h. Code::Blocks seems not to build it when using LLVM CLang compiler (it shows not dimmed at the project tree, but it still doesn't built.)
And the -emit-pch seems to be a clang option for another environment or situation, not for this C++ thing.
I am facing another problem now. The C11 flag (for clang) and C++17 (for clang++) keep offending each other on LLVM Clang projects with blend of C++ and C files. This used to happen with GCC compiler but it was fixed. Now it seems to be a problem with LLVM Clang compiler (at Ubuntu Linux, at least). (I think it may happen because the -include "framework.h" is there (in the C files (clang)) and the precompiled-header was compiled with C++17 options for C++.)
Best regards,
Camilo