From: Roland Schulz Date: Sun, 19 Oct 2014 16:04:16 +0000 (-0400) Subject: Fix C++11 flags for MingW X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=065e529e40b39ecacf266b3b8e28c8b71ac05235;p=alexxy%2Fgromacs.git Fix C++11 flags for MingW Also replace all 'WIN32 AND NOT CYGWIN' with 'WIN32'. Since cmake 2.8.4 WIN32 doesn't include CYGWIN. Change-Id: Ie93fa8a79daabcc3515e00cd1f95b76041417eb6 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fbe947522..1f52c9abc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/cmake/gmxManageOpenMP.cmake b/cmake/gmxManageOpenMP.cmake index cbad40bc67..d1a8e4dca5 100644 --- a/cmake/gmxManageOpenMP.cmake +++ b/cmake/gmxManageOpenMP.cmake @@ -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 "") diff --git a/cmake/gmxManageSharedLibraries.cmake b/cmake/gmxManageSharedLibraries.cmake index b58a1be697..75bb7c8080 100644 --- a/cmake/gmxManageSharedLibraries.cmake +++ b/cmake/gmxManageSharedLibraries.cmake @@ -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.") diff --git a/cmake/gmxTestCXX11.cmake b/cmake/gmxTestCXX11.cmake index b20f86fc4c..41e84c1d4e 100644 --- a/cmake/gmxTestCXX11.cmake +++ b/cmake/gmxTestCXX11.cmake @@ -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 diff --git a/cmake/gmxTestCompilerProblems.cmake b/cmake/gmxTestCompilerProblems.cmake index a8cdb870df..2748a2a404 100644 --- a/cmake/gmxTestCompilerProblems.cmake +++ b/cmake/gmxTestCompilerProblems.cmake @@ -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() diff --git a/src/external/tng_io/CMakeLists.txt b/src/external/tng_io/CMakeLists.txt index 594069660e..87c10be8be 100644 --- a/src/external/tng_io/CMakeLists.txt +++ b/src/external/tng_io/CMakeLists.txt @@ -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()