[CMAKE] Implement PCH builds with target_precompile_headers. CORE-16905

This commit is contained in:
Amine Khaldi 2020-05-09 22:37:40 +01:00 committed by Victor Perevertkin
parent 4cd7b3a3df
commit 139a3d6661
No known key found for this signature in database
GPG key ID: C750B7222E9C7830
123 changed files with 874 additions and 644 deletions

View file

@ -974,3 +974,13 @@ function(add_rostests_file)
endif()
endif()
endfunction()
if(PCH)
macro(add_pch _target _pch _skip_list)
target_precompile_headers(${_target} PRIVATE ${_pch})
set_source_files_properties(${_skip_list} PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
endmacro()
else()
macro(add_pch _target _pch _skip_list)
endmacro()
endif()