-
- Downloads
Fix crash on $<TARGET_PROPERTY:...,LOCATION> genex (#16134)
Policy CMP0026 deprecated the LOCATION property, and we have long provided a $<TARGET_FILE:...> generator expression. However, if a project tries to use $<TARGET_PROPERTY:...,LOCATION> we should at least not crash. The compatibility implementation of the LOCATION property uses cmGlobalGenerator::CreateGenerationObjects to create the structures needed to evaluate the property before generation starts. The implementation assumed that accessing the property could only be done during configuration (via the typical get_property command use case). The $<TARGET_PROPERTY:...,LOCATION> genex causes the LOCATION property to be accessed during generation. Calling CreateGenerationObjects during generation blows away all the objects currently being used for generation and is not safe. Add a condition to call it only when configuration is not finished.
Showing
- Source/cmTarget.cxx 9 additions, 3 deletionsSource/cmTarget.cxx
- Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake 1 addition, 0 deletionsTests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
- Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-LOCATION-stderr.txt 10 additions, 0 deletions...e/GeneratorExpression/TARGET_PROPERTY-LOCATION-stderr.txt
- Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-LOCATION.cmake 3 additions, 0 deletions...nCMake/GeneratorExpression/TARGET_PROPERTY-LOCATION.cmake
Loading