Adding PCH for MINGW to cmake

Discussion about CodeLite development process and patches
stahta01
CodeLite Enthusiast
Posts: 39
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

Adding PCH for MINGW to cmake

Post by stahta01 »

I am working on adding PCH when building with MINGW GCC under Msys2, and I will need to edit over half of the cmake CMakeLists.txt files to do it.
I am using the cmake target_precompile_headers() that was added in 3.16.
I added this for now to the root CMakeLists.txt.

Code: Select all

if ( USE_PCH AND MINGW )
    if( CMAKE_VERSION VERSION_LESS "3.16" )
        message(FATAL_ERROR "MinGW with PCH requires CMake version 3.16 or higher")
    endif()    
endif()

Would you want me instead to change the cmake_minimum_required() value?

I plan to remove all trailing spaces and run "dos2unix" on each CMakeLists.txt file.
Do you wish me to also run "clang-format --style=file" on each CMakeLists.txt file?

My computer is too old to be certain that adding PCH helps in building CodeLite with MinGW GCC under MSys2.
So, you will have to test if the changes are worth while.

The build time is too heavily influenced by my slow hard drive access time.
I learned this doing PCH tests while building Code::Blocks I see no reason the same will not be true for CodeLite.

Tim S.

User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Adding PCH for MINGW to cmake

Post by eranif »

I am fine with increasing the minimum CMake value

Make sure you have read the HOW TO POST thread
Post Reply