summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.h
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-02-08 03:37:54 (GMT)
committerBrad King <brad.king@kitware.com>2014-05-08 17:24:49 (GMT)
commitbc3856586388a610ef3d06d51c212a9ed25856c4 (patch)
tree8831a5a62c03baae846e3065b2e0414837fefed8 /Source/cmMakefile.h
parent25102efc1db1e0d165ebe5e4eaef33b8206d9d3e (diff)
downloadCMake-bc3856586388a610ef3d06d51c212a9ed25856c4.zip
CMake-bc3856586388a610ef3d06d51c212a9ed25856c4.tar.gz
CMake-bc3856586388a610ef3d06d51c212a9ed25856c4.tar.bz2
EVIS: Reimplement using custom parsing code
Introduce a new implementation of ExpandVariablesInString and select between the old and new implementations based on policy CMP0053. Instead of cmCommandArgumentParserHelper, use a custom parser with our own stack. This is much faster and works well for our simple grammar. The new behavior of CMP0053 should expand @VAR@ syntax only in certain contexts. All existing EVIS callers use "replaceAt == true" so hard-code our call to the old implementation. Update the signature to default to "replaceAt == false" and pass "replaceAt == true" explicitly in the call sites for configure_file and string(CONFIGURE). Testing the configure (no generate) step with ParaView shows ~20% performance improvement. In terms of complete configure/generate steps, further testing with ParaView shows a 20% performance improvement over 2.8.12.2 with Unix Makefiles and minimal with Ninja. Ninja is less because it generate step is the expensive part (future work will address this) by a long shot and these changes help the configure step for the most part.
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r--Source/cmMakefile.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index ac00771..2bfd19b 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -679,7 +679,7 @@ public:
const char* filename = 0,
long line = -1,
bool removeEmpty = false,
- bool replaceAt = true) const;
+ bool replaceAt = false) const;
/**
* Remove any remaining variables in the string. Anything with ${var} or
@@ -994,6 +994,7 @@ private:
mutable cmsys::RegularExpression cmDefineRegex;
mutable cmsys::RegularExpression cmDefine01Regex;
mutable cmsys::RegularExpression cmAtVarRegex;
+ mutable cmsys::RegularExpression cmNamedCurly;
cmPropertyMap Properties;
@@ -1050,6 +1051,28 @@ private:
// Enforce rules about CMakeLists.txt files.
void EnforceDirectoryLevelRules() const;
+ // CMP0053 == old
+ cmake::MessageType ExpandVariablesInStringOld(
+ std::string& errorstr,
+ std::string& source,
+ bool escapeQuotes,
+ bool noEscapes,
+ bool atOnly,
+ const char* filename,
+ long line,
+ bool removeEmpty,
+ bool replaceAt) const;
+ // CMP0053 == new
+ cmake::MessageType ExpandVariablesInStringNew(
+ std::string& errorstr,
+ std::string& source,
+ bool escapeQuotes,
+ bool noEscapes,
+ bool atOnly,
+ const char* filename,
+ long line,
+ bool removeEmpty,
+ bool replaceAt) const;
bool GeneratingBuildSystem;
/**
* Old version of GetSourceFileWithOutput(const std::string&) kept for