| @@ -1657,6 +1657,10 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio | |||||
| get_filename_component(_pchName "${_pchFile}" NAME) | get_filename_component(_pchName "${_pchFile}" NAME) | ||||
| set (_xLanguage_C "c-header") | set (_xLanguage_C "c-header") | ||||
| set (_xLanguage_CXX "c++-header") | set (_xLanguage_CXX "c++-header") | ||||
| set (_pchSuppressMessages FALSE) | |||||
| if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*") | |||||
| set(_pchSuppressMessages TRUE) | |||||
| endif() | |||||
| if (_flags) | if (_flags) | ||||
| # append to list | # append to list | ||||
| if ("${_language}" STREQUAL "CXX") | if ("${_language}" STREQUAL "CXX") | ||||
| @@ -1664,13 +1668,17 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio | |||||
| endif() | endif() | ||||
| list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-create" "${_pchName}" "-fsyntax-only" "${_hostFile}") | list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-create" "${_pchName}" "-fsyntax-only" "${_hostFile}") | ||||
| if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0") | if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0") | ||||
| list (APPEND _flags "-Wpch-messages") | |||||
| if (NOT _pchSuppressMessages) | |||||
| list (APPEND _flags "-Wpch-messages") | |||||
| endif() | |||||
| endif() | endif() | ||||
| else() | else() | ||||
| # return as a flag string | # return as a flag string | ||||
| set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-create \"${_pchName}\"") | set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-create \"${_pchName}\"") | ||||
| if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0") | if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0") | ||||
| set (_flags "${_flags} -Wpch-messages") | |||||
| if (NOT _pchSuppressMessages) | |||||
| set (_flags "${_flags} -Wpch-messages") | |||||
| endif() | |||||
| endif() | endif() | ||||
| endif() | endif() | ||||
| endif() | endif() | ||||
| @@ -1781,17 +1789,25 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV | |||||
| if (_pchFile) | if (_pchFile) | ||||
| get_filename_component(_pchDir "${_pchFile}" DIRECTORY) | get_filename_component(_pchDir "${_pchFile}" DIRECTORY) | ||||
| get_filename_component(_pchName "${_pchFile}" NAME) | get_filename_component(_pchName "${_pchFile}" NAME) | ||||
| set (_pchSuppressMessages FALSE) | |||||
| if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*") | |||||
| set(_pchSuppressMessages TRUE) | |||||
| endif() | |||||
| if (_flags) | if (_flags) | ||||
| # append to list | # append to list | ||||
| list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-use" "${_pchName}") | list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-use" "${_pchName}") | ||||
| if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0") | if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0") | ||||
| list (APPEND _flags "-Wpch-messages") | |||||
| if (NOT _pchSuppressMessages) | |||||
| list (APPEND _flags "-Wpch-messages") | |||||
| endif() | |||||
| endif() | endif() | ||||
| else() | else() | ||||
| # return as a flag string | # return as a flag string | ||||
| set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-use \"${_pchName}\"") | set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-use \"${_pchName}\"") | ||||
| if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0") | if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0") | ||||
| set (_flags "${_flags} -Wpch-messages") | |||||
| if (NOT _pchSuppressMessages) | |||||
| set (_flags "${_flags} -Wpch-messages") | |||||
| endif() | |||||
| endif() | endif() | ||||
| endif() | endif() | ||||
| else() | else() | ||||