diff options
author | Cristian Adam <cristian.adam@gmail.com> | 2019-11-06 13:57:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-11-06 16:47:15 (GMT) |
commit | 7ddf46230431cd3375f911d4b406af663595861d (patch) | |
tree | ef5d4bf7d8dffb519fd0f445283ffd7092bc66de /Tests/RunCMake/UnityBuild | |
parent | e0ec13059a04491c601e158c137cddc0802a410c (diff) | |
download | CMake-7ddf46230431cd3375f911d4b406af663595861d.zip CMake-7ddf46230431cd3375f911d4b406af663595861d.tar.gz CMake-7ddf46230431cd3375f911d4b406af663595861d.tar.bz2 |
Unity build: Include GENERATED files into unity build
There is no reason to skip the generated files, in case of problems
one can use the SKIP_UNITY_BUILD_INCLUSION property.
Fixes: #19925
Diffstat (limited to 'Tests/RunCMake/UnityBuild')
-rw-r--r-- | Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/UnityBuild/unitybuild_skip.cmake | 5 |
2 files changed, 4 insertions, 7 deletions
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake index fdd45bc..61419d8 100644 --- a/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake +++ b/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake @@ -1,9 +1,9 @@ set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c") file(STRINGS ${unitybuild_c} unitybuild_c_strings) -string(REGEX MATCH "\\/s[1-6].c" matched_files_1_6 ${unitybuild_c_strings}) -if(matched_files_1_6) - set(RunCMake_TEST_FAILED "Generated unity contains s1.c -> s6.c which should have been skipped") +string(REGEX MATCH "\\/s[2-6].c" matched_files_2_6 ${unitybuild_c_strings}) +if(matched_files_2_6) + set(RunCMake_TEST_FAILED "Generated unity contains s2.c -> s6.c which should have been skipped") return() endif() diff --git a/Tests/RunCMake/UnityBuild/unitybuild_skip.cmake b/Tests/RunCMake/UnityBuild/unitybuild_skip.cmake index 74524ad..eef8ccc 100644 --- a/Tests/RunCMake/UnityBuild/unitybuild_skip.cmake +++ b/Tests/RunCMake/UnityBuild/unitybuild_skip.cmake @@ -1,7 +1,7 @@ project(unitybuild_skip C) set(srcs "") -foreach(s RANGE 1 8) +foreach(s RANGE 2 8) set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c") file(WRITE "${src}" "int s${s}(void) { return 0; }\n") list(APPEND srcs "${src}") @@ -11,9 +11,6 @@ add_library(tgt SHARED ${srcs}) set_target_properties(tgt PROPERTIES UNITY_BUILD ON) -set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/s1.c - PROPERTIES GENERATED ON) - set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/s2.c PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) |