Fix C++11 flags for MingW
authorRoland Schulz <roland@utk.edu>
Sun, 19 Oct 2014 16:04:16 +0000 (12:04 -0400)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 21 Oct 2014 16:55:13 +0000 (18:55 +0200)
Also replace all 'WIN32 AND NOT CYGWIN' with 'WIN32'. Since cmake
2.8.4 WIN32 doesn't include CYGWIN.

Change-Id: Ie93fa8a79daabcc3515e00cd1f95b76041417eb6

CMakeLists.txt
cmake/gmxManageOpenMP.cmake
cmake/gmxManageSharedLibraries.cmake
cmake/gmxTestCXX11.cmake
cmake/gmxTestCompilerProblems.cmake
src/external/tng_io/CMakeLists.txt

index 7fbe947522f707b751ec25248446b94e39af19e4..1f52c9abc401bfca274abcbe5860d03dcff2fd9d 100644 (file)
@@ -315,7 +315,7 @@ if(GMX_SOFTWARE_INVSQRT)
     list(APPEND INSTALLED_HEADER_DEFINITIONS "-DGMX_SOFTWARE_INVSQRT")
 endif()
 
-if(WIN32 AND NOT CYGWIN)
+if(WIN32)
     list(APPEND GMX_EXTRA_LIBRARIES "wsock32")
     add_definitions(-DGMX_HAVE_WINSOCK)
 endif()
@@ -470,7 +470,7 @@ if(CYGWIN)
     set(GMX_CYGWIN 1)
 endif()
 
-if(WIN32 AND NOT CYGWIN)
+if(WIN32)
     set(GMX_NATIVE_WINDOWS 1)
     # This makes windows.h not declare min/max as macros that would break
     # C++ code using std::min/std::max.
@@ -632,15 +632,14 @@ include(gmxManageLinearAlgebraLibraries)
 set(GMX_USE_PLUGINS OFF)
 
 if(GMX_LOAD_PLUGINS)
-  if(CYGWIN OR NOT WIN32)
+  if(NOT WIN32)
     # Native Windows does not have, nor need dlopen
-    # Note that WIN32 is set with Cygwin, but Cygwin needs dlopen to use plug-ins
     include(gmxTestdlopen)
     gmx_test_dlopen(HAVE_DLOPEN)
   endif()
 
   # so, should we use plug-ins?
-  if((WIN32 AND NOT CYGWIN) OR (HAVE_DLOPEN AND BUILD_SHARED_LIBS))
+  if(WIN32 OR (HAVE_DLOPEN AND BUILD_SHARED_LIBS))
     if(NOT VMD_QUIETLY)
       MESSAGE(STATUS "Using dynamic plugins (e.g VMD-supported file formats)")
     endif()
index cbad40bc671e1eb9a3867c4c7f5042ac28117248..d1a8e4dca576d00f1545c3109b82749a7b1dd7d9 100644 (file)
@@ -56,7 +56,7 @@ if(GMX_OPENMP)
         if(OPENMP_FOUND)
             # CMake on Windows doesn't support linker flags passed to target_link_libraries
             # (i.e. it treats /openmp as \openmp library file). Also, no OpenMP linker flags are needed.
-            if(NOT (WIN32 AND NOT CYGWIN AND NOT MINGW))
+            if(NOT (WIN32 AND NOT MINGW))
                 if(CMAKE_COMPILER_IS_GNUCC AND GMX_PREFER_STATIC_OPENMP AND NOT APPLE)
                     set(OpenMP_LINKER_FLAGS "-Wl,-static -lgomp -lrt -Wl,-Bdynamic -lpthread")
                     set(OpenMP_SHARED_LINKER_FLAGS "")
index b58a1be697620cb1ed2dfac7b9900d870e5ce391..75bb7c80802c2a3b5f53f2b290e9dbf078beb8e2 100644 (file)
@@ -60,7 +60,7 @@ if (GMX_PREFER_STATIC_LIBS)
     set(SHARED_LIBS_DEFAULT OFF)
 endif()
 set(GMX_PREFER_STATIC_LIBS_DEFAULT OFF)
-if (WIN32 AND NOT CYGWIN AND NOT BUILD_SHARED_LIBS)
+if (WIN32 AND NOT BUILD_SHARED_LIBS)
     set(GMX_PREFER_STATIC_LIBS_DEFAULT ON)
 endif()
 
@@ -73,7 +73,7 @@ endif()
 if (UNIX)
     set(GMX_PREFER_STATIC_LIBS_DESCRIPTION
         "When finding libraries prefer static archives (it will only work if static versions of external dependencies are available and found)")
-elseif (WIN32 AND NOT CYGWIN)
+elseif (WIN32)
     set(GMX_PREFER_STATIC_LIBS_DESCRIPTION
         "When finding libraries prefer static system libraries (MT instead of MD)")
 endif()
@@ -112,7 +112,7 @@ function(gmx_manage_prefer_static_libs_flags build_type)
     endforeach()
 endfunction()
 
-IF( WIN32 AND NOT CYGWIN)
+IF( WIN32)
   if (NOT BUILD_SHARED_LIBS)
       if(NOT GMX_PREFER_STATIC_LIBS)
           message(WARNING "Shared system libraries requested, and static Gromacs libraries requested.")
index b20f86fc4c1058a3888ebb3d322ed967c695c748..41e84c1d4eb9552633fdf873fae6a0ac2850604e 100644 (file)
@@ -34,7 +34,7 @@
 
 include(CheckCXXSourceCompiles)
 MACRO(GMX_TEST_CXX11 VARIABLE FLAG)
-    if(WIN32)
+    if(WIN32 AND NOT MINGW)
         set(CXX11_FLAG "/Qstd=c++0x")
     elseif(CYGWIN)
         set(CXX11_FLAG "-std=gnu++0x") #required for strdup
index a8cdb870df10e7f0cfbebe22e6928e79ef0f41f7..2748a2a4041c34bac9fc84f7b2f909ce0ce32314 100644 (file)
@@ -87,7 +87,7 @@ macro(gmx_test_compiler_problems)
         message(WARNING "GCC on Windows (GCC older than 4.9 or any version when compiling for 64bit) with AVX (other than AVX_128_FMA) crashes. Choose a different GMX_SIMD or a different compiler.") # GCC bug 49001, 54412.
     endif()
 
-    if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND WIN32 AND NOT CYGWIN)
+    if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND WIN32)
         if(CMAKE_VERSION VERSION_LESS 3.0.0)
             message(WARNING "Clang on Windows requires cmake 3.0.0")
         endif()
index 594069660edc51188b7dc0ed5ba8356ab9191541..87c10be8be43ef8f6fdda77ec6536a176f62711f 100644 (file)
@@ -5,7 +5,7 @@ project(TNG_IO)
 
 if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall")
-elseif(WIN32 AND NOT CYGWIN)
+elseif(WIN32)
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W2")
 endif()