diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-05-06 19:45:42 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2020-05-07 15:13:34 (GMT) |
commit | 9f4eb352fe1383f740876e3924205be1d4bf897c (patch) | |
tree | 6911d23d9c5f950860a9ba1d0048b4d7f1417f1c /Tests/RunCMake/UnityBuild/unitybuild_c_group.cmake | |
parent | b00585adcc11afcf4d02d9d9927a929f33b19546 (diff) | |
download | CMake-9f4eb352fe1383f740876e3924205be1d4bf897c.zip CMake-9f4eb352fe1383f740876e3924205be1d4bf897c.tar.gz CMake-9f4eb352fe1383f740876e3924205be1d4bf897c.tar.bz2 |
Unity Builds: Support explicit specification of sources to groups
Instead of having CMake determine which files should go into each
unity file, the user can now use explicitly state the mapping.
Diffstat (limited to 'Tests/RunCMake/UnityBuild/unitybuild_c_group.cmake')
-rw-r--r-- | Tests/RunCMake/UnityBuild/unitybuild_c_group.cmake | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_group.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_group.cmake new file mode 100644 index 0000000..1fa17f3 --- /dev/null +++ b/Tests/RunCMake/UnityBuild/unitybuild_c_group.cmake @@ -0,0 +1,17 @@ +project(unitybuild_c C) + +set(srcs "") +foreach(s RANGE 1 8) + set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c") + file(WRITE "${src}" "int s${s}(void) { return 0; }\n") + list(APPEND srcs "${src}") +endforeach() + +add_library(tgt SHARED ${srcs}) + +set_target_properties(tgt PROPERTIES UNITY_BUILD ON + UNITY_BUILD_MODE GROUP) + +set_source_files_properties(s1.c PROPERTIES UNITY_GROUP "a") +set_source_files_properties(s2.c PROPERTIES UNITY_GROUP "a") +set_source_files_properties(s3.c s4.c PROPERTIES UNITY_GROUP "b") |