Spec-Zone.ru › CMake

UNITY_BUILD_FILENAME_PREFIX

Added in version 4.2.

By default, the unity file generated when UNITY_BUILD is enabled is of the form unity_<index>_<suffix>, where <suffix> is language-specific.

If several targets are using unity builds, the build output may give no indication which target a unity file belongs to. This property allows customizing the prefix of the generated unity file name. If unset, the default prefix unity_ is used.

Example usage:

add_library(example_library
            source1.cxx
            source2.cxx
            source3.cxx)

set_target_properties(example_library PROPERTIES
                      UNITY_BUILD True
                      UNITY_BUILD_FILENAME_PREFIX "example_")

© 2000–2026 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD_FILENAME_PREFIX.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API