diff --git a/thirdparty/cotire.cmake b/thirdparty/cotire.cmake index 948ac15..075ec79 100644 --- a/thirdparty/cotire.cmake +++ b/thirdparty/cotire.cmake @@ -931,7 +931,13 @@ function (cotire_add_includes_to_cmd _cmdVar _language _includesVar _systemInclu list (FIND ${_systemIncludesVar} "${_include}" _index) endif() if (_index GREATER -1) - list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}") + if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang") + string(REPLACE " " "" _flag ${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}) + list (APPEND ${_cmdVar} "${_flag}") + list (APPEND ${_cmdVar} "${_include}") + else() + list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}") + endif() else() list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}") endif()