summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/FindRuby.cmake2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmListFileCache.cxx12
-rw-r--r--Source/cmLocalNinjaGenerator.cxx6
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/LongCommandLine.cmake16
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake5
6 files changed, 40 insertions, 3 deletions
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index ee07f83..759f57c 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -435,7 +435,7 @@ endif()
# Determine the list of possible names for the ruby library
-set(_Ruby_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_Ruby_VERSION_SHORT} ruby${_Ruby_VERSION_SHORT_NODOT} ruby-${_Ruby_VERSION_SHORT} ruby-${Ruby_VERSION})
+set(_Ruby_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_Ruby_VERSION_SHORT} ruby${_Ruby_VERSION_SHORT_NODOT} ruby${_Ruby_NODOT_VERSION} ruby-${_Ruby_VERSION_SHORT} ruby-${Ruby_VERSION})
if(WIN32)
set(_Ruby_POSSIBLE_MSVC_RUNTIMES "msvcrt;vcruntime140;vcruntime140_1")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index dd9f4cb..fa9d567 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 20)
-set(CMake_VERSION_PATCH 20210325)
+set(CMake_VERSION_PATCH 20210326)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 1464a14..5c3a034 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -7,6 +7,10 @@
#include <sstream>
#include <utility>
+#ifdef _WIN32
+# include <cmsys/Encoding.hxx>
+#endif
+
#include "cmListFileLexer.h"
#include "cmMessageType.h"
#include "cmMessenger.h"
@@ -83,9 +87,15 @@ bool cmListFileParser::ParseFile(const char* filename)
{
this->FileName = filename;
+#ifdef _WIN32
+ std::string expandedFileName = cmsys::Encoding::ToNarrow(
+ cmSystemTools::ConvertToWindowsExtendedPath(filename));
+ filename = expandedFileName.c_str();
+#endif
+
// Open the file.
cmListFileLexer_BOM bom;
- if (!cmListFileLexer_SetFileName(this->Lexer, this->FileName, &bom)) {
+ if (!cmListFileLexer_SetFileName(this->Lexer, filename, &bom)) {
this->IssueFileOpenError("cmListFileCache: error can not open file.");
return false;
}
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 981c9cf..f2575c9 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -654,6 +654,12 @@ void cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
gg->WriteBuild(this->GetImplFileStream(fileConfig), build);
} else {
std::string customStep = cmSystemTools::GetFilenameName(ninjaOutputs[0]);
+ if (this->GlobalGenerator->IsMultiConfig()) {
+ customStep += '-';
+ customStep += fileConfig;
+ customStep += '-';
+ customStep += ccg.GetOutputConfig();
+ }
// Hash full path to make unique.
customStep += '-';
cmCryptoHash hash(cmCryptoHash::AlgoSHA256);
diff --git a/Tests/RunCMake/NinjaMultiConfig/LongCommandLine.cmake b/Tests/RunCMake/NinjaMultiConfig/LongCommandLine.cmake
new file mode 100644
index 0000000..00aa896
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/LongCommandLine.cmake
@@ -0,0 +1,16 @@
+enable_language(C)
+
+add_executable(generator main.c)
+
+string(REPEAT "." 5000 very_long)
+
+add_custom_command(
+ OUTPUT gen.txt
+ COMMAND generator "${very_long}" > gen.txt
+ )
+
+add_custom_target(
+ custom
+ ALL
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/gen.txt"
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
index 21c2658..0d4db52 100644
--- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
@@ -193,9 +193,14 @@ run_cmake_build(SimpleCrossConfigs all-relwithdebinfo-in-release-graph Release a
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/PostBuild-build)
set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSS_CONFIGS=all")
run_cmake_configure(PostBuild)
+unset(RunCMake_TEST_OPTIONS)
run_cmake_build(PostBuild release Release Exe)
run_cmake_build(PostBuild debug-in-release-graph Release Exe:Debug)
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/LongCommandLine-build)
+run_cmake_configure(LongCommandLine)
+run_cmake_build(LongCommandLine release Release custom)
+
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Framework-build)
set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSS_CONFIGS=all")
run_cmake_configure(Framework)