summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorGlenn Coombs <glenn.coombs@gmail.com>2024-05-13 04:09:19 (GMT)
committerBrad King <brad.king@kitware.com>2024-05-15 17:27:46 (GMT)
commit8d2a503c1e65142732ca78d3df60dce9a929dee2 (patch)
tree19f1b9e880f978d1cec94ddcb327eb2338768bc2 /Source
parentb38000d77427e64da55527284f0d397749560890 (diff)
downloadCMake-8d2a503c1e65142732ca78d3df60dce9a929dee2.zip
CMake-8d2a503c1e65142732ca78d3df60dce9a929dee2.tar.gz
CMake-8d2a503c1e65142732ca78d3df60dce9a929dee2.tar.bz2
add_custom_command: Allow OUTPUT filenames containing a hash '#' character
Most generators now support this character after escaping and quoting cleanups over time. Disallow it only on generators that do support it. Fixes: #25604
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalGenerator.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 22daa0e..1440771 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -4403,7 +4403,12 @@ void CreateGeneratedSource(cmLocalGenerator& lg, const std::string& output,
}
// Make sure the output file name has no invalid characters.
- std::string::size_type pos = output.find_first_of("#<>");
+ const bool hashNotAllowed = lg.GetState()->UseBorlandMake();
+ std::string::size_type pos = output.find_first_of("<>");
+ if (pos == std::string::npos && hashNotAllowed) {
+ pos = output.find_first_of('#');
+ }
+
if (pos != std::string::npos) {
lg.GetCMakeInstance()->IssueMessage(
MessageType::FATAL_ERROR,