summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2020-01-14 17:48:08 (GMT)
committerCristian Adam <cristian.adam@gmail.com>2020-01-14 17:48:08 (GMT)
commit274a6f3699c1ad7b099bbabf49618f23122d84f0 (patch)
tree881df0530d3d267f6b46eb4bee61468ae595fad2
parente74049b3887432cbb972bb0948edf6615a7ebd69 (diff)
downloadCMake-274a6f3699c1ad7b099bbabf49618f23122d84f0.zip
CMake-274a6f3699c1ad7b099bbabf49618f23122d84f0.tar.gz
CMake-274a6f3699c1ad7b099bbabf49618f23122d84f0.tar.bz2
Unity Build: include language in generated source file name
Fixes: #20206
-rw-r--r--Source/cmLocalGenerator.cxx2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake4
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake4
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include-check.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake2
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake4
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake4
12 files changed, 16 insertions, 16 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index be13a37..fca04a8 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2523,7 +2523,7 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target)
chunk = std::min(itemsLeft, batchSize);
std::string filename = cmStrCat(filename_base, "unity_", batch,
- (lang == "C") ? ".c" : ".cxx");
+ (lang == "C") ? "_c.c" : "_cxx.cxx");
const std::string filename_tmp = cmStrCat(filename, ".tmp");
{
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake
index 32bb8e7..72cc2b9 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake
@@ -1,5 +1,5 @@
-set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
-set(unitybuild_c1 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_1.c")
+set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
+set(unitybuild_c1 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_1_c.c")
if(NOT EXISTS "${unitybuild_c0}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c0} does not exist.")
return()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake
index c980df0..024286d 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
if(NOT EXISTS "${unitybuild_c}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c} does not exist.")
return()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake
index 32c2992..269d545 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake
@@ -1,10 +1,10 @@
-set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
if(NOT EXISTS "${unitybuild_c}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c} does not exist.")
return()
endif()
-set(unitybuild_cxx "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.cxx")
+set(unitybuild_cxx "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_cxx.cxx")
if(NOT EXISTS "${unitybuild_cxx}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_cxx} does not exist.")
return()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake
index cb71ea3..22d2fc6 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
if(EXISTS "${unitybuild_c}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c} should not exist.")
return()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include-check.cmake
index 8fcb18f..e0935c7 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
file(STRINGS ${unitybuild_c} unitybuild_c_strings)
string(REGEX MATCH "#define NOMINMAX.*#include.*s1.c.*#undef NOMINMAX" matched_code ${unitybuild_c_strings})
if(NOT matched_code)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake
index 89a037a..9ef4c21 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_cxx "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.cxx")
+set(unitybuild_cxx "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_cxx.cxx")
if(NOT EXISTS "${unitybuild_cxx}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_cxx} does not exist.")
return()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake
index 7dfc007..9d39a70 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
file(STRINGS ${unitybuild_c0} unitybuild_c_strings REGEX "/s[0-9]+.c\"$" )
list(LENGTH unitybuild_c_strings number_of_includes)
if(NOT number_of_includes EQUAL 8)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake
index 533a89c..f26ec2e 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
file(STRINGS ${unitybuild_c} unitybuild_c_strings)
string(REGEX MATCH ".*#include.*s3.c.*#include.*s1.c.*#include.*s2.c.*" matched_code ${unitybuild_c_strings})
if(NOT matched_code)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake
index fdd45bc..e94ad72 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
file(STRINGS ${unitybuild_c} unitybuild_c_strings)
string(REGEX MATCH "\\/s[1-6].c" matched_files_1_6 ${unitybuild_c_strings})
diff --git a/Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake b/Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake
index 87f247d..693dcd9 100644
--- a/Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake
+++ b/Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
if(NOT EXISTS "${unitybuild_c0}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c0} does not exist.")
return()
@@ -32,7 +32,7 @@ if (NOT have_unity_support)
endif()
string(REPLACE "\\" "/" unity_source_line "${unity_source_line}")
-string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_0.c" unity_source_file_position)
+string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_0_c.c" unity_source_file_position)
if (unity_source_file_position EQUAL "-1")
set(RunCMake_TEST_FAILED "Generated project should include the generated unity source file.")
return()
diff --git a/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake b/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
index 1c6bab8..17e7b46 100644
--- a/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
+++ b/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
if(NOT EXISTS "${unitybuild_c0}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c0} does not exist.")
return()
@@ -28,7 +28,7 @@ foreach(line IN LISTS tgt_projects_strings)
endforeach()
string(REPLACE "\\" "/" unity_source_line ${unity_source_line})
-string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_0.c" unity_source_file_position)
+string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_0_c.c" unity_source_file_position)
if (unity_source_file_position EQUAL "-1")
set(RunCMake_TEST_FAILED "Generated project should include the generated unity source file.")
return()