瀏覽代碼

fix for cygwin and nmake that does not define WIN32

Bill Hoffman 23 年之前
父節點
當前提交
94f1e8f5c5
共有 2 個文件被更改,包括 5 次插入2 次删除
  1. 4 0
      Source/cmDynamicLoader.cxx
  2. 1 2
      Source/cmGlobalGenerator.cxx

+ 4 - 0
Source/cmDynamicLoader.cxx

@@ -344,7 +344,11 @@ const char* cmDynamicLoader::LibPrefix()
 
 const char* cmDynamicLoader::LibExtension()
 {
+#ifdef __CYGWIN__
+  return ".dll";
+#else
   return ".so";
+#endif
 }
 
 const char* cmDynamicLoader::LastError()

+ 1 - 2
Source/cmGlobalGenerator.cxx

@@ -166,7 +166,7 @@ int cmGlobalGenerator::TryCompile(const char *, const char *bindir,
     {
     makeCommand += " ";
     makeCommand += target;
-#ifdef WIN32
+#if defined(_WIN32) || defined(__CYGWIN__)
     makeCommand += ".exe";
 #endif // WIN32
     }
@@ -175,7 +175,6 @@ int cmGlobalGenerator::TryCompile(const char *, const char *bindir,
     makeCommand += " all";
     }
   int retVal;
-  
   if (!cmSystemTools::RunCommand(makeCommand.c_str(), *output, retVal, 0, false))
     {
     cmSystemTools::Error("Generator: execution of make failed.");