diff options
author | Brad King <brad.king@kitware.com> | 2021-07-02 18:23:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-07-12 16:21:52 (GMT) |
commit | 6c440ea3ce36d4c5b1629f111f376e809c7e99b2 (patch) | |
tree | e25d3289140a86f185698631e6082ba1991c597e /Source/cmState.h | |
parent | 2065bd73cb6a9a3bc463c5bb0dc6877433782973 (diff) | |
download | CMake-6c440ea3ce36d4c5b1629f111f376e809c7e99b2.zip CMake-6c440ea3ce36d4c5b1629f111f376e809c7e99b2.tar.gz CMake-6c440ea3ce36d4c5b1629f111f376e809c7e99b2.tar.bz2 |
cmake: Model normal and try-compile project kinds explicitly
Construct with the project kind instead of mutating state after
construction.
Diffstat (limited to 'Source/cmState.h')
-rw-r--r-- | Source/cmState.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/cmState.h b/Source/cmState.h index c7f6a1e..8561fc0 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -45,7 +45,13 @@ public: CPack, }; - cmState(Mode mode); + enum class ProjectKind + { + Normal, + TryCompile, + }; + + cmState(Mode mode, ProjectKind projectKind = ProjectKind::Normal); ~cmState(); cmState(const cmState&) = delete; @@ -141,9 +147,6 @@ public: void SetEnabledLanguages(std::vector<std::string> const& langs); void ClearEnabledLanguages(); - bool GetIsInTryCompile() const; - void SetIsInTryCompile(bool b); - bool GetIsGeneratorMultiConfig() const; void SetIsGeneratorMultiConfig(bool b); @@ -210,6 +213,8 @@ public: static std::string ModeToString(Mode mode); + ProjectKind GetProjectKind() const; + private: friend class cmake; void AddCacheEntry(const std::string& key, const char* value, @@ -247,7 +252,6 @@ private: std::string SourceDirectory; std::string BinaryDirectory; - bool IsInTryCompile = false; bool IsGeneratorMultiConfig = false; bool WindowsShell = false; bool WindowsVSIDE = false; @@ -258,4 +262,5 @@ private: bool MSYSShell = false; bool NinjaMulti = false; Mode StateMode = Unknown; + ProjectKind StateProjectKind = ProjectKind::Normal; }; |