jbeder / yaml-cpp

A YAML parser and emitter in C++
MIT License
4.91k stars 1.78k forks source link

Disable `format` Target When Not Building as the Main Project #1231

Closed threeal closed 8 months ago

threeal commented 9 months ago

This pull request modifies the YAML_CPP_FORMAT_SOURCE option to default to enabled only when building as the main project. This change prevents conflicts with the format target if this project is included by another project that already has its own format target. Previously, YAML_CPP_FORMAT_SOURCE needed to be manually set to false to avoid this issue.