CMAKE_UNITY_BUILD_BATCH_SIZE seens not has any effect in windows & linux

Our team open the unity build in cmake, unity build is work right, but the batch size seens not have any effect for our.

test code is like:

set_target_properties(TableReader PROPERTIES
UNITY_BUILD_MODE BATCH
CMAKE_UNITY_BUILD_BATCH_SIZE 20
UNITY_BUILD ON
)

CMAKE_UNITY_BUILD_BATCH_SIZE is a variable you can set on global/directory scope. It serves as a default value for UNITY_BUILD_BATCH_SIZE property.

You probably want:

set_target_properties(TableReader PROPERTIES
    UNITY_BUILD_MODE BATCH
    UNITY_BUILD_BATCH_SIZE 20
    UNITY_BUILD ON
)
2 Likes