diff options
author | Brad King <brad.king@kitware.com> | 2019-11-12 14:51:05 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-11-12 14:51:15 (GMT) |
commit | eae743bf17605c28ee4afd02991d3271efb5c8a9 (patch) | |
tree | d2a32c6d4fa109705b2a559da1234683e234f6c8 /Tests/RunCMake | |
parent | 88e0dca40df9c88e7d9b9d352fe19f63091bc7c3 (diff) | |
parent | 9a5418320ea40d61a63fd47e5ac133c3ff780062 (diff) | |
download | CMake-eae743bf17605c28ee4afd02991d3271efb5c8a9.zip CMake-eae743bf17605c28ee4afd02991d3271efb5c8a9.tar.gz CMake-eae743bf17605c28ee4afd02991d3271efb5c8a9.tar.bz2 |
Merge topic 'unity-HEADER_FILE_ONLY' into release-3.16
9a5418320e Unity: Don't include sources with HEADER_FILE_ONLY property set
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4023
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/UnityBuild/unitybuild_runtest.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/UnityBuild/unitybuild_skip.cmake | 5 |
3 files changed, 8 insertions, 4 deletions
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_runtest.cmake b/Tests/RunCMake/UnityBuild/unitybuild_runtest.cmake index 8816299..3589cc8 100644 --- a/Tests/RunCMake/UnityBuild/unitybuild_runtest.cmake +++ b/Tests/RunCMake/UnityBuild/unitybuild_runtest.cmake @@ -2,6 +2,7 @@ project(unitybuild_runtest C) set(CMAKE_UNITY_BUILD ON) # This tests that the variable works in addition to the property +add_library(lib main.c func.c) add_executable(main main.c func.c) enable_testing() diff --git a/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake index 61419d8..fdd45bc 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[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") +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") return() endif() diff --git a/Tests/RunCMake/UnityBuild/unitybuild_skip.cmake b/Tests/RunCMake/UnityBuild/unitybuild_skip.cmake index eef8ccc..94e5aa3 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 2 8) +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}") @@ -11,6 +11,9 @@ add_library(tgt SHARED ${srcs}) set_target_properties(tgt PROPERTIES UNITY_BUILD ON) +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/s1.c + PROPERTIES HEADER_FILE_ONLY ON) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/s2.c PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) |