summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-10-27 09:24:46 -0400
committerBrad King <brad.king@kitware.com>2022-10-27 09:24:46 -0400
commite677cc421df068ca3d28b1bb98ee227ea14bcee0 (patch)
tree195fad5574271eb9dae86058731d5cac9caeb9d0
parent85191f65d26a6973f16db0e6dbcb91b23cfa6fcc (diff)
parenta12050666c5441abc4865acdde9ee583e765d6e6 (diff)
downloadcmake-e677cc421df068ca3d28b1bb98ee227ea14bcee0.tar.gz
Merge branch 'ninja-intl-paths' into release-3.24
Merge-request: !7833
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx13
-rw-r--r--Source/cmGlobalNinjaGenerator.h1
-rw-r--r--Tests/RunCMake/Ninja/Intl-build-check.cmake5
-rw-r--r--Tests/RunCMake/Ninja/Intl-common.cmake1
-rw-r--r--Tests/RunCMake/Ninja/Intl.cmake7
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake9
6 files changed, 22 insertions, 14 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index acaed36728..6248f09a5f 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1025,19 +1025,6 @@ bool cmGlobalNinjaGenerator::OpenBuildFileStreams()
return false;
}
- // New buffer size 8 MiB
- constexpr auto buildFileStreamBufferSize = 8 * 1024 * 1024;
-
- // Ensure the buffer is allocated
- if (!this->BuildFileStreamBuffer) {
- this->BuildFileStreamBuffer =
- cm::make_unique<char[]>(buildFileStreamBufferSize);
- }
-
- // Enlarge the internal buffer of the `BuildFileStream`
- this->BuildFileStream->rdbuf()->pubsetbuf(this->BuildFileStreamBuffer.get(),
- buildFileStreamBufferSize);
-
// Write a comment about this file.
*this->BuildFileStream
<< "# This file contains all the build statements describing the\n"
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index aa2df4d5cc..03387a88f3 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -529,7 +529,6 @@ private:
/// The file containing the build statement. (the relationship of the
/// compilation DAG).
std::unique_ptr<cmGeneratedFileStream> BuildFileStream;
- std::unique_ptr<char[]> BuildFileStreamBuffer;
/// The file containing the rule statements. (The action attached to each
/// edge of the compilation DAG).
std::unique_ptr<cmGeneratedFileStream> RulesFileStream;
diff --git a/Tests/RunCMake/Ninja/Intl-build-check.cmake b/Tests/RunCMake/Ninja/Intl-build-check.cmake
new file mode 100644
index 0000000000..77f013c7eb
--- /dev/null
+++ b/Tests/RunCMake/Ninja/Intl-build-check.cmake
@@ -0,0 +1,5 @@
+include(${RunCMake_SOURCE_DIR}/Intl-common.cmake)
+set(output "${RunCMake_TEST_BINARY_DIR}/${intl}-output.txt")
+if(NOT EXISTS "${output}")
+ set(RunCMake_TEST_FAILED "Expected output does not exist:\n ${output}")
+endif()
diff --git a/Tests/RunCMake/Ninja/Intl-common.cmake b/Tests/RunCMake/Ninja/Intl-common.cmake
new file mode 100644
index 0000000000..7703976813
--- /dev/null
+++ b/Tests/RunCMake/Ninja/Intl-common.cmake
@@ -0,0 +1 @@
+set(intl "intl-ë®")
diff --git a/Tests/RunCMake/Ninja/Intl.cmake b/Tests/RunCMake/Ninja/Intl.cmake
new file mode 100644
index 0000000000..50e4ee41ef
--- /dev/null
+++ b/Tests/RunCMake/Ninja/Intl.cmake
@@ -0,0 +1,7 @@
+include(Intl-common.cmake)
+set(input "${CMAKE_CURRENT_BINARY_DIR}/${intl}-input.txt")
+set(output "${CMAKE_CURRENT_BINARY_DIR}/${intl}-output.txt")
+file(WRITE "${input}" "${intl}\n")
+add_custom_command(OUTPUT "${output}"
+ COMMAND ${CMAKE_COMMAND} -E copy "${input}" "${output}")
+add_custom_target(drive ALL DEPENDS "${output}")
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 2a5b556201..0825666a06 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -33,6 +33,15 @@ function(run_NinjaToolMissing)
endfunction()
run_NinjaToolMissing()
+function(run_Intl)
+ run_cmake(Intl)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Intl-build)
+ set(RunCMake_TEST_OUTPUT_MERGE 1)
+ run_cmake_command(Intl-build ${CMAKE_COMMAND} --build .)
+endfunction()
+run_Intl()
+
function(run_NoWorkToDo)
run_cmake(NoWorkToDo)
set(RunCMake_TEST_NO_CLEAN 1)