Hi,
I’ve seen many discussions on how to skip compiler checks but they haven’t provided me with a good comprehension of what they were and how to avoid redundant checks.
I’ve got situations where I configure independent projects with the same configuration options. Thus I’d like to perform the compiler checks only on the first project and reuse meaningful “state” directly in other projects, in order to reduce overall configuration time.
I can’t find documentation about that. What I observe is that those compiler checks occur on “cold” project (with no cmake cache), giving this kind of output:
– The C compiler identification is MSVC 19.xxx
– The CXX compiler identification is MSVC 19.xxx
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: C:/Program Files (x86)/…/cl.exe - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: C:/Program Files (x86)/…/cl.exe - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Performing Test COMPILER_HAS_DEPRECATED_ATTR
– Performing Test COMPILER_HAS_DEPRECATED_ATTR - Failed
– Performing Test COMPILER_HAS_DEPRECATED
– Performing Test COMPILER_HAS_DEPRECATED - Success
– Configuring done (yys)
– Generating done (zzs)
– Build files have been written to: C:/…
When the project is “hot” (a cmake cache exists), there is no such output and the configuration is faster, leading me to think that some information has been written in the cache, is reused and inhibits the checks.
What I don’t understand is:
- when do those checks start
- what is their effect on the project
- how can I “capture” these effects and apply them to other projects in order to skip the checks altogether.
NB my configuration options can be many things thus it seems not possible to design some configuration file for every possible situations; I’d really like to let cmake generate automatically what is needed and provides me with a way to apply it to different projects.
Regards
A.