This repository was archived by the owner on Apr 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2355,12 +2355,22 @@ function (cotire_generate_target_script _language _configurations _target _targe
23552355 CMAKE_${_language} _SOURCE_FILE_EXTENSIONS)
23562356 if (DEFINED ${_var} )
23572357 string (REPLACE "\" " "\\\" " _value "${${_var} }" )
2358- set (_contents "${_contents} set (${_var} \" ${_value} \" )\n " )
2359- if (NOT _contentsHasGeneratorExpressions)
2360- if ("${_value} " MATCHES "\\ $<.*>" )
2358+
2359+ if ("${_value} " MATCHES "\\ $<.*>" )
2360+ # We have to evaluate generator expressions
2361+ if (NOT _contentsHasGeneratorExpressions)
23612362 set (_contentsHasGeneratorExpressions TRUE )
23622363 endif ()
2364+
2365+ # Expand various generator expressions which can only be evaluated on binary targets manually
2366+ foreach (_currentReplacedGeneratorExpression "C_COMPILER_ID" "CXX_COMPILER_ID" )
2367+ set (_currentReplacement ${CMAKE_${_currentReplacedGeneratorExpression} })
2368+
2369+ string (REGEX REPLACE "\\ $<${_currentReplacedGeneratorExpression} :([a -zA -Z0 -9]*)>" "$<STREQUAL :\\\\\"${_currentReplacement} \\\\\",\\\\\"\\1\\\\\">" _value "${_value} " )
2370+ endforeach (_currentReplacedGeneratorExpression )
23632371 endif ()
2372+
2373+ set (_contents "${_contents} set (${_var} \" ${_value} \" )\n " )
23642374 endif ()
23652375 endforeach ()
23662376 # generate target script file
You can’t perform that action at this time.
0 commit comments