summaryrefslogtreecommitdiffstats
path: root/Source/cmState.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r--Source/cmState.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index f2fe134..0470508 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -1286,8 +1286,9 @@ void cmState::Snapshot::SetDefaultDefinitions()
this->SetDefinition("CMAKE_HOST_UNIX", "1");
#endif
#if defined(__CYGWIN__)
- if (cmSystemTools::IsOn(
- cmSystemTools::GetEnv("CMAKE_LEGACY_CYGWIN_WIN32"))) {
+ std::string legacy;
+ if (cmSystemTools::GetEnv("CMAKE_LEGACY_CYGWIN_WIN32", legacy) &&
+ cmSystemTools::IsOn(legacy.c_str())) {
this->SetDefinition("WIN32", "1");
this->SetDefinition("CMAKE_HOST_WIN32", "1");
}