forked from BigfootDev/flatbuffers
* [CMake] : Add precompiled header support with FLATBUFFERS_ENABLE_PCH FLATBUFFERS_ENABLE_PCH enable precompile headers support for 'flatbuffers' and 'flatc'. Default if OFF. You need to set it to ON to make it work. 'cmake -DFLATBUFFERS_ENABLE_PCH=ON ..' This will only work if CMake version is >= 3.16, because target_precompile_headers is used. If CMake doesn't have target_precompile_headers, then nothing will happen. This can speed up compilation time. Precompiled header file for 'flatbuffers' is 'pch.h' Precompiled header file for 'flatc' is 'flatc_pch.h' * Enable FLATBUFFERS_ENABLE_PCH for VC 2017 and VS2019 builds * [CMake]: Fix error in FLATBUFFERS_ENABLE_PCH description * Add a function add_pch_to_target to avoid copy and pasting the same code like add_fsanitize_to_target Move pch.h and flatc_pch.h from include/flatbuffers to include/flatbuffers/pch Make flatc_pch.h depends on pch.h since it extend it