From 7a20a8c98c34785c903755af923c16ad77bd8e78 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 21 Jun 2023 20:41:53 -0500 Subject: [PATCH] CMake: avoid adding ${DEAL_II_BUNDLED_INCLUDE_DIRS} to bundled targets These include files should only be added as system include directories to dependend targets and not to the bundled targets themselves. While this commit looks purely aesthetic, this commit actually works around an obscure compiler bug with ICC 19 that otherwises errors out with when trying to compile our bundled tbb library. --- .../macros/macro_populate_target_properties.cmake | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cmake/macros/macro_populate_target_properties.cmake b/cmake/macros/macro_populate_target_properties.cmake index edd794a706..c85f4f0708 100644 --- a/cmake/macros/macro_populate_target_properties.cmake +++ b/cmake/macros/macro_populate_target_properties.cmake @@ -62,9 +62,17 @@ function(populate_target_properties _target _build) ${CMAKE_BINARY_DIR}/include ${CMAKE_SOURCE_DIR}/include ) - target_include_directories(${_target} SYSTEM PRIVATE - ${DEAL_II_BUNDLED_INCLUDE_DIRS} - ) + + # + # Do not add bundled include directories to bundled_ targets. First of + # all this is unnecessary, secondly, this severly trips up ICC-19 that + # cannot handle the additional -isystem include properly... + # + if(NOT "${_target}" MATCHES "^bundled_") + target_include_directories(${_target} SYSTEM PRIVATE + ${DEAL_II_BUNDLED_INCLUDE_DIRS} + ) + endif() # Interface includes: -- 2.39.5