diff --git a/Telegram/gyp/PrecompiledHeader.cmake b/Telegram/gyp/PrecompiledHeader.cmake index a0e1e04899..dfe1193be5 100644 --- a/Telegram/gyp/PrecompiledHeader.cmake +++ b/Telegram/gyp/PrecompiledHeader.cmake @@ -81,7 +81,7 @@ function(export_all_flags _filename _source_name_for_flags) endfunction() function(add_precompiled_header _target _input) - if(CMAKE_COMPILER_IS_GNUCXX) + if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU|Clang") get_filename_component(_name ${_input} NAME) set(_pch_header "${CMAKE_CURRENT_SOURCE_DIR}/${_input}") set(_pch_binary_dir "${CMAKE_CURRENT_BINARY_DIR}/${_target}_pch") @@ -163,5 +163,11 @@ function(add_precompiled_header _target _input) OBJECT_DEPENDS "${_object_depends}") endif() endforeach() - endif(CMAKE_COMPILER_IS_GNUCXX) + + if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + if(NOT _PCH_FORCEINCLUDE) + set(_PCH_FORCEINCLUDE ON) + endif() + endif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + endif(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU|Clang") endfunction()